Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My Bullet Will not propel Just drop please help?

Asked by 10 years ago

This is my gun script and it will not propel just drop out the gun

Player = game.Players.LocalPlayer
Gun = script.Parent
Ammo = 5
mouse = Player:GetMouse()
function Shoot()
    if Ammo > 0 then
        Bullet = Instance.new("Part", workspace)
        game.Debris:AddItem(Bullet, 2)
        Bullet.Shape = "Ball"
        Bullet.Size = Vector3.new(0.2,0.2,0.2)
        Bullet.TopSurface = "Smooth"
        Bullet.BottomSurface = "Smooth"
        Bullet.BrickColor = BrickColor.new("Dark stone grey")
        Bullet.CanCollide = false
        Bullet.CFrame = Gun.Handle.CFrame
        v = Instance.new("BodyVelocity")
        v.velocity = Bullet.CFrame.lookVector *90
        v.maxForce = Vector3.new(math.huge, math.huge, math.huge)
    end
end

Gun.Activated:connect(Shoot)

1 answer

Log in to vote
1
Answered by
Redbullusa 1580 Moderation Voter
10 years ago

You forgot to set the parent of 'v' to the bullet.

v.Parent = Bullet   -- Line 19
Ad

Answer this question