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

How can I make it so when a player resets their tools stay in their inventory?

Hello! I was just wondering if anyone could help me out on this one, I don't think there's a property in the actual tool or the players Backpack, I'm pretty sure this would have to be a script. And that's all I know! Thanks, -Tyler :D

2 answers

✓ Accepted answer

In the script where you put the sword in the backpack, add a line that puts it in the player's StarterGear. As an example, I will give the player a sword that is in ReplicatedStorage when they join the game. The sword will stay with them forever.

game.Players.PlayerAdded:Connect(function(plr)
     local sword = game.ReplicatedStorage:WaitForChild("Sword"):Clone() --clone the sword
     sword.Parent = plr.Backpack --put the cloned sword in the player's inventory
     sowrd:Clone().Parent = plr.StarterGear --put a clone of the cloned sword into the player's StarterGear so that it stays in the player's inventory even after death.
end)

For my example it is better just to put it in StarterPack, but if you want to script it, it is the same (I think that sentence makes sense).

I hope this answers your question.

Parent the tools to their StarterGear

StarterGear is a folder located within the Player. This is different to StarterPack where all Players will receive the tools.

2 comments

0

But I don't want everyone to have it.

0

Only the player who you have the tools Parented to will keep them. StarterGear is different to StarterPack.

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