So, I made an if statement that checks when you're dead. Since you don't need the full code, I'll just make one with the same scenario.
This is a Localscript, and this is filtering enabled!!
while wait(1) do if game.Players.LocalPlayer.Character:FindFirstChild("Humanoid").Health == 0 then --my true problem warn("This is a test") --i prefer warn, as it is easier to see in the output. end end
What is wrong? It seems normal, but the warn doesn't appear in the output!
Instead of using loop, use the humanoid's event.
For example the Died()
:
--localscript local Plr = game.Players.LocalPlayer Plr.Character.Humanoid.Died:Connect(function() print('player dies') end)
What it does is triggering the function as soon as the player's health hits zero.
For more information related to this : http://wiki.roblox.com/index.php?title=API:Class/Humanoid