Soo I got this script that plays an animation whenever the player says: '/e bouncydance'.
game.Players.PlayerAdded:connect(function(Plr) Plr.Chatted:connect(function(msg) if msg == "/e bouncydance" then A = Instance.new("Animation", Plr.Character) A.AnimationId = "rbxassetid://1746899451" track = Plr.Character.Humanoid:LoadAnimation(A) track:Play() end end) end)
The problem is that when the player moves the animation keeps on playing. Could you please tell me what to add so the emote stops playing when the player moves?
Thank you :>
game.Players.PlayerAdded:connect(function(Plr) Plr.Chatted:connect(function(msg) if msg == "/e bouncydance" then A = Instance.new("Animation", Plr.Character) A.AnimationId = "rbxassetid://1746899451" track = Plr.Character.Humanoid:LoadAnimation(A) track:Play() Plr.Character.Humanoid.Running:connect(function(speed) if speed > 0 then track:Stop() end end) end end) end)
game.Players.PlayerAdded:connect(function(Plr) Plr.Chatted:connect(function(msg) if msg == "/e bouncydance" then A = Instance.new("Animation", Plr.Character) A.AnimationId = "rbxassetid://1746899451" track = Plr.Character.Humanoid:LoadAnimation(A) track:Play() end end) end) game.Workspace.Player.Humanoid.Running:connect(function(speed) if speed > 0 then track:stop() end
Hope this is helped you!