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
|
  |
| 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 |
|
|
|
| 11 Apr 2012 07:56 AM |
| No, you asking for sombody to start you off. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
|
| 11 Apr 2012 09:10 AM |
| Man this is too complicated :/ |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
| |
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|
| |
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
| |
|
Miro034
|
  |
| Joined: 07 Oct 2009 |
| Total Posts: 6568 |
|
| |
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
| |
|