the Players var never updates
while true do
wait()
local Players = game.Players:GetPlayers()
for i,v in pairs(Players) do -- numeric for works as well
if v.Character and v.Character.Humanoid.Health == 0 then
v:WaitForChild("Playing",100).Value = false
end
end
end
If you're trying to do something when the player dies, perhaps you'd be better connecting events
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
char.Humanoid.Died:connect(function()
if player:FindFirstChild("Playing") then
player.Playing.Value = false
end
end)
end)
end)
|