0.4
Hi guys, I'm having a little trouble trying to do this.
This spell add a storage to a player, and after 15 seconds, the storage backs to -1. I'm trying to use spells params=1 in spells.xml, just like exura sio and such, but it does not seem to work.
Hi guys, I'm having a little trouble trying to do this.
This spell add a storage to a player, and after 15 seconds, the storage backs to -1. I'm trying to use spells params=1 in spells.xml, just like exura sio and such, but it does not seem to work.
Lua:
function onCastSpell(cid, var)
local storage = 121345
local storage2 = 300
if getCreatureStorage(cid, storage) > 0 then
doPlayerSendCancel(cid, "Already have the storage")
return false
end
doCreatureSetStorage(cid, storage, storage2)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Storage add")
addEvent(function()
if isCreature(cid) then
doCreatureSetStorage(cid, storage, nil)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Storage over")
end
end, 15000)
return true
end