You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want my animation to stop playing when the character moves.
What is the issue? Include screenshots / videos if possible!
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Yes I have, but no solutio ended up working
game.Players.PlayerAdded:Connect(function(plr)
–Player Commands
plr.Chatted:Connect(function(msg)
if msg == ‘emote1’ then
print(‘fusfushfs’)
local hum = plr.Character.Humanoid
local animation = Instance.new('Animation', hum)
animation.AnimationId = 'rbxassetid://15577850405'
local anim = hum:LoadAnimation(animation)
anim:Play()
end
end)
end)
I havent actually tried anything to stop my animation other then setting it’s animation priority to “Action”, thinking that would fix my problem. It didnt.
1st of all, my eyes burn looking at this code format. Anyhow, you can use the humanoid.MoveDirection Property to do this.
–Player Commands
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
if msg == ‘emote1’ then
local hum = plr.Character.Humanoid
local animation = Instance.new('Animation', hum)
animation.AnimationId = 'rbxassetid://15577850405'
local anim = hum:LoadAnimation(animation)
anim:Play()
hum:GetPropertyChangedSignal("MoveDirection"):Connect(function()
if (hum.MoveDirection.Magnitude) > 0 then
anim:Stop()
end
end)
end
end)
end)
Well it depends. If you are typing on Studio, its really just making sure stuff is looking how I typed it. On the form, the code format works a bit diff. You can mess around with the format. Here is an example: