generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

How to build a gun

Previous Thread :: Next Thread 
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
21 Jul 2013 10:40 AM
Is this how you build a gun?

1. make your gun
2.Name the handle Handle
3. Insert the gun in "tool"
4. Put this script in the gun '

damage = 50


game:GetService("Debris"):AddItem(script.Parent, 8)
function onTouched(hit)
if hit.Parent:findFirstChild("Humanoid")~=nil then
hit.Parent["Humanoid"]:TakeDamage(damage)
end
wait()
script.Parent:Remove()
end
script.Parent.Touched:connect(onTouched)




Would those steps work to make a gun?
Report Abuse
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
21 Jul 2013 10:46 AM
bump
Report Abuse
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
21 Jul 2013 11:04 AM
blump
Report Abuse
RoyStanford is not online. RoyStanford
Joined: 21 Oct 2008
Total Posts: 2222
21 Jul 2013 11:10 AM
Here is an extremely simple way to make a gun.

1.) Build it
2.) Name the handle Handle
3.) Weld parts together (there are many weld scripts on free models)
4.) Anchor = false and CanCollide = false for everything
5.) Put all of the parts in a tool object

6.) Put a script inside
Here is an extremely simple example of a script to put inside

script.Parent.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function(mouse)
local target = mouse.Target
if target and target.Parent:findFirstChild("Humaniod") then
target.Parent.Humanoid:TakeDamage(15)
end
end)
end)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image