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

May you help me fix the animation script?

Asked by 10 years ago

Here is the script :

player = game.Players.LocalPlayer
mouse = player:GetMouse()
wait()
anim={}
anim.a =player.Character.Humanoid:LoadAnimation(script.Dance)

mouse.KeyDown:connect(function(key)
    if key == "c" then

        anim.a:Play()
        wait(5)
        anim.a:Stop()

   elseif key == "v" then
x = player.Character.Humanoid:LoadAnimation(script.Dub)
        x:Play()
        wait(6)
        x:Stop()

   elseif key == "b" then
z = player.Character.Humanoid:LoadAnimation(script.Boogie)
        z:Play()
        wait(5)
        z:Stop()

elseif key == "n" then
z = player.Character.Humanoid:LoadAnimation(script.Moon)
        z:Play()
        wait(5)
        z:Stop()

    end
     end)

the first problem is when player dies the script is not active and he needs to reset several times to get it work.

the second problem is that when people spam with some button the animation don't stop and he needs to reset what making again the first problem.

Thanks for all the helpers

Answer this question