Hello, I wrote a resource to change playerstats along with time, but it gives an error
Error details:
gym\server.lua:386: Bad argument @ 'getPedStat' [Expected ped at argument 1, got nil]
gym\server.lua:386: attempt to perform arithmetic on a boolean value
function Kamshodan(theplayer)
setTimer(function()
setPedStat(thePlayer, 23, getPedStat ( thePlayer, 23 ) - 2)
setPedStat(thePlayer, 22, getPedStat ( thePlayer, 22 ) + 2)
end, 3600, 1, thePlayer)
end
addEventHandler ('onResourceStart', getRootElement(), Kamshodan)
can you help me?