✓ Accepted answer
I don't see an onPlayerAdded in your script, but I'll try to explain Idled first.
Idled is an event of the Player object. When you Connect an event (you should use Connect, not connect because the lowercase version is deprecated) to a function, the function will run every time the event triggers.
In this case, Idled is triggered when the game engine classifies the player as idle (no actions have been made for a long time). I found this out by simply going to the wiki. It says the event will usually trigger every 2 minutes while the player is idle.
The time parameter in brackets is information that is sent when the event triggers. In this case, the information is the amount of time in seconds that the player has been idle for. So if you ever use that in your function, simply reference it in your code by typing time (or if you change the name, keep the variable name consistent).
I hope that part makes sense.
You mentioned onPlayerAdded but never showed it in your script, however I can explain the event.
PlayerAdded is an event that fires whenever a player joins the game. The name onPlayerAdded tells me that it is the function that is fired when this event triggers. It would look something like this:
local function onPlayerAdded(player)
end
game.Players.PlayerAdded:Connect(onPlayerAdded)
Hope this helps!
2 comments
unexpected ')' near 'end'
oof man im out of it today lol