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
 

Re: Making guns?

Previous Thread :: Next Thread 
LeonPorterVII is not online. LeonPorterVII
Joined: 22 Feb 2014
Total Posts: 63
24 Feb 2014 03:01 AM
Hey all, I've been practicing with scripting, and now I wanna learn how to make guns, I'd like to know the basic stuff like making the gun fire bullets, aiming down the sights, reloading animations and moving parts, stuff like that.
Perhaps there are already videos about this, but I didn't find any that suited what I'm looking for on Youtube, thanks for any help that is provided.
Report Abuse
LeonPorterVII is not online. LeonPorterVII
Joined: 22 Feb 2014
Total Posts: 63
24 Feb 2014 03:03 AM
Also would like to learn how to make firing and reloading noises that can only be heard from a certain distance.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
24 Feb 2014 03:04 AM
#ThisIsntEasy
This ain't gettin handed on a silver platter mate,this is advanced,takes a lot of time
And a lot of scripting
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
24 Feb 2014 03:09 AM
To make a simple bullet (doesn't fire towards the mouse)
It just goes forwards but:


bullet = Instance.new("Part",Workspace)
bullet.Size = Vector3.new(1,1,1)
bullet.CFrame = script.Parent.Handle.CFrame*CFrame.new(0,0,-1)
V = Instance.new("BodyVelocity",bullet)
V.velocity = bullet.CFrame.lookVector*100
bullet.Touched:connect(function(thing)
if thing.Parent:findFirstChild("Humanoid") then
H = thing.Parent.Humanoid
H.Health = H.Health - 5
bullet:destroy()
end
end

--this will need to be in a tool with a part named "Handle" in it
So
Tool
-Handle
-Script

Also,this whole bit would be put into a .Activated event
Report Abuse
LeonPorterVII is not online. LeonPorterVII
Joined: 22 Feb 2014
Total Posts: 63
24 Feb 2014 04:58 PM
Bump.
Report Abuse
LeonPorterVII is not online. LeonPorterVII
Joined: 22 Feb 2014
Total Posts: 63
24 Feb 2014 09:22 PM
Bump.
Report Abuse
oplmn1 is not online. oplmn1
Joined: 25 Nov 2010
Total Posts: 994
24 Feb 2014 09:24 PM
Dont use Islands Thats crap. Sorry island, Dont use moving bricks.
Here you go
http://wiki.roblox.com/index.php?title=How_to_Make_a_Raycasting_Lasergun
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
24 Feb 2014 09:27 PM
@opml
That's a very ignorant statement. It depends on what you're trying to accomplish what method you use.
Report Abuse
oplmn1 is not online. oplmn1
Joined: 25 Nov 2010
Total Posts: 994
24 Feb 2014 09:30 PM
Well whats better. Sending a glitchy brick with crap physics at 1000 miles per hour at something, or sending a straight, Line of code into a something and checking if it touches anything, And can be manipulated much much more.
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
24 Feb 2014 09:32 PM
Like I said, it depends on what you're trying to accomplish.
Report Abuse
LeonPorterVII is not online. LeonPorterVII
Joined: 22 Feb 2014
Total Posts: 63
24 Feb 2014 09:33 PM
I don't really think I'm going to end up using what Island suggested, though I don't particularly care for the fact that with what OPL suggested will mean that the bullets instantly hit and have no bullet drop, that's still better than what will most likely be a lag machine.
Report Abuse
LeonPorterVII is not online. LeonPorterVII
Joined: 22 Feb 2014
Total Posts: 63
24 Feb 2014 09:34 PM
Also, can you aim down the sights with what you suggested, OPL?
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
24 Feb 2014 09:34 PM
I would use raycasting to, but that doesn't change the fact that what opl said was an ignorant statement.
Report Abuse
oplmn1 is not online. oplmn1
Joined: 25 Nov 2010
Total Posts: 994
24 Feb 2014 09:35 PM
"bullets instantly hit and have no bullet drop"

Easily scripted. Also, at 200 yards, the average bullet drops about 3 inches.
At 600 Yards one foot. I don't think that your going to make a 600+ yard game. Also You could put it to be non accurate.
Report Abuse
oplmn1 is not online. oplmn1
Joined: 25 Nov 2010
Total Posts: 994
24 Feb 2014 09:35 PM
You can ADS with like any tool. Or almost.
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
24 Feb 2014 09:36 PM
@Leon
If you want to aim down sights you would have to do a lot of work. First you would have to make the gun vertically line up with the camera, make sure the person is in first person, and use arm movements and such to move the gun near their face.
Report Abuse
LeonPorterVII is not online. LeonPorterVII
Joined: 22 Feb 2014
Total Posts: 63
24 Feb 2014 09:37 PM
Actually, the map is gonna be pretty huge, but to engage someone at 600 yards would be ridiculous.
Report Abuse
LeonPorterVII is not online. LeonPorterVII
Joined: 22 Feb 2014
Total Posts: 63
24 Feb 2014 09:38 PM
@Joshua I'm willing to do the work, I just have no clue where to even get started.
Report Abuse
LeonPorterVII is not online. LeonPorterVII
Joined: 22 Feb 2014
Total Posts: 63
24 Feb 2014 09:38 PM
Just gonna start with the basics, first, the basics being: Actually building a gun.
Report Abuse
oplmn1 is not online. oplmn1
Joined: 25 Nov 2010
Total Posts: 994
24 Feb 2014 09:40 PM
Basics is scripting. Make a handle, clip, body, and barrel.
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
24 Feb 2014 09:41 PM
Opl just stop
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
24 Feb 2014 09:42 PM
@opml
what if he doesn't want it to hit the player immediately?
as far as I know,with raycasting(never actually used,but seen it),it goes straight to the mouse position,so it hits the players the second it kills them..
Report Abuse
oplmn1 is not online. oplmn1
Joined: 25 Nov 2010
Total Posts: 994
24 Feb 2014 09:46 PM
You have no idea the power of ray-casting.
Report Abuse
LeonPorterVII is not online. LeonPorterVII
Joined: 22 Feb 2014
Total Posts: 63
24 Feb 2014 09:48 PM
I don't want my bullets to instantly hit what I am aiming my gun at, but I also would rather not have the bullets turn out to be terribly inaccurate, I will give you the benefit of the doubt, and test your script anyway, just because it might turn out to be kind of cool.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
24 Feb 2014 09:48 PM
I don't?
as far as I know
u click
it pretty much draws a line from the gun to where u clicked
the player dies..(instantly)
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