jareczekjsp
Member
Hello guy I use Tfs 1.5 And when I click on lever I have this error in console How I can fix it?
error
script
error
Lua:
Lua Script Error: [Action Interface]
data/actions/scripts/online/exp3.lua:onUse
luaAddEvent(). Argument #3 is unsafe
stack traceback:
[C]: in function 'addEvent'
data/actions/scripts/online/exp3.lua:24: in function <data/actions/scripts/online/exp3.lua:7>
script
Code:
local teleportPosition = {x=32487, y=32570, z=14}
local templePosition = {x=160, y=54, z=7}
local magicCoinId = 10558
local amountRequired = 100
local cooldownInSeconds = 5
function onUse(cid, item, fromPosition, itemEx, toPosition)
local lastTeleportTime = getPlayerStorageValue(cid, 38387)
if lastTeleportTime and os.time() - lastTeleportTime < cooldownInSeconds then
doPlayerSendCancel(cid, "You must wait " .. cooldownInSeconds .. " seconds before using this command again.")
return true
end
if not doPlayerRemoveItem(cid, magicCoinId, amountRequired) then
doPlayerSendCancel(cid, "You need 100 Online Points to Go!")
return true
end
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doTeleportThing(cid, teleportPosition)
doSendMagicEffect(teleportPosition, CONST_ME_TELEPORT)
setPlayerStorageValue(cid, 38387, os.time())
addEvent(function(cid)
if isPlayer(cid) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doTeleportThing(cid, templePosition)
doSendMagicEffect(templePosition, CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You have been teleported back to the temple after 3H.")
end
end, 10800000, cid)
return true
end