#why when i make tools by myself, and try to load an animation it doesnt work.

1 messages · Page 1 of 1 (latest)

wild prairie
#

and when i try to do it with a tool that was taken from toolbox it works perfectly fine

local player = game.Players.LocalPlayer

tool.Enabred = true

local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://80002156809870" 

tool.Activated:Connect(function()
    print("Activated")

    local char = player.Character or player.CharacterAdded:Wait()
    local humanoid = char:WaitForChild("Humanoid")
    local animator = humanoid:WaitForChild("Animator")

    local track = animator:LoadAnimation(anim)
    track.Priority = Enum.AnimationPriority.Action
    track:Play()

end)```
fresh mortarBOT
#

studio** You are now Level 5! **studio

tulip estuary
#

Are you sure the animation is public/it’s been uploaded?

modest coyote
#
tool.Enabred = true

#

EnaBRED

wild prairie
modest coyote
#

oh

#

hold on

#

i see now

#

you didnt parent the animation

wild prairie
modest coyote
#

send current script

wild prairie
# modest coyote send current script
local player = game.Players.LocalPlayer

tool.Enabled = true

local anim = Instance.new("Animation")
anim.Parent = tool
anim.AnimationId = "rbxassetid://80002156809870" 


tool.Activated:Connect(function()
    print("Activated")

    local char = player.Character or player.CharacterAdded:Wait()
    local humanoid = char:WaitForChild("Humanoid")
    local animator = humanoid:WaitForChild("Animator")

    local track = animator:LoadAnimation(anim)
    track.Priority = Enum.AnimationPriority.Action
    track:Play()

end)```
modest coyote
wild prairie
zinc bough
#

Is there a reason this is on the client

#

You should just do character = tool.parent

#

Idk if that's gonna fix it not playing

modest coyote
#

its pretty much safer

#

then just replace character if player's character was readded

zinc bough
#

He probably just doesn't have access to the animation

#

That's my theory

wild prairie
zinc bough
#

also remove the priorityt

#

thats already set when you publish the animation

neon bluff
#

First of all make this a local script

#

And then, player = game.Players.LocalPlayer

wild prairie
#

it prints: {...}

#

it is local script

neon bluff
wild prairie
#

yea: [1] = ToolNoneAnim,
[2] = WalkAnim,
[3] = RunAnim,
[4] = Animation

winged void
#

Your Local Script sits inside the Tool. This works.

neon bluff
#

Because rn it's trying to load it again every time it's activated

#

Which is basically unnecessary work