How to Make a Weapon that Shoots Bullets
Download – Weapon Model and Script
How To – Make a Weapon that Shoots Bullets on Roblox Studio
What’s up everyone welcome to buzzygames, my name is BuzzyGamesBeth and today I’ll be teaching you how to make a weapon that shoots bullets and does damage!
- Right now you see that I have a weapon here that I just pulled it off from toolbox and we’re just going to go ahead and use this model for the sake of this video.
- So inside of our weapon we’re going to go ahead and add a localscript. Make sure to delete that print statement.
- First thing we want to do is define our variables here and then we’re going to create a function where anytime our mouse is clicked then the remote event is going to trigger and it’s going to fire the bullets. If our mouse click is not clicked then it’ll cease fire. You’ll see that in the mouse.icon = the asset ID that I sent, that is going to be the crosshair design that I like. You can go ahead and change that to any crosshair you would like that you can find on the roblox.com website
- Next up inside of serverscriptservice, we’re going to go ahead and add a script. Delete the print statement, so inside of this script we’re going to write it where any time the remote event is triggered then it’s going to shoot out the bullets outside of the weapon.
- So right now we’re setting the properties of the bullet and how it’s going to look and the speed of it and we’re going to go ahead and create another function where any time a humanoid is hit by those bullets they’re going to take damage. It’s going to take about 20 health away from them.
- Inside of our game if you go ahead and equip the weapon anywhere you click the bullets are going to go ahead and fire.
- Right now there is my dummy right there to my right, if I go ahead and aim my crosshair at him you’ll see that his health is going to deplete and just like that you’re done!