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

How do I make this work with animation?

Asked by
Rhuxus 25
9 years ago

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

Log in to vote
0
Answered by
Hero_ic 502 Moderation Voter
9 years ago

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!
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. Rhuxus 25 — 9y
Ad

Answer this question