Why Is My Animations Client Sided?

Hello! I’d like to know why my script is client sided and if there is anyway to fix it.

(Client sided as why I can only see the run animation and my friends cant see it)

Here’s my script

local Player = game.Players.LocalPlayer
	local Character = workspace:WaitForChild(Player.Name)
		local Humanoid = Character:WaitForChild('Humanoid')
		
local RunAnimation = Instance.new('Animation')
RunAnimation.AnimationId = 'rbxassetid://5709810264'
RAnimation = Humanoid:LoadAnimation(RunAnimation)

Running = false

function Handler(BindName, InputState)
	if InputState == Enum.UserInputState.Begin and BindName == 'RunBind' then
		Running = true
		Humanoid.WalkSpeed = 18.5
	elseif InputState == Enum.UserInputState.End and BindName == 'RunBind' then
		Running = false
		if RAnimation.IsPlaying then
			RAnimation:Stop()
		end
		Humanoid.WalkSpeed = 7.5
	end
end

Humanoid.Running:connect(function(Speed)
	if Speed >= 10 and Running and not RAnimation.IsPlaying then
		RAnimation:Play()
		Humanoid.WalkSpeed = 18.5
	elseif Speed >= 10 and not Running and RAnimation.IsPlaying then
		RAnimation:Stop()
		Humanoid.WalkSpeed = 7.5
	elseif Speed < 10 and RAnimation.IsPlaying then
		RAnimation:Stop()
		Humanoid.WalkSpeed = 7.5
	end
end)

Humanoid.Changed:connect(function()
	if Humanoid.Jump and RAnimation.IsPlaying then
		RAnimation:Stop()
	end
end)

game:GetService('ContextActionService'):BindAction('RunBind', Handler, true, Enum.KeyCode.LeftControl)
1 Like

Are you using a local script? Local scripts are client sided only

2 Likes

Oh my bad, yes I am using a local script. xd

2 Likes

Ya that would be the problem with that

2 Likes

Thank you so much for the help! : D

2 Likes

The player has Network Ownership of the character so client sided animations should work in this case.

1 Like

Hello,
I’m unsure as to why this occurs, as LocalScripts that play animations will replicate. I’m unsure what your current circumstance is, but it may be an issue with the animation you are trying to play. Make sure they aren’t playing in team create, but playing on the ROBLOX client.

1 Like