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

Animation replicates only in client, but not in server?

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

1 comment

0

repeat wait() until humanoid:FindFirstAncestor(workspace.Name)

1 answer

✓ Accepted answer

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.

2 comments

0

well animations are for players physics so it replicates from server

0

i tried testing it. it got fixed ok thanks

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