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 play the animations I made using animator?

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

✓ 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)--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

2 comments

0

Thanks for your help!

0

No problem :)

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