Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make this work with animation?

Alright, so I made an animation with animation editor for a tool of mine. Animation works how it's suppose to when nothing is equipped. However, when I have the tool equipped and run the animation, it moves the legs but that's it. It doesn't lower or move the body like its suppose to. The animation gets all messed up.

Is there a way to use the animation from animation editor with tools?

1 answer

✓ Accepted answer

Yes there is.

local char = game.Players.LocalPlayer.Character --Gets character

function pani(id)
	if char~=nil and char.Humanoid~=nil then
		local id=tostring(id)
		local animation=Instance.new("Animation",char) --Create Animation
		animation.Name="LocalAnimation" 
		animation.AnimationId=id --Gets the id
		ani=char.Humanoid:LoadAnimation(animation) --This loads our animation.
		ani:Play()
	end
end

When you want to play an animation put this in.

pani(rbxassetid://248161540) -- Just type your animation id after the // and toda!

1 comment

0

Right, I got all that, the issue is. If you have a tool equipped while running animation, your body doesn't move. If you dont got a tool, the animation works perfect.

This discussion is preserved as it was. New answers, comments, and votes are closed.