Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Player = game.Players.LocalPlayer
- Gun = script.Parent
- Ammo = 20
- mouse = Player:GetMouse()
- enabled = true
- function = Shoot()
- if Ammo > = 1 and enabled == true then
- Ammo = Ammo -1
- enabled = false
- Bullet = Instance.new("Part", Workspace)
- Gun.GripPos.Y = Vector3.new(0, -0.35, -0.4)
- game.Debris:AddItem(Bullet, 2)
- Bullet.shape = "Cube"
- Bullet.size = Vector3.new(0.1, 0.1, 0.1)
- Bullet.TopSurface = "Smooth"
- Bullet.BottomSurface = "Smooth"
- Bullet.BrickColor = BrickColor.new("Dark stone blue")
- Bullet.CanCollide = false
- Bullet.CFrame = Gun.Handle.CFrame
- Bullet.CFrame = CFrame.new(Bullet.Position, mouse.Hit.p)
- 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 = "https://www.roblox.com/Gunshot-item?id=130770091"
- RP = math.random(60,80)
- RP = RP /10
- FireSound.Pitch = 0.8
- RV = RV /10
- FireSound.Volume = RV
- FireSound:Play()
- game.Debris:AddItem(FireSound, 2)
- wait (0.2)
- Gun.GripPos.Y = Vector3.new(0, -0.6, -0.4)
- wait()
- enabled = true
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement