• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Spell bugged

ApocalypseOT

New Member
Joined
Aug 13, 2011
Messages
75
Reaction score
0
I have a spell that gives me the error
frost trap.lua:oncast 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

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
 
Back
Top