|
| 13 Sep 2013 03:46 PM |
How would I actually make this script be like after there ammo runs out, you can't shoot anymore.
--Original script made by thetacah
Player = game.Players.LocalPlayer Gun = script.Parent Ammo = 25 BulletDamage = 5 mouse = Player:GetMouse()
function shoot() if Ammo <= 25 then function Damage(Part) if Part.Parent:FindFistChild("Humanoid") ~= nil and Part.Parent ~= Player.Name then Part.Parent.Humanoid.Health = Part.Parent.Humanoid.Health -BulletDamage Bullet:Destroy() end end wait() Bullet = Instance.new("Part", workspace) Bullet.Shape = "Ball" Bullet.Size = Vector3.new(0.1, 0.1, 0.1) Bullet.TopSurface = "Smooth" Bullet.BottomSurface = "Smooth" Bullet.BrickColor = BrickColor.new("Bright red") Bullet.CanCollide = true 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) game.Debris:AddItem(Bullet, 1)
end end script.Parent.Activated:connect(shoot) Bullet.Touched:connect(Damage) |
|
|
| Report Abuse |
|
| |
| |
| |
| |