game.Players.PlayerAdded:connect(function(player)
repeat wait()
print("0.1")
until player.PlayerRemoving or player.Character.Humanoid.Health <= 10
print("Player has left.")
How would I fix it to do the repeat wait() until the player removes. I am certain I need to make it into a function for the player removing. Something like this
game.Players.PlayerRemoving:Connect(function(player)
end)
But I have no idea how I would do that with the until, can anyone give me some advice?

2 comments
Thanks what I did was I just put local pla = player.Name (skip down to the until line) until game.Players:FindFirstChild(pla) == nil or player.Character.Humanoid.Health <= 10
That works too. Please accept the answer if it helped you :)