Player Character Behaviour

I was experimenting with the Player’s Character in studio today and I found something that I can’t seem to get an answer on online.

When I continually check if there is a change in Character’s parent upon death on both the Client and Server side of my scripts through GetPropertyChangedSignal, I found that the server does fire and prints out that the new Parent is ‘nil’, while my client script never fires once. Can someone explain why this occurs and if possible, provide some resources for additional reading.

1 Like

If the LocalScript is bound to the player’s character (ie. in StarterCharacterScripts), then the script will destroy with the character so it cannot process the event. Try putting your script in StarterPlayerScripts instead (though every time the character respawns you will need to get a reference to that new character).

However, if you just want to listen to when the player dies, it would be better to get the Humanoid (descendant of Character) and listen to its Died event.

1 Like