My character script doesn't work at all and im confused

game.Players.PlayerAdded:Connect(function(player)
print(“player has joined”)
player.CharacterAdded:Connect(function(character)
print(“player’s character has spawned”)
character.Humanoid.Died:Connect(function()
print(“player has died”)
end)
end)
end)

2 Likes

Where is your script located.
If this is a normal script inside serverscriptservice this should work.

scripts inside of StarterCharacterScripts only get read when the local player’s character was added.

So, player joins the game, player’s character loads, then it connects a PlayerAdded Event.
Now, when a new player joins it will run what’s inside.
(Similar problem for StarterPlayerScripts.)

1 Like

okay but how do i detect the localplayer character spawning from a localscript?

1 Like

Well, you can just put the local script inside of starterCharacterScripts.

Try putting just a print(“Test”) inside the local script. I think it will help explain how it works.

If you need the script to not reset after every death you can create a new event in staterPlayerScripts using this:

local Player = game.Players.LocalPlayer
Player.CharacterAdded:Connect(function()

end)
1 Like

im trying to make a script that runs everytime the localplayer spawns

local scripts inside of starterCharacterScripts will run every time the player spawns.

1 Like