Ad
Log in to vote
0

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

Asked by 3 days ago

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

Log in to vote
0
Answered by 2 days ago

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.

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. SonGohan6 4 — 2d
0
StarterGear SonGohan6 4 — 2d
Ad

Answer this question