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

My tool can't play R15 animations. What happened?

Asked by 5 years ago

My tool is unable to play a R15 animation properly.

char = game.Workspace:WaitForChild(game.Players.LocalPlayer.Name)
humanoid = char:WaitForChild("Humanoid")
print("Found!")


anim = Instance.new("Animation", script.Parent)
anim.AnimationId = "rbxassetid://3099747122"
anim.Name = "toolanim"
anim.Archivable = true


track = humanoid:LoadAnimation(anim)


script.Parent.Activated:Connect(function(turn)
game.ReplicatedStorage.AddBagels:FireServer(math.random(1,5))
print(track)
track:Play()
end)

1 answer

Log in to vote
0
Answered by 5 years ago
  1. Did you insert a handle?
  2. Make sure the animation is in the handle.
  3. If it is a hopperbin that is deprecated.

Instead of the piece of code you put use this:

`local character = game.Players.Local.Character local humanoid = character.Humanoid local handle = script.Parent.Handle

if humanoid then print('Found') else error('Error 404, the variable humanoid is not found.')

local anim = handle:WaitForChild("Animation") --Note: Make sure it's still named animation, if not it will break.

local track = humanoid:LoadAnimation(anim)

--Add the other piece of code below the comment.

track:Play()`

I haven't actually tested it, and plus i'm new to roblox development I only started a few months ago.

Ad

Answer this question