Hey how would i be able to fix this? i believe it is the cause of this
<globalevent name="kickDoor" interval="60000" script="kickDoor.lua" />
and here is the kickdoor.lua
I tried using this script to make a player use a door and after 5mins it would teleport the player who used the door back to temple
This is the error
This is the lua idk if i made it work correctly but this action script corresponds with the globalevent script
<action actionid="4034" event="script" value="exptimer/exp.lua"/>
<globalevent name="kickDoor" interval="60000" script="kickDoor.lua" />
and here is the kickdoor.lua
I tried using this script to make a player use a door and after 5mins it would teleport the player who used the door back to temple
Code:
function onThink(interval)
for i, v in ipairs(getPlayersOnline()) do
if getPlayerStorageValue(v, storage) + minutes > os.time() then
doTeleportThing(v, temple)
doPlayerSendTextMessage(v, MESSAGE_STATUS_CONSOLE_BLUE, "Your time has run out.")
setPlayerStorageValue(v, storage, 0)
end
end
end
Code:
[24/06/2016 21:41:09] [Error - GlobalEvent Interface]
[24/06/2016 21:41:09] data/globalevents/scripts/kickDoor.lua:onThink
[24/06/2016 21:41:09] Description:
[24/06/2016 21:41:09] data/globalevents/scripts/kickDoor.lua:3: attempt to perform arithmetic on global 'minutes' (a nil value)
[24/06/2016 21:41:10] stack traceback:
[24/06/2016 21:41:10] data/globalevents/scripts/kickDoor.lua:3: in function <data/globalevents/scripts/kickDoor.lua:1>
[24/06/2016 21:41:10] [Error - GlobalEvents::think] Couldn't execute event: kickDoor
This is the lua idk if i made it work correctly but this action script corresponds with the globalevent script
<action actionid="4034" event="script" value="exptimer/exp.lua"/>
Code:
local storage = 4034
local minutes = 14
local cost = 100
local temple = {x = 2000, y = 2000, z = 7}
local enter_pos = {x = 1000, y = 1000, z = 7}
function onUse(cid, item, fromPosition, item2, toPosition)
if getPlayerStorageValue(cid, storage) + minutes < os.time() and getPlayerStorageValue(cid, storage) > 0 then
doTeleportThing(cid, enter_pos)
return true
end
if doPlayerRemoveMoney(cid, cost) then
setPlayerStorageValue(cid, storage, os.time())
doTeleportThing(cid, enter_pos)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You now have access for "..minutes.." minutes.")
else
doPlayerSendCancelMessage(cid, "This door requires "..cost.." gold to enter.")
end
return true
end