• 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!

Storage Problem

Imfreezing

Krossa Kapitalismen
Joined
Jun 7, 2012
Messages
1,009
Solutions
1
Reaction score
88
Location
Edron
Hi Otland, i have a problem with this script
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
i get this error
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>
0.3.6 v8.2 thanks
 
[04/08/2014 13:34:38] [Error - MoveEvents Interface]
[04/08/2014 13:34:38] data/movements/scripts/tp_sys.lua:eek:nStepIn
[04/08/2014 13:34:38] Description:
[04/08/2014 13:34:38] data/movements/scripts/tp_sys.lua:4: attempt to index global '_events_tp' (a nil value)
[04/08/2014 13:34:38] stack traceback:
[04/08/2014 13:34:38] data/movements/scripts/tp_sys.lua:4: in function <data/movements/scripts/tp_sys.lua:1>
Add: _storage = 50000
in libs.
 
Code:
local xpos = {x=996,y=998,z=8}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    local aid = item.actionid-_storage

    local tp = _tp[aid]
    if not tp then
        if isInArray({50001,50002,50003,50004,50005}, item.uid) then
            doTeleportThing(cid, xpos)
            doSendMagicEffect(xpos, 2)
        end
        return true
    end

    local callback = tp.callback and tp.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.msg then
        doPlayerSendTextMessage(cid, tp.msg[2], tp.msg[1])
    end

    if tp.pos then
        doTeleportThing(cid,tp.pos)
        doSendMagicEffect(tp.pos,10)
    end

    if tp.func then
        for i = 1, #tp.func do
            tp.func(cid)
        end
    end

    if not tp.count and not isInArray({50001,50002,50003,50004,50005},item.uid) then
        setGlobalStorageValue(_storage+aid,(getGlobalStorageValue(_storage+aid) < 0 and 1 or getGlobalStorageValue(_storage+aid)+1))
    end
    return true
end
 
Code:
local xpos = {x=996,y=998,z=8}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    local aid = item.actionid-_storage

    local tp = _tp[aid]
    if not tp then
        if isInArray({50001,50002,50003,50004,50005}, item.uid) then
            doTeleportThing(cid, xpos)
            doSendMagicEffect(xpos, 2)
        end
        return true
    end

    local callback = tp.callback and tp.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.msg then
        doPlayerSendTextMessage(cid, tp.msg[2], tp.msg[1])
    end

    if tp.pos then
        doTeleportThing(cid,tp.pos)
        doSendMagicEffect(tp.pos,10)
    end

    if tp.func then
        for i = 1, #tp.func do
            tp.func(cid)
        end
    end

    if not tp.count and not isInArray({50001,50002,50003,50004,50005},item.uid) then
        setGlobalStorageValue(_storage+aid,(getGlobalStorageValue(_storage+aid) < 0 and 1 or getGlobalStorageValue(_storage+aid)+1))
    end
    return true
end
Thanks! but some tps dosnt work :Z
Code:
[04/08/2014 13:50:41] [Error - MoveEvents Interface]
[04/08/2014 13:50:41] data/movements/scripts/tp_sys.lua:onStepIn
[04/08/2014 13:50:41] Description:
[04/08/2014 13:50:41] data/lib/000-constant.lua:3: attempt to call global 'tpCallback' (a nil value)
[04/08/2014 13:50:41] stack traceback:
[04/08/2014 13:50:41]     data/lib/000-constant.lua:3: in function 'callback'
[04/08/2014 13:50:41]     data/movements/scripts/tp_sys.lua:15: in function <data/movements/scripts/tp_sys.lua:3>
Code:
[04/08/2014 13:51:05] [Error - MoveEvents Interface]
[04/08/2014 13:51:05] data/movements/scripts/tp_sys.lua:onStepIn
[04/08/2014 13:51:05] Description:
[04/08/2014 13:51:05] data/movements/scripts/tp_sys.lua:34: attempt to call field 'func' (a table value)
[04/08/2014 13:51:05] stack traceback:
[04/08/2014 13:51:05]     data/movements/scripts/tp_sys.lua:34: in function <data/movements/scripts/tp_sys.lua:3>
 
So i removed the
callback line,now it works with teleport room,but not with all tps,error
Code:
[04/08/2014 14:12:22] [Error - MoveEvents Interface]
[04/08/2014 14:12:22] data/movements/scripts/tp_sys.lua:onStepIn
[04/08/2014 14:12:22] Description:
[04/08/2014 14:12:22] data/movements/scripts/tp_sys.lua:33: attempt to call field 'func' (a table value)
[04/08/2014 14:12:22] stack traceback:
[04/08/2014 14:12:22]     data/movements/scripts/tp_sys.lua:33: in function <data/movements/scripts/tp_sys.lua:3>
 
Back
Top