Imfreezing
Krossa Kapitalismen
Hi Otland, i have a problem with this script
i get this error
0.3.6 v8.2 thanks
Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
local aid = item.actionid-_storage
local xpos = {x=996,y=998,z=8}
if aid == _events_tp[1] and (getGlobalStorageValue(event_config.active) == -1 or getGlobalStorageValue(event_config.active) == 0) then
doSendMagicEffect(getPlayerPosition(cid),2)
doTeleportThing(cid,fromPosition)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,_events_tp[2])
return true
end
if _tp[aid] == nil then
if isInArray({50001,50002,50003,50004,50005},item.uid) == true then
doTeleportThing(cid,xpos)
doSendMagicEffect(xpos,2)
end
return true
end
local callback = _tp[aid].callback and _tp[aid].callback(cid) or true
if type(callback) == "string" then
doSendMagicEffect(getThingPos(cid), 2)
doTeleportThing(cid, fromPosition, true)
doSendMagicEffect(getThingPos(cid), 38)
return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, callback)
end
if _tp[aid].msg then
doPlayerSendTextMessage(cid,_tp[aid].msg[2],_tp[aid].msg[1])
end
if _tp[aid].pos then
doTeleportThing(cid,_tp[aid].pos)
doSendMagicEffect(_tp[aid].pos,10)
end
if _tp[aid].func ~= nil then
for i = 1,#_tp[aid].func do
_tp[aid].func(cid)
end
end
if _tp[aid].count == nil and isInArray({50001,50002,50003,50004,50005},item.uid) == false then
setGlobalStorageValue(_storage+aid,(getGlobalStorageValue(_storage+aid) < 0 and 1 or getGlobalStorageValue(_storage+aid)+1))
end
return true
end
Code:
[04/08/2014 13:16:52] [Error - MoveEvents Interface]
[04/08/2014 13:16:52] data/movements/scripts/tp_sys.lua:onStepIn
[04/08/2014 13:16:52] Description:
[04/08/2014 13:16:52] data/movements/scripts/tp_sys.lua:2: attempt to perform arithmetic on global '_storage' (a nil value)
[04/08/2014 13:16:52] stack traceback:
[04/08/2014 13:16:52] data/movements/scripts/tp_sys.lua:2: in function <data/movements/scripts/tp_sys.lua:1>