Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onEquip(cid, item, slot)
- local slots = getPlayerSlotItem(cid, slot)
- if slots.itemid ~= item.itemid then
- return true
- end
- if getItemAttribute(item.uid, 'description') == nil then return true end
- local desc = getItemAttribute(item.uid, 'description')
- if string.find(desc:lower(), 'attack damage:') ~= nil then
- local x = string.sub(desc, 17)
- local y = string.sub(desc, 8)
- local z = string.sub(desc, 9)
- setPlayerStorageValue(cid, 9002, getCreatureStorage(cid, 9002) + x)
- elseif string.find(desc:lower(), 'dodge:') ~= nil then
- setPlayerStorageValue(cid, 48902, getCreatureStorage(cid, 48902) + y)
- elseif string.find(desc:lower(), 'resist:') ~= nil then
- setPlayerStorageValue(cid, 9003, getCreatureStorage(cid, 9003) + z)
- end
- end
- return true
- end
- function onDeEquip(cid, item, slot)
- if getItemAttribute(item.uid, 'description') == nil then return true end
- local desc = getItemAttribute(item.uid, 'description')
- if string.find(desc:lower(), 'attack damage:') ~= nil then
- local x = string.sub(desc, 17)
- local y = string.sub(desc, 8)
- local z = string.sub(desc, 9)
- setPlayerStorageValue(cid, 9002, getCreatureStorage(cid, 9002) - x)
- elseif string.find(desc:lower(), 'dodge:') ~= nil then
- setPlayerStorageValue(cid, 48902, getCreatureStorage(cid, 48902) - y)
- elseif string.find(desc:lower(), 'resist:') ~= nil then
- setPlayerStorageValue(cid, 9003, getCreatureStorage(cid, 9003) - z)
- end
- print("DEQUIPED")
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement