#Animation script won't work

6 messages · Page 1 of 1 (latest)

calm oyster
#

I have this local script inside a tool, it's supposed to play animation once player clicks their mouse with the tool equipped. For some reason nothing happens and I get no errors. Please somebody help me I tried lots of methods from internet and none worked.

Code:

local tool = script.Parent

tool.Activated:Connect(function()
    if tool.Parent:WaitForChild("Humanoid"):WaitForChild("Animator") == nil then
        local animator = Instance.new("Animator", script.Parent.Parent:WaitForChild("Humanoid"))
    end

    local load = script.Parent.Parent:WaitForChild("Humanoid"):LoadAnimation(tool:WaitForChild("KatanaAnimation"))
    wait(1)
    load:Play()
end)

tool.Handle.Touched:Connect(function(opart)
    if opart.Parent.Humanoid ~= nil then
        if opart.Parent.Name ~= script.Parent.Parent.Name then
            opart.Parent.Humanoid.Health = opart.Parent.Humanoid.Health - 10
        end
    end
end)

Thanks for any responses :)

timid trout
#

is the

#

Animation made by you

calm oyster
#

no it isn't but the guy who owns the game owns the anim

hearty inlet
#

reupload anim and paste ur own id