Now appears attempt to compare number with nil
elseif exhaustion.get(cid, 898) then
It worked perfectly but now appears an error in addEvent
luaAddEvent<>. Argument #3 is unsafe
addEvent(Test, 1000, cid)
What you want to do is not pass the userdata (cid) directly to addEvent, a simple solution would be to pass cid in a table or variableNo @Volrath, I could solve the solution here
got the solution on github (forgottenserver) issue addEventCode:local player = Player (cid) if player == nil then return false end and at the addEvent (Test, 1000, player.uid)
thank you![]()
-- as a variable
local pid = cid
addEvent(Test, 1000, pid)
-- or as a table
local p = {id = cid}
addEvent(Test, 1000, p.id)
-- hypothetic Test function
function Test(playerId)
if isPlayer(playerId) then
-- do something
end
end