Animation not replicating to server for other people

local script

wait(0.5)
local run = game:GetService(“RunService”)

local walk = script.Walk
local idle = script.Idle

local walkF = script.WalkFlash
local idleF = script.IdleFlash

local hum = game.Players.LocalPlayer.Character:WaitForChild(“Humanoid”)

local fakewalk = hum.Animator:LoadAnimation(walk)
local fakeidle = hum.Animator:LoadAnimation(idle)

local fakewalkF = hum.Animator:LoadAnimation(walkF)
local fakeidleF = hum.Animator:LoadAnimation(idleF)
local changeWalk = game.Players.LocalPlayer.Character:WaitForChild(“Animate”).walk.WalkAnim
local changeIdle = game.Players.LocalPlayer.Character:WaitForChild(“Animate”).idle.Animation1
local changeIdle2 = game.Players.LocalPlayer.Character:WaitForChild(“Animate”).idle.Animation2

local walkF = script.WalkFlash
local idleF = script.IdleFlash

local walk = script.Walk
local idle = script.Idle

while wait() do
game.ReplicatedStorage.EventStorage.FlashlightAnimChanges.Change:FireServer(walk,walkF,idle,idleF,changeIdle,changeWalk,changeIdle2,fakewalk,fakeidleF,fakewalkF,fakeidle)
end```

server script

wait(0.5)

game.ReplicatedStorage.EventStorage.FlashlightAnimChanges.Change.OnServerEvent:Connect(function(plr:Player,walk,walkF,idle,idleF,changeIdle,changeWalk,changeIdle2,fakewalk,fakeidleF,fakewalkF,fakeidle)
local animator = plr.Character:WaitForChild(“Humanoid”).Animator
local hum = plr.Character:WaitForChild(“Humanoid”)

local fakewalk = animator:LoadAnimation(walk)
local fakeidle = animator:LoadAnimation(idle)


local walk = script.Walk
local idle = script.Idle

local walkF = script.WalkFlash
local idleF = script.IdleFlash

local fakewalkF = animator:LoadAnimation(walkF)
local fakeidleF = animator:LoadAnimation(idleF)
local on = game.ReplicatedStorage.BoolStorage.Flashlight.Value 

if on then
	if plr.Character:WaitForChild("Humanoid").MoveDirection.Magnitude > 0 then
		if walkF.IsPlaying == false then
			fakewalkF:Play()
			fakeidleF:Stop()
			print("Cewl")
		end
	else
		if idleF.IsPlaying == false then
			print("Cewl")
			fakeidleF:Play()
			fakewalkF:Stop()
		end
	end
else
	print("Cewl")
	fakeidleF:Stop()
	fakewalkF:Stop()
end

end)```

1 Like

try this:

game.ReplicatedStorage.EventStorage.FlashlightAnimChanges.Change2.OnServerEvent:Connect(function(plr:Player,walk,walkF,idle,idleF,changeIdle,changeWalk,changeIdle2,fakewalk,fakeidleF,fakewalkF,fakeidle)
	local animator = plr.Character:WaitForChild("Humanoid").Animator
	local hum = plr.Character:WaitForChild("Humanoid")


	local fakewalk = animator:LoadAnimation(walk)
	local fakeidle = animator:LoadAnimation(idle)


	local walk = script.Walk
	local idle = script.Idle

	local walkF = script.WalkFlash
	local idleF = script.IdleFlash

	local fakewalkF = animator:LoadAnimation(walkF)
	local fakeidleF = animator:LoadAnimation(idleF)
	local on = game.ReplicatedStorage.BoolStorage.Flashlight.Value 

	if on then
		if plr.Character:WaitForChild("Humanoid").MoveDirection.Magnitude > 0 then
			if walkF.IsPlaying == false then
				fakewalkF:Play()
				fakeidleF:Stop()
				print("Cewl")
			end
		else
			if idleF.IsPlaying == false then
				print("Cewl")
				fakeidleF:Play()
				fakewalkF:Stop()
			end
		end
	else
		print("Cewl")
		fakeidleF:Stop()
		fakewalkF:Stop()
	end

    local changeWalk = plr.Character:WaitForChild("Animate").walk.WalkAnim
    local changeIdle =  plr.Character:WaitForChild("Animate").idle.Animation1
    local changeIdle2 =  plr.Character:WaitForChild("Animate").idle.Animation2

    changeWalk.AnimationId = walk
    changeIdle.AnimationId = idle
    changeIdle2.AnimationId = idle
end)

This link should help:

it took a little modifying but it worked thanks

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.