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

Simple question about backpacks?

Asked by 8 years ago

Hey guys, I just need an answer to this question:

Is it possible to edit the StarterPack in-game?

I am asking this because I would like to make a player spawn with a special tool while a round is active and avoid having to make a code that re-clones the tool into a players backpack after their death.

0
If I understood your question correctly, then yes, you can. SuperFryX 130 — 8y

1 answer

Log in to vote
2
Answered by 8 years ago

This can be done simply using the player's StarterGear Instance. This is located through game.Players["TargetPlayer"].StarterGear. Anything in there will be given to the player each time the player spawns, this is also the location of the player's own gear (the ones they are allowed using the game genre and the gear types allowed) and all the tools in game.StarterPack. Backpacks are used for the tools the player currently has on them, if something is cloned into there it will only stay there until the player respawns. To give a player an item to keep throughout respawns, simply clone it into the player's StarterGear, here's the script you should use:

game.ServerStorage["ToolName"]:Clone().Parent = game.Players["PlayerName"].StarterGear

This simply clones the tool from ServerStorage and puts it in the target player's StarterGear. If you have the gear in another location simply edit the script to your needs. If this works for you or helps you please vote it up and accept as the answer!

0
I like your answer a lot. Thank you. fahmisack123 385 — 8y
0
Well, if it works for you please accept as answer so people know this question is answered and not on-going. General_Scripter 425 — 8y
Ad

Answer this question