I have my Animation Looped but it won't loop

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    Make my FPS System

  2. What is the issue? Include screenshots / videos if possible!
    So I Fire the Server with a RemoteEvent and put a Raw Animations as parameters. And In the ServerScript. I do OnServerEvent. And I loop an Idle Animation. But for some reason it doesn’t work.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I tried copying some of my code for the Client-Only FPS System but it didn’t work.

Here is the Code:

Events.Equip.OnServerEvent:Connect(function(p,hum,equip,idle)
	wait()
	print(p, " has Equipped his tool!")
	local Equip = hum:LoadAnimation(equip)
	local Idle = hum:LoadAnimation(idle)
	Idle.Looped = true
	Equip:Play()
	Equip.Stopped:Wait()
	Idle:Play()
	Equip:Stop()
	
	
end)

If you need the Client Script here is it as well

local p = game.Players.LocalPlayer
p.CharacterAdded:Wait()
local Char = p.Character
local Hum = Char:WaitForChild("Humanoid")
local Tool = script.Parent
local Anims = Tool:WaitForChild("Animation")
local Events = Tool:WaitForChild("Events")

local EquipA = Anims:WaitForChild("Equip")
local IdleA = Anims:WaitForChild("Idle")

Tool.Equipped:Connect(function()
	Events.Equip:FireServer(Hum,EquipA,IdleA)
end)

Are any of the animations working?

They are working. It’s not an Animation Problem I think

When you equip the tool, is it not playing at all, or is it playing once and then stopping?

Try using the animation editor to set the animation to loop

1 Like

Bascially, when I Equip the Tool. The Equip Animation Plays. When the script detects that it stops. The Idle Animation’s loop property is enabled and then the idle animation plays. But after it is playing once it stops.

Try setting the .Looped property to true after starting the animation.

I’ve already tried that but nothing worked. I tried this on Client-Only and it works. When I do it on Server (RemoteEvents) it does not loop

That makes kind of makes sense, I was going to link this post

and suggest that it might be the cause of your problem (that you’re looping from the server instead of the client). My suggestion is to maybe use a remote function instead of a remote event, though I don’t have a lot of knowledge on remote functions so I’m not 100% sure how you’d do it.

Thanks I’ll make a new post. I think I know the problem. I just need to find a way to solve it

1 Like