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

How do I make an animation when you chat something?

Asked by 3 years ago
Edited 3 years ago

I need this for my game. So. I want that if you say a word like "Test" in chat, an animation plays, then stops. I've tried different things on the devforum and on youtube but nothing is working.

1 answer

Log in to vote
1
Answered by 3 years ago

I've found the answer. I thought i'd post it incase anyone else needs this.

Add a regular script into ServerScriptService, and type this:

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

game.Players.PlayerAdded:Connect(function(player) player.Chatted:connect(function(msg) if msg == "texthere" then local animTrack = player.Character.Humanoid:LoadAnimation(animation) animTrack:Play() end end) end)

Replace the idhere with your animation ID, and replace texthere with the text that you want to start the animation. If you want the animation to play once, do not loop your animation when you make it. If you want it to never stop, loop it.

Hope this helps.

Ad

Answer this question