The bullet just doesn't go the direction the players mouse is but it just spawns the bullet.
Player = game.Players.LocalPlayer
Gun = script.Parent
Ammo = 5
mouse = Player:GetMouse()
function Shot(test)
if Ammo > 0 then
Bullet = Instance.new("Part", Workspace)
game.Debris:AddItem(Bullet, 2)
Bullet.Shape = "Ball"
Bullet.Size = Vector3.new(0.1, 0.1, 0.1)
Bullet.TopSurface = "Smooth"
Bullet.BottomSurface = "Smooth"
Bullet.BrickColor = BrickColor.new("Lime green")
Bullet.CanCollide = false
Bullet.CFrame = Gun.Handle.Cframe
Bullet.CFrame = CFrame.new(Bullet.Position,mouse.Hit.p)
BM = Instance.new("SpecialMesh", Bullet)
BM.MeshType = "Sphere"
BM.Scale = Vector3.new(0.2, 0.2, 0.2)
v = Instance.new("BodyVelocity", Bullet)
v.velocity = Bullet.CFrame.lookVector *90
v.maxForce = Vector3.new(math.huge, math.huge, math.huge)
FireSound = Instance.new("Sound", Bullet)
FireSound.SoundId = "http://www.roblox.com/asset/?id=161875506"
RP = math.random(60,80)
RP = RP /10
FireSound.Pitch = RP
RV = math.random(70, 90)
RV = RV /10
FireSound.Volume = RV
FireSound:Play()
game.Debris:AddItem(FireSound, 2)
end
end
Gun.Activated:connect(Shot)

1 comment
This isn't an answer. If you just have a vague idea what an answer might be, comment, dont make an entire answer which clutters the question board.