Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
Is it no issue with addEvent, you are just not supposed to pass item / creature userdata as an argument.
Doing this might crash your server if the creature does no longer exist, therefore you receive a warning when doing so.
Hope this helps understanding what happened.
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 variable
Code:
-- 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
When you pass cid to a table or variable, you are not passing the userdata directly, you are
storing the return value of the userdata in the table or variable and passing it to the addEvent,
this is what makes the difference as being safe.