game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) local humanoid = character:WaitForChild("Humanoid") if humanoid then print("1") humanoid.Died:connect(function() print("reset") end) end end) end)
It prints 1, but not reset. All I'm doing is resetting the character, but it's not detecting that the player has died
Don't do humanoid.Died:Connect(function() do humanoid.Died:Wait()
and use Connect not connect can't have
end) -- can't do end with ) inside of ends without ) end
so
game:GetService("Players").PlayerAdded:Connect(function(plr) -- Gotta use get service plr.CharacterAdded:Connect(function(char) local hum = char:WaitForChild"Humanoid" if hum then hum.Died:Wait() print("Something") end end) end)
You have to create a Local Script that goes inside the characters model every time they re-spawn.
Make sure the Local Script is in StarterPlayerScripts
Local Script:
-- Put this in StarterPlayerScripts folder, it should go into the Player's character every time they re-spawn local humanoid = character:WaitForChild("Humanoid") if humanoid then print("1") humanoid.Died:connect(function() print("reset") end) end