local player = game.Players.LocalPlayer repeat wait() until player.Character local char = player.Character local hum = char.Humanoid local running = false local UIS = game:GetService("UserInputService") local ToggleSusanoo = game.ReplicatedStorage:WaitForChild("ToggleSusanoo") UIS.InputBegan:Connect(function(Input, Chat) if Input.KeyCode == Enum.KeyCode.E and not Chat and hum.Health >= 1 then if running == false then ToggleSusanoo:FireServer(true) local Anim = Instance.new('Animation') Anim.AnimationId = script.Idle.AnimationId PlayAnim = char.Humanoid:LoadAnimation(Anim) PlayAnim:Play() running = true elseif running == true then ToggleSusanoo:FireServer(false) PlayAnim:Stop() running = false elseif running == true then if hum.walkspeed > 0 then PlayAnim:Stop() end end end end)
this is the script and i tried to make it so when the walspeed is bigger than 0 the animation stops but it didnt work
PLay test your game, open explorer while play testing, open workspace, open your player model inside will be a script called "Animate" copy that. stop the play test, paste it into StarterCharacterScripts in StarterPlayerScripts, replace the idle animation id's with the id of your animation..