✓ Accepted answer
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)
plr.Chatted:connect(function(msg)
if string.sub(msg, 1, 3)=="/e " then
if string.sub(msg, 4, string.len(msg))=="Command" then
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
2 comments
Thanks for your help!
No problem :)