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: About guns

Previous Thread :: Next Thread 
WarriorBob is not online. WarriorBob
Joined: 05 Apr 2008
Total Posts: 634
02 Aug 2011 04:42 PM
Which function do I use to make a gun a single shot instead of auto?
Report Abuse
WildcatNation is not online. WildcatNation
Joined: 28 Sep 2010
Total Posts: 1351
02 Aug 2011 04:53 PM
Look Up ScarProductions.Its my Alt theres a Gun making Script-kit
Report Abuse
WarriorBob is not online. WarriorBob
Joined: 05 Apr 2008
Total Posts: 634
02 Aug 2011 05:05 PM
That didn't work. I think this is the part of the script:



function fire(v)

Tool.Handle.Fire:play()


local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)

local missile = Instance.new("Part")



local spawnPos = vCharacter.PrimaryPart.Position



spawnPos = spawnPos + (v * 7)

missile.Position = spawnPos
missile.Size = Vector3.new(2,1,1)
missile.Velocity = v * 1000
missile.BrickColor = BrickColor.new(26)
missile.Shape = 0
missile.BottomSurface = 0
missile.TopSurface = 0
missile.Name = "Bullet"
missile.Elasticity = 0
missile.Reflectance = 0
missile.Friction = .9

local shell = Instance.new("Part")
shell.CFrame = Tool.Chamber.CFrame * CFrame.fromEulerAnglesXYZ(1.5,0,0)
shell.Size = Vector3.new(1,1,1)
shell.BrickColor = BrickColor.new(24)
shell.BottomSurface = 0
shell.Transparency = 1
shell.TopSurface = 0
shell.Name = "Shell"
shell.CanCollide = false
shell.Velocity = Tool.Chamber.CFrame.lookVector * 30 + Vector3.new(math.random(-10,10),20,math.random(-10,10))
shell.RotVelocity = Vector3.new(0,0,0)

local shellmesh = Instance.new("SpecialMesh")
shellmesh.Scale = Vector3.new(.1,.25,.1)
shellmesh.Parent = shell

local force = Instance.new("BodyForce")
force.force = Vector3.new(0,missile:getMass() * 196,0)
force.Parent = missile

local mesh = Instance.new("SpecialMesh")
mesh.Scale = Vector3.new(.1,.1,.1)
mesh.MeshType = "Sphere"
mesh.Parent = missile

local new_script = script.Parent.Bullet:clone()
new_script.Disabled = false
new_script.Parent = missile

local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = vPlayer
creator_tag.Name = "creator"
creator_tag.Parent = missile



missile.Parent = game.Workspace
shell.Parent = game.Workspace
game:GetService("Debris"):addItem(shell,6)

weld33.C1 = CFrame.new(-0.75, -0.6, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
weld55.C1 = CFrame.new(-0.35, 1, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
Tool.Flash.Mesh.Scale = Vector3.new(1, 2, 1)
Tool.Flash.Transparency = .3
wait(0.006)
weld33.C1 = CFrame.new(-0.75, -0.6, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
weld55.C1 = CFrame.new(-0.35, 1, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
Tool.Flash.Mesh.Scale = Vector3.new(.5, 1.5, .5)
Tool.Flash.Transparency = .8
wait(0.006)
weld33.C1 = CFrame.new(-0.75, -0.4, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
weld55.C1 = CFrame.new(-0.35, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
Tool.Flash.Transparency = 1
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