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

How to auto-equip a tool on spawn?

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

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

9 comments

0

@tacobell158 I'm trying that but it doesn't seem to be working.

0

is the tool in serverstorage? and the script in serverscriptservice?

0

Yes, I made sure.

0

is it giving an error?

0

Not really, it just won't equip the tool.

0

why don't you add me to team create and I could fix it

0

Ok sure give me a second..

0

I sent you a friend request

0

I cant help you right now maybe in like 2 hours

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.

3 comments

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.

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.

0

2 months later and then I find what's wrong with my script lol :|

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