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:

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

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:

1local BreakDanceAnimation = Instance.new("Animation")
2BreakDanceAnimation .AnimationId = "http://www.roblox.com/Asset?ID=173766787"
3 
4local animTrack = plr.Character.Humanoid:LoadAnimation(BreakDanceAnimation)
5animTrack: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