local player = game.Players.LocalPlayer
local clone = game.ReplicatedStorage["TOOLNAMEHERE"]:Clone()
clone.Parent = player.Backpack
THIS NEEDS TO BE A LOCAL SCRIPT IN STARTERGUI
To go into more depth with what I'm doing
FIRST LINE
local player = The local I'm using here, defines what this should be,
game.Players.LocalPlayer This is what I'm telling the local player to be. If I use local player anywhere else in the script, it will still work. Next time you use it, you don't need to use local, that's only for defining in the beginning of the script
SECOND LINE
local clone = Again, defines what clone should be
game.ReplicatedStorage["TOOLNAMEHERE"] this goes into the ReplicatedStorage, which I told you to store your item in, and it looks for this tool.
:Clone()This tells it to clone. It's important to use : when cloning. I don't know if clone has to be capitalized like how I did it, I think it's an optional thing.
THIRD LINE
clone.Parent I'm now using the variable I defined early to determine where this clone should be.
player.BackpackThis is telling it to go to the player, and place the clone in their bag.
If you need more questions about this, either put a comment on my answer or, go to http://wiki.roblox.com . The wiki is probably the best place to look scripting stuff up.
Putting an item in StarterPack will give it to all the players if the tool is in there before the server starts. I.e. Place the tool into StarterPack. If you clone something into StarterPack, it will appear when that person resets.
4 comments
I'll try it out, thank you very much. I'm actually having a very hard time learning to script so this is a big help, thank you.
No problem ;)
Didn't work. Updating the post with the script I'm using.... Not skilled enough to make scripts yet, but I can edit them. //knows nearly nothing about scripting..
HOW DO I PUT A TOOL IN MY BACKPACK!!!!! LIKE WHAT TYPE OF TOOL AND HOW DO I GET THERE, PLS EXPLAIN