Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is there a reason why Humanoid.Died isn't working?

I tried using the Humanoid.Died script as a test but it didn't work. I used the one posted here which was

game:GetService('Players').PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		character:WaitForChild("Humanoid").Died:Connect(function()
			print(player.Name .. " has died!")
		end)
	end)
end)

is there something i'm missing? I'm new to scripting so forgive me if I do something wrong. I tried this script in StarterCharacterScripts and StarterPlayerScripts

4 comments

0

What does it say in the output?

0

nothing, i was looking for a "has died!" but i didnt see anything

0

What type of script is it in? Where is that script located?

0

I put it in a local script. I put it inside of StarterCharacterScripts, StarterPlayerScripts, Workspace, StarterPack, and StarterGui but it didn't work in any of them. I didn't get any output.

1 answer

✓ Accepted answer

The issue is that you're putting the script into StarterCharacterScripts & StarterPlayerScripts.

I suggest placing the script either into Workspace or ServerScriptService.

Other than that, I can't seem to find an issue.

I mean if you're copypasting the code that Roblox themselves provided, it's probably just that you are placing it in the wrong thing.

2 comments

0

I didn't realise i was supposed to put it in a normal script. The problem was that I put it in a local script, thank you.

0

Glad I could help!

This discussion is preserved as it was. New answers, comments, and votes are closed.