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

Animation tool works , but always breaks after a coupe of seconds , how to fix it ?

Asked by 5 years ago

Hello ,

I'm asking for your help , I'm doing a tool , where there is a localscript , it's supposed to play an animation :

repeat wait()until game.Players.LocalPlayer.Character

local plr = game.Players.LocalPlayer
local char = plr.Character

debounce = false

script.Parent.Equipped:Connect(function()
    script.Parent.Activated:Connect(function()
        if debounce == false then
            debounce = true
            local anim = Instance.new("Animation", char)
            anim.AnimationId = "rbxassetid://2192134468"
            local playanim = char:FindFirstChild("Humanoid"):LoadAnimation(anim)
            playanim:Play()
            wait(1)
            debounce = false

        end
    end)
end)

It's working , but the problem is that the animation always breaks , I really need this thing to work , I really need your help , I don't know what to do :(

Thanks .

0
the parent parameter of Instance.new is decaperated User#23365 30 — 5y
0
what do u mean by the animation breaking User#23365 30 — 5y
0
like if my animation is we will say a punching animation , before punching the animation will maybe stop BurnltDown 2 — 5y

Answer this question