Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 5 years ago
Edited 5 years ago

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)
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. Lugical 425 — 5y
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 Perfect_Fight 5 — 5y
0
Animations don't need to be converted to FE. Player physics are always replicated User#19524 175 — 5y
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) Perfect_Fight 5 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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?

Ad

Answer this question