• 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 Error with script

Ditz

New Member
Joined
Dec 20, 2015
Messages
3
Reaction score
0
Hi Otlanders, i'm using one script for the teleports, and i got this error :/
I USE TFS 1.2 10.90
NDeVKp_.png


This is my script in moveevents/tp_sys.lua
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

Hmm now the teleports works, but now i have this error in console.
lx7lN4x.png
 
Last edited by a moderator:
Back
Top