Essentially, when the player character moves, the custom walk animation plays, but when one player does the animation, every single player also starts doing the animation, no matter if they’re moving or not.
I’m unsure of a fix, as I am rusty with animation scripts specifically.
local model = script.Parent.Parent
local animationController = model.AnimationController
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:FindFirstChild("Humanoid")
local idle = animationController.Animator:LoadAnimation(script.Parent.Idle)
idle:Play()
idle.Priority = Enum.AnimationPriority.Idle
local walk = animationController.Animator:LoadAnimation(script.Parent.Walk)
walk.Priority = Enum.AnimationPriority.Movement
humanoid.Running:Connect(function(speed)
walk:AdjustSpeed(speed / 8)
if speed > 0 then
if not walk.IsPlaying then
walk:Play()
end
walk:AdjustSpeed(speed / 8)
else
if walk.IsPlaying then
walk:Stop()
end
end
end)
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
local idle = animator:LoadAnimation(script.Parent.Idle)
idle.Priority = Enum.AnimationPriority.Idle
idle:Play()
local walk = animator:LoadAnimation(script.Parent.Walk)
walk.Priority = Enum.AnimationPriority.Movement
humanoid.Running:Connect(function(speed)
if speed > 0 then
if idle.IsPlaying then idle:Stop() end
if not walk.IsPlaying then walk:Play() end
walk:AdjustSpeed(speed / 8)
else
if walk.IsPlaying then walk:Stop() end
if not idle.IsPlaying then idle:Play() end
end
end)
Hope this works out for you.. I also add a cleaner version to handle idle/walk switching automatically.
Actually, this is 100% hackable and would lead to a disaster in the game.
Easy to fix that part of it up too..
Client
-- LocalScript (StarterPlayerScripts)
local remote = game.ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("MoveUpdate")
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
local idle = animator:LoadAnimation(script.Parent.Idle)
idle.Priority = Enum.AnimationPriority.Idle
idle:Play()
local walk = animator:LoadAnimation(script.Parent.Walk)
walk.Priority = Enum.AnimationPriority.Movement
humanoid.Running:Connect(function(speed)
remote:FireServer(speed > 0)
if speed > 0 then
if idle.IsPlaying then idle:Stop() end
if not walk.IsPlaying then walk:Play() end
else
if walk.IsPlaying then walk:Stop() end
if not idle.IsPlaying then idle:Play() end
end
end)
Server
-- ServerScript (ServerScriptService)
local rs = game.ReplicatedStorage
local remotes = rs:FindFirstChild("Remotes") or Instance.new("Folder", rs); remotes.Name = "Remotes"
local remote = remotes:FindFirstChild("MoveUpdate") or Instance.new("RemoteEvent", remotes);
remote.Name = "MoveUpdate"
-- I know, funny. Just showing you.. you can make this manually and remove this part.
remote.OnServerEvent:Connect(function(player, moving)
local char = player.Character
if not char then return end
local humanoid = char:FindFirstChild("Humanoid")
if not humanoid then return end
if moving then
humanoid.WalkSpeed = 16
else
humanoid.WalkSpeed = 8
end
end)
Super simple really.. The hackable parts get moved to the server. In this case it’s the speed change.
You’ll have to modify it to do that. Maybe put the animations where all the other animations are.
You have custom animations that are replacing the actual animations. The first thing I’d try is to just replace them where they are now.