Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Looped animation only replicates one iteration, unsure why? please help

localscript

local Mouse = plr:GetMouse()
--removed checks to keep this short

local animation = script.Tag
local animTrack = hum:LoadAnimation(animation)
animTrack.Looped=true

Mouse.Button1Down:connect(function()
	animTrack:Play()
	script.AnimationHandler:FireServer(true) --fires remoteevvent
end)

Mouse.Button1Up:connect(function()
	animTrack:Stop()
	script.AnimationHandler:FireServer(false) --fires remoteevvent
end)

remoteevent

repeat wait() until script.Parent.Parent.Parent.Parent.Character~=nil
local hum = script.Parent.Parent.Parent.Parent.Character:WaitForChild("Humanoid")

local animTrack = hum:LoadAnimation(script.Parent.Parent.Tag)
animTrack.Looped=true 

script.Parent.OnServerEvent:connect(function(plr,playing)
	
	if playing==true then
	animTrack:Play()
	else
	animTrack:Stop()
	end
	
end)

4 comments

0

Correct me if I'm wrong, but I believe it's because the script's parent the RemoteEvent itself. The script should either be in the Workspace, or the ServerScriptService.

0

I appreciate the comment, but if that were the case why would it play once  (server side). Also the other remote events in the tool work properly

0

Animations don't need to be converted to FE. Player physics are always replicated

0

I thought so, but it wasn't being replicated in a test server until I added the remote event and now it only replicates once, maybe its a bug in studio (haven't checked in the normal game itself)

1 answer

Mouse.Button1Up fires when you release your mouse button. Maybe it only replicates once because you release your mouse button before the animation would repeat?

This discussion is preserved as it was. New answers, comments, and votes are closed.