Define the Error: When the items are on the ground they do not get removed (can make infinite sets), if player does not have items required in config it still makes it anyway!
Would be lovely to have a "You don't have the required items" message when it detects that the player does not have the items.
Code:
local set = {
[2491] = {Armor = 7902, Name = 'Frozen Mask', Item_Remove = { {2491, 1}, {8300, 1}, {5944, 5} }, Storage = 42824},
[2487] = {Armor = 7897, Name = 'Frozen Robe', Item_Remove = { {2487, 1}, {8300, 1}, {5944, 5} }, Storage = 42825},
[2488] = {Armor = 7896, Name = 'Frozen Kilt', Item_Remove = { {2488, 1}, {8300, 1}, {5944, 5} }, Storage = 42826},
[2519] = {Armor = 8907, Name = 'Frozen Shield', Item_Remove = { {2519, 1}, {8300, 1}, {5944, 5} }, Storage = 42827}
}
-- Do not edit below, only edit the table 'set' that is above. You can add as many items to upgrade as possible.
function onUse(cid, item, fromPosition, itemEx, toPosition)
if set[itemEx.itemid] then
local give = set[itemEx.itemid]
if getPlayerStorageValue(cid, give.Storage) == 10 then
doCreatureSay(cid, 'You can only upgrade this piece once.', TALKTYPE_ORANGE_1)
return false
end
doPlayerAddItem(cid, give.Armor, 1)
for i = 1, #give.Item_Remove do
doPlayerRemoveItem(cid, give.Item_Remove[i][1], give.Item_Remove[i][2])
end
setPlayerStorageValue(cid, give.Storage, 1)
doCreatureSay(cid, 'Your item has been upgraded to a '.. give.Name .. '.', TALKTYPE_ORANGE_1)
else
doCreatureSay(cid, 'This item cannot be upgraded.', TALKTYPE_ORANGE_1)
return false
end
return true
end
Would be lovely to have a "You don't have the required items" message when it detects that the player does not have the items.
Last edited: