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

I'm making a new emote tool,expected <eof> got 'end'???

Asked by 5 years ago

I managed to fix it. But more errors appear.




enabled = false script.Parent.Equipped:connect(function(m) m.Button1Down:connect(function() local hum = game.Players.LocalPlayer.Character.Humanoid local anim_feet = hum:LoadAnimation(script.Parent.Animation) local current = anim_feet if enabled == false then current:Play() script.Parent.Sound:Play() hum.WalkSpeed = 0 enabled = true else current:Stop() current:Destroy() script.Parent.Sound:Stop() hum.WalkSpeed = 16 end end) script.Parent.Unequipped:connect(function() script.Parent.Sound:Stop() current:Stop() hum.WalkSpeed = (16) end) end) end)
0
the last end is the error Edentrix 2 — 5y

2 answers

Log in to vote
0
Answered by
DollorLua 235 Moderation Voter
5 years ago

you have a extra end)

0
but when i take the extra end) away, it thinks that 'current' is not a valid value Edentrix 2 — 5y
0
It's because you're using the *local current* in another separate function, also you have an extra *end)* DarkSkyInvader 2 — 5y
Ad
Log in to vote
0
Answered by 5 years ago
enabled = false

script.Parent.Equipped:connect(function(m)

    m.Button1Down:connect(function()

            local hum = game.Players.LocalPlayer.Character.Humanoid
            local anim_feet = hum:LoadAnimation(script.Parent.Animation)
            local current = anim_feet

        if enabled == false then

            current:Play()
            script.Parent.Sound:Play()
            hum.WalkSpeed = 0
            enabled = true

        else

            current:Stop()
            current:Destroy()
            script.Parent.Sound:Stop()
            hum.WalkSpeed = 16

        end --if end
    end) -- function mousebutton end
end) -- end the eppuiped part


script.Parent.Unequipped:connect(function()

    script.Parent.Sound:Stop()
    current:Stop()


    hum.WalkSpeed = (16)

end) -- only 1 end for Unequipped. then are no if's or functions to end

Answer this question