This script should check if you're in a certain group, if you are then if you say "/e party", your character performs the animation. If you're not a member of the group, nothing happens if you say the command. Also how should I make the animation looped? Right now it just plays once :L
game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) if msg == '/e party' and player:IsInGroup(846314) then player.animationID = 172807805 --id of animation script:remove() end end) end)
This may be what you want. The explaination is given by bobafett3544 so I dont need to tell you why.
game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) if msg == '/e party' and player:IsInGroup(846314) then player.animationID = 172807805 --id of animation script:remove() end end) end)
On line 3, you put player:IsInGroup(846314) ~= true
. ~= true
means "is not true", so if you're in the group, the animation will not play. Change that to player:IsInGroup(846314)
. Also, to loop it, open the animation in the animation editor and check the "Loop" box.
EDIT: Put an animation object with the right animation ID in the script. The code I'm giving you here needs an animation.
game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) if msg == '/e party' and player:IsInGroup(846314) then local animation = script:FindFirstChild("Animation") local animTrack = player.Character:WaitForChild("Humanoid"):LoadAnimation(animation) animTrack:Play() end end) end)
Note that this code will not stop playing the animation if it is looped. I'll find a way to make it stop when I get home and have access to Studio.