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

How to auto-equip a tool on spawn?

Asked by 5 years ago

I have a tool that I want the game to auto-equip when I spawn in (like in wild revolvers), but I am not sure how to do this.

If you also know how to make the tool auto-equip while the backpack is disabled that would be great too.

2 answers

Log in to vote
0
Answered by 5 years ago

If you make the parent of the tool the character he will equip it, what I like to do for that is the following game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) local ToolClone = game.ServerStorage.Tool:Clone() ToolClone.Parent = character end) end)

so just put your tool in serverstorage and put this script in serverscriptservice

0
@tacobell158 I'm trying that but it doesn't seem to be working. HimoutoUmaruDomaChan 20 — 5y
0
is the tool in serverstorage? and the script in serverscriptservice? tacobell158 10 — 5y
0
Yes, I made sure. HimoutoUmaruDomaChan 20 — 5y
0
is it giving an error? tacobell158 10 — 5y
View all comments (5 more)
0
Not really, it just won't equip the tool. HimoutoUmaruDomaChan 20 — 5y
0
why don't you add me to team create and I could fix it tacobell158 10 — 5y
0
Ok sure give me a second.. HimoutoUmaruDomaChan 20 — 5y
0
I sent you a friend request HimoutoUmaruDomaChan 20 — 5y
0
I cant help you right now maybe in like 2 hours tacobell158 10 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

Well, it's pretty simple, to make it automatically make the person equip and use the tool you need to copy this: This only works if you have the tool in the player's backpack.

game.Players.PlayerAdded:Connect(function(plr)
    local char = plr.Character
    local backpack = game.Players.Backpack.Toolnamehere -- Change this to the name of the tool
    backpack.Parent = char
end)

Please let me know if you have any questions or something doesn't work. Other than that, hope it works for you.

0
@mudathir2007 Maybe there's something wrong with the script. Is the backpack the StarterPack folder? I also tried making it a LocalScript for my StarterPlayer but it did not work. HimoutoUmaruDomaChan 20 — 5y
0
A backpack is all local. It's stored in the Local player's thingy. The starter pack is the items that are given to everyone when they join. A backpack is an individual thing. So if you clear the starter pack, it won't clear everyone's backpacks, unless they reset. mudathir2007 157 — 5y
0
2 months later and then I find what's wrong with my script lol :| mudathir2007 157 — 5y

Answer this question