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

Chatting Animations?

Asked by
JJ_B 250 Moderation Voter
10 years ago

This doesn't work, but it doesn't look right anyway.

game.Players.PlayerAdded:connect(function(player)
  player.Chatted:connect(function(msg)
    if msg == "/e flap" then
local animTrack = Humanoid:LoadAnimation(animation)
animTrack:Play()
end

How would I do it properly?

1 answer

Log in to vote
8
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago
-- Import animation
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID="

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

You forgot to define the animation variable.

-Thank me by accepting this answer/bumping up my reputation!

0
Thanks for answering all my questions :3 JJ_B 250 — 10y
0
No problem Wizardel! I just like to help people out. Send me a Friend Request on ROBLOX and on here! Shawnyg 4330 — 10y
1
You also forgot to close the PlayerAdded event. TheGuyWithAShortName 673 — 10y
0
Ah, yes. Let me add that Shawnyg 4330 — 10y
Ad

Answer this question