This doesn't work, but it doesn't look right anyway.
1 | game.Players.PlayerAdded:connect( function (player) |
2 | player.Chatted:connect( function (msg) |
3 | if msg = = "/e flap" then |
4 | local animTrack = Humanoid:LoadAnimation(animation) |
5 | animTrack:Play() |
6 | end |
How would I do it properly?
01 | -- Import animation |
02 | local animation = Instance.new( "Animation" ) |
03 | animation.AnimationId = "http://www.roblox.com/Asset?ID=" |
04 |
05 | game.Players.PlayerAdded:connect( function (player) |
06 | player.Chatted:connect( function (msg) |
07 | local msg = msg:lower() |
08 | if msg = = "/e flap" then |
09 | local animTrack = player.Character.Humanoid:LoadAnimation(animation) |
10 | animTrack:Play() |
11 | end |
12 | end ) |
You forgot to define the animation variable.
-Thank me by accepting this answer/bumping up my reputation!