#what is the difference between "Player left" and "Player leaving" ?

1 messages · Page 1 of 1 (latest)

foggy garden
#

what is the difference between "Player left" and "Player leaving" ?

slate pilot
#

Player leaving is the last Cv2 tick that executes on the leaving player, so if you have any last stuff you want a leaving player to execute, use this event. Player left executes AFTER the player has left the room.

cyan bear
#

the main difference is that when the player is leaving the player is still valid but at the point left fires it is no longer valid

wind saddle
#

@slate pilot No
@cyan bear Yes

@foggy garden
Player Left and Player Leaving both fire at roughly the exact same time, but of course Player Leaving executes first because why wouldnt it

Player Leaving fires the last frame a player will be valid, so you can do stuff like request data from their PDB, check if they have a role, check if they have a tag, etc

Player Left fires the frame the player is no longer valid, which can only be used for equality checks, Equals, List Contains, List Get First Index Of, List Get All Indices Of

wind saddle
#

The players circuits have already stopped responding

slate pilot
#

Wait actually?

wind saddle
#

yes

slate pilot
#

So can you not do any more executions and what not for that player on that tick?

wind saddle
#

Soon we will get a leaving event that fires for the local player

wind saddle
#

By the time Player Leaving fires, circuits will have stopped responding a few frames ago

slate pilot
#

So the only difference is that leaving player is still a valid player?

wind saddle
#

In essence, yes