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

Animation replicates only in client, but not in server?

Asked by 5 years ago
Edited 5 years ago

I'm testing on starter characters and when animations get loaded, they only replicate in the client, not in the server or other clients. Is there something wrong with my code:

--Animation Module
local self = {}
local Animation
local Track
function self:StopTrack()
    Track:Stop()
    Animation:Destroy()
end

function self:PlayNewTrack(Id)
    if not game.Players.LocalPlayer.Character then return end
    if not game.Players.LocalPlayer.Character:FindFirstChild("Humanoid") then return end
    if Animation and Track then
        self:StopTrack()
    end

    Animation = Instance.new("Animation")
    Animation.AnimationId = "rbxassetid://"..Id
    Track = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(Animation)
    Track:Play()
end

return self

Photo Is it a bug from ROBLOX or a bug from the StarterCharacters

0
repeat wait() until humanoid:FindFirstAncestor(workspace.Name) Fifkee 2017 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

If you are using localscripts then the server won't know that it is happening. If you want everyone to see it you have to animate on the server side. There are several ways to do this, but my favorite uses remote events. I am on my phone so I can't look up the link, but there are quite a few tutorials online and on the roblox studio site.

0
well animations are for players physics so it replicates from server Dalbertjdplayz 37 — 5y
0
i tried testing it. it got fixed ok thanks Dalbertjdplayz 37 — 5y
Ad

Answer this question