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!
Make my FPS System
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.
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)
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.
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.