ApocalypseOT
New Member
- Joined
- Aug 13, 2011
- Messages
- 75
- Reaction score
- 0
I have a spell that gives me the error
frost trap.lua
ncast spell
frost trap.lua:2: attempt to index'global' traps_exhaust' <a nil value>
stack traceback frost trap.lua:2: in fuction
Heres the script
frost trap.lua
frost trap.lua:2: attempt to index'global' traps_exhaust' <a nil value>
stack traceback frost trap.lua:2: in fuction
Heres the script
PHP:
function onCastSpell(cid, var)
if(traps_exhaust[getPlayerGUID(cid)] == nil) or (traps_exhaust[getPlayerGUID(cid)] < os.time()) then
traps_exhaust[getPlayerGUID(cid)] = os.time() + 15
local uid = doCreateItemEx(2579)
doTileAddItemEx(getCreaturePosition(cid), uid)
doItemSetAttribute(uid, "name", "Slow Trap")
doItemSetAttribute(uid, "aid", 54641)
addEvent(removeTrap, 15 * 1000, getCreaturePosition(cid))
return true
else
doPlayerSendCancel(cid, "You can create only one new trap every 15 seconds.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return false
end
end