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

Why won't this gun script work!?

Asked by 10 years ago

Here is the script.

Player = game.Players.LocalPlayer
Pistol = script.Parent
Ammo = 10
mouse = Player:GetMouse()
enabled = true
function Shoot()
    if Ammo >= 1 and enabled == true then
    enabled = false
    Ammo = Ammo -1
    print("You have " .. Ammo .."ammo left!")
    Bullet = Instance.new("Part", Workspace)
    Pistol.GripPos.Vector3.new(0, -0.35 -0.4)
    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 = Pistol.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=31760113"
    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)
    wait(0.1)
    Pistol.GripPos.Y = -0.6
    wait()
    enabled = true
    end
end

Pistol.Activated:connect(Shoot)


Output says Players.Player1.Backpack.Pistol.LocalScript:37: function arguments expected near 'game'.What does that mean?Help!

1 answer

Log in to vote
1
Answered by 10 years ago

I'm sure thats a script friaza made. Just saying

0
By the way, the problem is that Sounds now automatically play when Inserted I think, so you need to stop them instead, just remove the sounds or mess with them. I'm not sure I haven't used sounds. PlatinumLocks 50 — 10y
0
Ok in the vid i will skip the sound part. iluvmaths1123 198 — 9y
Ad

Answer this question