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: Scripting Guns...

Previous Thread :: Next Thread 
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
11 Apr 2012 07:05 AM
I am wanting to script a gun. I need someone to tell me the main parts I need help with like the bullet script and stuff. I also need someone to tell me how the weld script would work.
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
11 Apr 2012 07:06 AM
This is not a request, Im just telling someone to start me off...

Report Abuse
stardoctor0999 is not online. stardoctor0999
Joined: 06 Aug 2010
Total Posts: 425
11 Apr 2012 07:56 AM
No, you asking for sombody to start you off.
Report Abuse
lordmerick is not online. lordmerick
Joined: 01 Nov 2010
Total Posts: 15213
11 Apr 2012 08:10 AM
local Tool = script.Parent --Set a variable for the tool.
local User --Create a nil value for the character which we can't find yet.
Tool.Equipped:connect(function(mouse) --When it's equipped fire a function.
User = Tool.Parent --Set the User variable to the character of the person using the tool.
mouse.Button1Down:connect(function() --When the left mouse button is clicked fire a function.
local Ray = Ray.new(Tool.Handle.CFrame.p,(mouse.Hit.p-Tool.Handle.CFrame.p).unit*300) --Make a the ray.
local Hit,Position = game.Workspace:FindPartOnRay(Ray,User) --Check for collisions along the ray.
if Hit then --If it hits something.
if Hit.Parent:FindFirstChild("Humanoid") then --If the thing the ray hit has a humanoid.
Hit.Parent.Humanoid:TakeDamage(30) --Do 30 damage if they don't have a forcefield.
end --End the humanoid check.
end --End the hit check.
local RayPart = Instance.new("Part",User) --Create a part in the user.
RayPart.Name = "RayPart" --Set its name.
RayPart.BrickColor = BrickColor.new("Bright red") --Set its color.
RayPart.Transparency = 0.5 --Set its transparency.
RayPart.Anchored = true --Set whether it will fall or not.
RayPart.CanCollide = false --Set whether people can walk though it or not.
RayPart.TopSurface = Enum.SurfaceType.Smooth --Make it smooth on the top.
RayPart.BottomSurface = Enum.SurfaceType.Smooth --Make it smooth on the bottom.
RayPart.formFactor = Enum.FormFactor.Custom --Make it so it can be small.
local Distance = (Position-Tool.Handle.CFrame.p).magnitude --Find the distance between the click and the gun.
RayPart.Size = Vector3.new(0.2,0.2,Distance) --Set its size to the distance.
RayPart.CFrame = CFrame.new(Position,Tool.Handle.CFrame.p) * CFrame.new(0,0,-Distance/2) --Move it halfway.
game.Debris:AddItem(RayPart,0.1) --Add it to the debris.
end)
end)

- Veneratio ut Victoria , Veneratio ut Frostaria! -
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
11 Apr 2012 09:10 AM
Man this is too complicated :/
Report Abuse
walky3 is not online. walky3
Joined: 26 Nov 2008
Total Posts: 1415
11 Apr 2012 10:46 AM
Lol. You can't just randomly make a gun with no scripting experience. Try Pighead10 on youtube, helpful for begginers but not weapon related.
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
11 Apr 2012 12:55 PM
Ummm, Im not a beginner? And I have scripting experience...
Report Abuse
RATEXmegaGAMER is not online. RATEXmegaGAMER
Joined: 10 Dec 2010
Total Posts: 4046
11 Apr 2012 01:09 PM
The welding script should weld all parts to the handle.
Get the mouse from the tool.
Get the direction of the gun and shoot a bullet from there.
The bullet damages using the Touched event or simply raycasting.
Report Abuse
walky3 is not online. walky3
Joined: 26 Nov 2008
Total Posts: 1415
11 Apr 2012 01:33 PM
Oh, apologies, you just looked like one of those random kids who come on here asking how to script.
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
11 Apr 2012 02:42 PM
Nah, Scripting guns is quite hard thats why I asked... Normally I can script all kinds of things. Parts, Guis and more...
Report Abuse
RATEXmegaGAMER is not online. RATEXmegaGAMER
Joined: 10 Dec 2010
Total Posts: 4046
11 Apr 2012 02:43 PM
You make it look hard, but if you step by step you eventually find out it's just the basics put together.
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
11 Apr 2012 03:40 PM
Mhm..
Report Abuse
walky3 is not online. walky3
Joined: 26 Nov 2008
Total Posts: 1415
12 Apr 2012 04:53 AM
I'll give you my Raycast Script if you want, its really basic though. Best property is it smash's Glass and Overheats.
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
12 Apr 2012 06:06 AM
Can it kill players lol? If its basic, count me in...
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
12 Apr 2012 07:27 AM
Use raycast. Plus, check out free models to help. I mean to look at the scripts and learn it.
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
12 Apr 2012 12:15 PM
Wow, it looks quite simple. I wish I learn and become a gun maker yaaa!
Report Abuse
rapidfirebullet is not online. rapidfirebullet
Joined: 23 Sep 2011
Total Posts: 1803
12 Apr 2012 12:47 PM
Haidere.
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
12 Apr 2012 12:57 PM
???
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
12 Apr 2012 01:02 PM
Spammers >_>
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
12 Apr 2012 03:45 PM
Good point lol
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