local Player = game.Players.LocalPlayer local Character =…
- User
local Player = game.Players.LocalPlayer local Character = workspace:WaitForChild(Player.Name) local Humanoid = Character:WaitForChild('Humanoid')
local RunAnimation = Instance.new('Animation') RunAnimation.AnimationId = 'rbxassetid://13721411858' RAnimation = Humanoid:LoadAnimation(RunAnimation)
Running = false
function Handler(BindName, InputState) if script.Parent.Crouch.Crouching.Value == false then if InputState == Enum.UserInputState.Begin and BindName == 'RunBind' then Running = true Humanoid.WalkSpeed = 20 elseif InputState == Enum.UserInputState.End and BindName == 'RunBind' then Running = false if RAnimation.IsPlaying then RAnimation:Stop() end Humanoid.WalkSpeed = 14 end end end
Humanoid.Running:connect(function(Speed) if Speed >= 10 and Running and not RAnimation.IsPlaying then RAnimation:Play() Humanoid.WalkSpeed = 20 elseif Speed >= 10 and not Running and RAnimation.IsPlaying then RAnimation:Stop() Humanoid.WalkSpeed = 14 elseif Speed < 10 and RAnimation.IsPlaying then RAnimation:Stop() Humanoid.WalkSpeed = 14 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.LeftShift) сделай так чтобы когда игрок пятится назад (то есть идет спиной вперед) его скорость уменьшалась. так же соблюдай правила скрипты. Так же чтобы скорость не уменьшалась когда игрок ползет
- Assistant
local Player = game.Players.LocalPlayer local Character = workspace:WaitForChild(Player.Name) local Humanoid = Character:WaitForChild('Humanoid')
local RunAnimation = Instance.new('Animation') RunAnimation.AnimationId = 'rbxassetid://13721411858' local RAnimation = Humanoid:LoadAnimation(RunAnimation)
local Running = false local WalkingBackwards = false
function Handler(BindName, InputState) if script.Parent.Crouch.Crouching.Value == false then if InputState == Enum.UserInputState.Begin and BindName == 'RunBind' then Running = true Humanoid.WalkSpeed = 20 elseif InputState == Enum.UserInputState.End and BindName == 'RunBind' then Running = false if RAnimation.IsPlaying then RAnimation:Stop() end Humanoid.WalkSpeed = 14 end end end
Humanoid.Running:Connect(function(Speed) if Speed >= 10 and Running and not RAnimation.IsPlaying then RAnimation:Play() Humanoid.WalkSpeed = 20 elseif Speed >= 10 and not Running and RAnimation.IsPlaying then RAnimation:Stop() Humanoid.WalkSpeed = 14 elseif Speed < 10 and RAnimation.IsPlaying then RAnimation:Stop() Humanoid.WalkSpeed = 14 end end)