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

Why cant I play animation?

Asked by 4 years ago
Edited 4 years ago

I am trying to play animation but its not working, the script is working properly and there is no errors but its still not playing the animation.

local player = game.Players.LocalPlayer
local debounce = true

script.Parent.Activated:Connect(function()

    if debounce == true then

    local plr = script.Parent.Parent
    local animation = plr.Humanoid:LoadAnimation(script.Parent.Animation)
        animation:Play()

    print("Tool Activated")

        debounce = false

        wait(1)

        debounce = true

    end
end)

1 answer

Log in to vote
1
Answered by
Optikk 499 Donator Moderation Voter
4 years ago
Edited 4 years ago

The fact that you haven't gotten an error or any results makes me think your script isn't running at all, or there's a fundamental misunderstanding of what an error is. Have you done all of the following?

  • This animation you're using is your animation, is loaded, and takes priority over the default animations

  • This code is in a LocalScript

  • This LocalScript is parented to a Tool, as expected based on your code

  • This tool can be activated (Tool.ManualActivationOnly should be false based on your code)

  • This tool has a part named Handle (which it should if RequiresHandle is true on the Tool)

  • The LocalScript is enabled

If all of the following are true and your code still isn't working properly, then I'm not sure my friend. Hope I was of assistance.

Ad

Answer this question