LocalPlayer Added?

I made a custom death that I would like to use for my game(s), and I’d say I’m making good progress.
robloxapp-20200805-1627482.wmv

The thing is, I’m having trouble returning the music and camera back to normal when the player respawns. All I know how to do right now is detect .Died, so I need help detecting when the player respawns. I’ve tried .Added, .Spawned, .Respawned, etc. If you know what it is, please tell me! :grin:

You can use the .CharacterAdded event, which fires when exactly that takes place.

playerInstance.CharacterAdded:Connect(function(character)
print(character.Name.." has spawned in the game world")
end)

Did you try .CharacterAdded? Maybe that would be better

If you want, you can also manually respawn the character and turn off automatic respawning.

I’m talking about a custom death in a LocalScript. Do you understand what I’m saying? I’m not asking about “So and so has joined the game”, I’m asking about the LocalPlayer. Does that make more sense?

Edit: How can I manually respawn the player?

You could perhaps wait for the player’s StarterGui to enter the game.

Check out this link: Best method of checking when the player respawns on the client? - #5 by goldenstein64

EDIT: Is this what you mean? I understood that you’re trying to find out when the player respawns. But now you said that you want to manually respawn the player, so I’m a bit confused.

The original question was “What’s the opposite of .Died?”, but @imalex4 suggested I manually respawn the player, so I think I’ll stick with that idea. Now I’m asking how I can do that. Does this help?

You can use Player:LoadCharacter.

Here’s a link to the Roblox API on it: Player | Documentation - Roblox Creator Hub

Also, under game.Players, uncheck CharacterAutoLoads.

I think I understand now. I’ll make an edit when I put together the code.

An edit to the post? (30 character limit)

I got the gasp red lines, so clearly I’m doing something wrong.
LocalScript - Roblox Studio 8_5_2020 5_05_02 PM (3)

Put () at the end of loadcharacter

The red lines are gone. Thanks for the clarification.

1 Like