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

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

Asked by 4 years ago
Edited 4 years ago

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

Log in to vote
1
Answered by 4 years ago

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.

Ad
Log in to vote
1
Answered by
Memotag 226 Moderation Voter
4 years ago
Edited 4 years ago

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.

0
But I don't want everyone to have it. Golden_Tyler115 54 — 4y
0
Only the player who you have the tools Parented to will keep them. StarterGear is different to StarterPack. Memotag 226 — 4y

Answer this question