Create a free account to remove all ad content.

Author Topic:  [Blueprint] Item Repair Chest  (Read 364 times)

0 Members and 1 Guest are viewing this topic.

muD

  • Legendary Member
  • *
  • Posts: 1177
    • View Profile
[Blueprint] Item Repair Chest
« on: December 31, 2014, 08:54:58 AM »
Item Repair Chest

This gadget can be set to repair any & every item, for a fee..



Place your worn items in the chest to have them repaired  -  Return any time with the fee to collect them
Supports multiple items & multiple players.
No one can take anyone else's items  -  No administration required.

The Scripts

These scripts can be replicated into your Creative world.
Note: Replace all the forward slashes with backslashes. The forum board will not display the backslash.

Spoiler for Scripts:
Place a chest on a scriptblock anywhere in your Creative world.

<- Leave empty
<- Set to run 2 scripts.

Script 1:
RepairBench/Close
-Run when scriptblock is powered Off. When chest is closed

Code: [Select]
1. If
2.   HasInventory [rel:0,1,0] [ironsword] [true]
3. Then
4.   Inventory [rel:0,1,0] [take] [ironsword] [1]
5.   History [Repair/Item] [player]
6.   History [Repair/Ironsword] [player]
7.   Notify [Your Iron Sword is being repaired.] [local]
8. Endif
9.
10.  // To add more item support: Copy and paste lines 1-8, then edit the item names.
11.  // Example:
12.
13. If
14.   HasInventory [rel:0,1,0] [steelsword] [true]
15. Then
16.   Inventory [rel:0,1,0] [take] [steelsword] [1]
17.   History [Repair/Item] [player]
18.   History [Repair/Steelsword] [player]
19.   Notify [Your Steel Sword is being repaired.] [local]
20. Endif


Script 2:

RepairBench/Open
-Run when scriptblock is powered On. When chest is opened

Code: [Select]
1. If
2.   HasHistory [Repair/Item] [player] [false]
3. Then
4.   Notify [Repair your items here!] [local]
5.   Notify [Only 200gps per item!] [local]
6. Elseif
7.   HasHistory [Repair/Item] [player]
8.   HasInventory [player] [goldpieces] [<] [200]
9. Then
10.  Notify [Your item has been repaired.]
11.  Notify [Bring the fee to collect it.]
12. Endif
13.
14. If
15.   HasHistory [Repair/Ironsword] [player]
16.   HasInventory [player] [goldpieces] [>=] [200]
17. Then
18.   Inventory [rel:0,1,0] [add] [ironsword]
19.   Inventory [player] [take] [goldpieces] [200]
20.   History [Repair/Item] [decrease] [player]
21.   History [Repair/Ironsword] [decrease] [player]
22.   Notify [Your Iron Sword has been repaired.]
23.   Notfiy [Collect your item.]
24. Endif
25.
26. // To add more item support: Copy & Paste lines 14-24, then edit the item names.
27. // Example:
28.
29. If
30.   HasHistory [Repair/Steelsword] [player]
31.   HasInventory [player] [goldpieces] [>=] [200]
32. Then
33.   Inventory [rel:0,1,0] [add] [steelsword]
34.   Inventory [player] [take] [goldpieces] [200]
35.   History [Repair/Item] [decrease] [player]
36.   History [Repair/Steelsword] [decrease] [player]
37.   Notify [Your Steel Sword has been repaired.]
38.   Notfiy [Collect your item.]
39. Endif


Can be modified to:
-Set different fees for different items.

Suggestions:
-Loop the scripts 50 times to make it account for the maximum amount of multiple, repairable items. So it can manage a chest full of Iron Swords, for example.