Buzzy

Loading...

Buzzy

Register

Roblox Studio Tutorials - March 9, 2022

How to Equip Tools Pressing a Button

1

buzzygamesbri

@buzzygamesbri

Download – Equip Script

How To – Equip Tools Pressing a Button in Roblox Studio

What’s up everyone welcome to buzzygames, my name is BuzzyGamesBeth and today I’ll be teaching you how to equip tools pressing a button!

  • We’re going to be using proximity prompts. Inside of my workspace, I have these two parts, a gun and a stick. Right now, these are not functional tools. First thing we are going to do is make them functional.
  • I’m going to add two tool objects, one for the gun and one for the stick. I’m going to make a duplicate of these parts and then drag them inside of the tool. This way, people will see what they’re getting, sort of like a preview if they press E. I’ll be renaming those parts that I just added in. I’ll be renaming my stick tool to baton and rifle tool to rifle.
  • I’m gonna drag both of these tools inside of surface storage. We’ll be referencing that inside of our script. Inside of our workspace, we still have these, the baton and the gun. Right now, we’re not able to use them because there’s no tool objects. These are essentially just parts at this point.
  • Inside of our tools, go ahead and add a proximity prompt and a script for both of them.
  • Inside of our first script inside of my first tool which(the stick), I have a bunch of variables referencing the server storage baton, the part, and a function. The function is where anytime a player triggers the proximity prompt (if they have the tool), then it’ll print “you already own this item”. If they don’t, then it’s going to create a clone of that tool, and then place it inside of our backpack.
  • Once we’re done with that, copy this script and paste it inside of the rifle tool (or whichever tools you guys have) I’m going to change my variables so that it’s referencing the rifle, not the baton. It’ll be local rifle = serverstorage.rifle not local baton because then it’s just gonna not get the gun. Make sure to keep track of which tool you want to equip!