Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

This breaks after player's death?

Asked by 9 years ago

I have an in-game shop where a player can purchase a weapon with Leaderboard credit.

Here's the problem. The weapon does get inserted into the player's backpack after purchase. But after they die. It's not there anymore. How can I get it to stay in they're backpack? I tried using the StarterPack but I had the exact same issue.

0
You need to also put a copy into the player's StarterGear! TheDarkOrganism 173 — 9y

2 answers

Log in to vote
0
Answered by 9 years ago

object:clone().Parent = player.Backpack --Change object and player to the correct name you are using object:clone().Parent = player.StarterGear --Same here

Ad
Log in to vote
0
Answered by 9 years ago

When you place it into your Backpack and then die it will go away because of the fact that objects in your backpack are only temporary and will be removed after you die. If you want the item to appear every time someone spawns then you need to place it into the StarterPack.

object:clone().Parent = game.Players.player.Backpack --Change object and player to the correct name you are using

object:clone().Parent = game.StarterPack --Will make it so ANYONE who spawns acquires weapon. Remember to change 'object' to the correct name

One of these was already said but I wanted to put it into the code block and give a better explanation.

Answer this question