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

How do I play the animations I made using animator?

Asked by
Seraine 103
10 years ago

I made about 10 animations using the animator plugin by Roblox, but how do I make a script so that when a user say a command like /e breakdance they will perform this animation: http://www.roblox.com/dancetype11-item?id=173766787 in game.

Everything used to work about several months ago, but I think Roblox now updated the animations...

1 answer

Log in to vote
1
Answered by 10 years ago

First off you would need an event telling you when they've said "/e breakdance" which you can do via the .Chatted event. For example:

game.PlayerAdded:connect(function(plr)--Fires when a new player joins
    plr.Chatted:connect(function(msg)--Fires when the new player chats
        if string.sub(msg, 1, 3)=="/e " then--Checks if it is a command
            if string.sub(msg, 4, string.len(msg))=="Command" then--Checks what command was said(Change "Command" to breakdance or whatever you want)
                print("The Command goes here")
            end
        end
    end)
end)

Now you just need to make the character dance which can be done by creating an animation object and play it. Here's an example:

local BreakDanceAnimation = Instance.new("Animation")
BreakDanceAnimation .AnimationId = "http://www.roblox.com/Asset?ID=173766787"

local animTrack = plr.Character.Humanoid:LoadAnimation(BreakDanceAnimation)
animTrack:Play()

That's all it should take. If you need more help I suggest looking at the wiki article.http://wiki.roblox.com/index.php?title=Animations

0
Thanks for your help! Seraine 103 — 10y
0
No problem :) Prohibetur 70 — 10y
Ad

Answer this question