varjoy
(variable)
December 27, 2020, 2:13am
#1
Hi guys, I got a question, when a players leave, what fires first?
.PlayerRemoving or .CharacterRemoving?
1 Like
I’m gonna guess PlayerRemoving, since you can’t exactly define the Character in any sort of way unless you create a player variable inside it first (Also could be a bug)
I just found that now PlayerRemoving can execute before CharacterRemoving.
Previously such behaviour never occurred in testing, so I presume it is a recent addition.
The work around is to explicitly synchronise these two event callbacks. However, it simply is not logical to fire PlayerRemoving before (or together with) CharacterRemoving.
[RemovingInOrder]
game.Players.PlayerAdded:Connect(function(player)
player.CharacterRemoving:Connect(function(char)
local t = 1
while t>0 do
print(t…
3 Likes