Hello, I wrote a JailTimer script and I faced this problem and I was confused. Can anyone help me?
Console Errors:
[07:17:17] WARNING: jail/server.lua:8: Bad argument @ 'setTimer' [Expected function at argument 1, got nil]
[07:17:17] WARNING: jail/server.lua:18: Bad argument @ 'addEventHandler' [Expected element at argument 2, got nil]
Problematic Script:
--------------- Script By RxipeR ---------------
--Arthur RxipeR
--JailTimeR Script
local timer = setTimer( timerJail, 1000,1 )
function timerJail()
if getElementData(source,"jailTimer") > 0 then
timeRoTamoomKon()
triggerClientEvent ( source, "onSyncTime")
resetTimer(timer)
end
end
addEventHandler("onPlayerSpawn",source,
function()
if getElementData(source,"jailTimer") > 0 then
if getElementData(source, "jailLoc") == 1 then
spawnPlayer(source, 264.228515625, 77.505859375, 1001.0390625)
setElementInterior ( source, 6 )
end
end
end
)
function timeRoTamoomKon()
local timeJailChande = getElementData(source,"jailTimer")
local kamkon = tonumber(timeJailChande) - 1
setElementData(source, "jailTimer", tonumber(kamkon))
end