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

Tool in StarterGear but when a player respawns it's doesn't go to Backpack?

So, thank you for taking your time out of your day to click on this to help me.

As the title states, I have a script that clones a certain tool into StarterGear and BackPack but once the player respawns, the tool isn't in the backpack even though it's in StarterGear.

I'd really appreciate some help!

Thank you for reading!

Code:

game.ServerStorage.Tools.GravityCoil:Clone().Parent = player.StarterGear
game.ServerStorage.Tools.GravityCoil:Clone().Parent = player.Backpack

1 answer

✓ Accepted answer

I don't know how in the world you're not doing this, but the easiest solution to your problem is to listen for CharacterAdded to fire from the player. This is because, by default, each time the Humanoid dies its rig is destroyed and respawned in a designated spawn location. To translate it into simpler terms, the player's Character is reset every time the Humanoid dies. Because a new Character is spawned for the end user to control, CharacterAdded will fire every time this happens.

Also, StarterGear is a rather funky service on its own. The player obtains the gear when they join, not when their Character is reset. When the Character is reset, the player's Backpack is flushed. Your goal is, each time the Character is reset (CharacterAdded), you want to give the player the tool assuming they don't already have it.

2 comments

0

I'm trying to clone the tools in starter GUI into the player's backpack after respawning but I can't get any success.

0

StarterGear

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