I have never used PlayerRemoving function before so I don't know what it does
game.Players.PlayerRemoving:Connect(function()
game.Workspace.Value.Value = game.Workspace.Value.Value - 1
end)
would that script work?
I have never used PlayerRemoving function before so I don't know what it does
game.Players.PlayerRemoving:Connect(function()
game.Workspace.Value.Value = game.Workspace.Value.Value - 1
end)
would that script work?
If the player leaves or if the player is moved from players, basically. There is also "CharacterRemoved" / "CharacterRemoving" ( i think it's only CharacterRemoving, idk). For example:
game.Players.Justingamer700.PlayerRemoving:Connect(function(plr)
print(plr.Name.. "is leaving!")
end)
I edited my question. Can you look and see if the script works?
yes
anything inside of the function will run correctly once a player is leaving
unles you wrote it wrong
could you accept my answer if it is correct?
The PlayerRemoving event will fire as a player gets removed from the game: (Connected the event to a function for you)
game.Players.PlayerRemoving:Connect(function(Player)
--Player is the player which leaves the game and the code here will run as the player leaves.
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Also, in other questions, please try to elaborate and compile your own code before asking what something does so we have a good understanding of your issue ( i know it's hard for this questions since you're trying to define what something means).