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.

01char = game.Workspace:WaitForChild(game.Players.LocalPlayer.Name)
02humanoid = char:WaitForChild("Humanoid")
03print("Found!")
04 
05   
06anim = Instance.new("Animation", script.Parent)
07anim.AnimationId = "rbxassetid://3099747122"
08anim.Name = "toolanim"
09anim.Archivable = true
10 
11   
12track = humanoid:LoadAnimation(anim)
13 
14   
15script.Parent.Activated:Connect(function(turn)
16game.ReplicatedStorage.AddBagels:FireServer(math.random(1,5))
17print(track)
18track:Play()
19end)

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