player = script.Parent.Parent.Parent player:WaitForChild('Humanoid').Died:connect(function(respawn) print("hi") end)
Humanoid is not a part from player, you should do this
player.Character:WaitForChild('Humanoid')
Don't forget to test if the character is a character like this
local char = Player.Character if char then -- code end