I've tried everything I can and it doesn't work I changed the normal Roblox animation code so that if the WalkSpped is equal or more than WalkSpeed a different animation is played
local Players = game:GetService("Players") local runAnimation = "rbxassetid://8477846036" --Gets Animation local function onCharacterAdded(character) local humanoid = character:WaitForChild("Humanoid") -- Gets humanoid local animateScript = character:WaitForChild("Animate") -- local walkspeed = humanoid.WalkSpeed if walkspeed >= 25 then animateScript.run.RunAnim.AnimationId = runAnimation elseif walkspeed < 25 then -- end end local function onPlayerAdded(player) player.CharacterAppearanceLoaded:Connect(onCharacterAdded) -- Connects onCharacterAdded when the CharacterApperanceLoaded is true end Players.PlayerAdded:Connect(onPlayerAdded) -- Connects onPlayerAdded to PlayersAdded idk
I tried something else in the animation script but it won't work nor save
function onRunning(Speed) local runAnimation = "rbxassetid://8477846036" if Speed >= 25 then animTable[3][1][1] = runAnimation elseif Speed < 25 then else --function end end
You need to check if the walkspeed changes, there's a built-in function named "GetPropertyChangedSignal" to get the event of it, example script (Edited to fix the issues):
local function OnCharacterAdded(chr) chr.Humanoid:GetPropertyChangedSignal("WalkSpeed"):Connect(function() local newSpeed = chr.humanoid.WalkSpeed if newSpeed >= 25 then chr.Animate.run.RunAnim.AnimationId = runId else -- Default walk animation end end) -- Get walkspeed change event, you can use this on other properties too end local function OnPlayerAdded(plr) plr.CharacterAdded:Connect(OnCharacterAdded) -- other stuff end game.Players.PlayerAddded:Connect(OnPlayerAdded)