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

Is this gun script SUPPOSE to work?

Asked by 10 years ago
shooter2 = game.Workspace.Shot2
shooter1 = game.Workspace.Shot1
local player = game.Workspace.LocalPlayer
local bullet = Instance.new("Part")
bullet.Enabled = false 

damage = 14
damage2 = 20

function MouseClick()
    function onTouched(hit)
        local animation1 = shooter1.Rotation.Vector3.new(45, 0, 0)
        local animation2 = shooter2.Rotation.Vector3.new(45, 0, 0)
    if player:MouseClick(shooter1) then
        animation1 = true
        wait(1)
        animation1.Rotation.Vector3.new(90, 0, 0)
        bullet.Enabled = true 
        if player:MouseClick(shooter2) then
            shooter2.Rotation.Vector3.new(45, 0, 0)
            wait(1)
            shooter2.Rotation.Vector3.new(90, 0, 0)
        end
        if player:onTouched(bullet) then
            player:GetPlayers("Humanoid")
            player.Humanoid.Health:TakeDamage(damage)
        elseif player:onTouched(bullet) then
            bullet = true
            player:GetPlayers("Humanoid")
            player.Humanoid.Health:TakeDamage(damage2)
        end
    end
end
end

script.Parent.Mouse1ButtonClick:connect(MouseClick)
script.Parent.Touched:connect(onTouched)

It's suppose to be, when you shoot, a bullet comes out and if a bullet hits a player, damage happens.

1
tl;dr, but at the end, when you connect to MouseClick, you put three t's in Button. systematicaddict 295 — 10y
0
Ah thanks. Other than that, it should work? Roboy5857 20 — 10y
0
Well ALL scripts are SUPPOSED to work. That's why you write them Maxomega3 106 — 10y
0
Ok Roboy5857 20 — 10y

Answer this question