of     1   

AstroCode
#140357388Tuesday, July 15, 2014 12:33 AM GMT

I want to use a gun in my game, but a big portion of my game already requires clicking. So, I want the gun to be fired when I press the spacebar. How would I do this?
kevincatssing
#140357454Tuesday, July 15, 2014 12:33 AM GMT

Post the Gun Script here
AstroCode
#140357555Tuesday, July 15, 2014 12:35 AM GMT

This is the part that does the shooting. It's the hyperlaser gun from the catalog. local function OnActivated() if Tool.Enabled and Humanoid.Health > 0 then Tool.Enabled = false FireSound:Play() local handleCFrame = Handle.CFrame local firingPoint = handleCFrame.p + handleCFrame:vectorToWorldSpace(NOZZLE_OFFSET) local shotCFrame = CFrame.new(firingPoint, Humanoid.TargetPoint) local laserShotClone = BaseShot:Clone() laserShotClone.CFrame = shotCFrame + (shotCFrame.lookVector * (BaseShot.Size.Z / 2)) local bodyVelocity = Instance.new('BodyVelocity') bodyVelocity.velocity = shotCFrame.lookVector * SHOT_SPEED bodyVelocity.Parent = laserShotClone laserShotClone.Touched:connect(function(otherPart) OnTouched(laserShotClone, otherPart) end) DebrisService:AddItem(laserShotClone, SHOT_TIME) laserShotClone.Parent = Tool wait(0.6) -- FireSound length ReloadSound:Play() wait(0.75) -- ReloadSound length Tool.Enabled = true end end
AstroCode
#140357623Tuesday, July 15, 2014 12:35 AM GMT

The problem isn't the gun. It's activating the gun.
kevincatssing
#140357878Tuesday, July 15, 2014 12:38 AM GMT

Weird, I don't see any Button1Down qq Note: I am not a scripter
LetUsGame
#140359091Tuesday, July 15, 2014 12:50 AM GMT

local mouse = game.Players.LocalPlayer:GetMouse() mouse.KeyDown:connect(function(key) if key == " " then--I think --stuff end end)

    of     1