I’ve worked with animations ages but I’ve never had this issue.
I am working with events so when one person fires an event, the person who is being affected gets the animation played through the server script. Anyways because every time I fire the event, the animation loads AGAIN, the animation doesn’t stop when I do Track:Stop(). Any help would be greatly appreciated.
Below you can find the code and a short gif as my explanation is pretty stupid.
event.OnServerEvent:Connect(function(player, victim, value)
local detainanimation = victim.Character.Humanoid:LoadAnimation(detainani) -- this part is is the issue as it loads the animation everytime the event fires
local detainanimation2 = victim.Character.Humanoid:LoadAnimation(detainani2)
if value == "true" then
detainanimation:Play() -- this works fine
wait(1)
detainanimation2:Play() -- this works fine
else
print("false") -- this prints
detainanimation:Stop() -- it doesnt stop
detainanimation2:Stop() -- it doesnt stop
end
end)