объедини 2 скрипта ниже в 1 скрипт. local UIS = game:GetService('UserInputService')…
- User
объедини 2 скрипта ниже в 1 скрипт. local UIS = game:GetService('UserInputService') local Character = game.Players.LocalPlayer.Character local Humanoid = Character:WaitForChild('Humanoid') local Animations = Instance.new('Configuration', Character) local TweenService = game:GetService("TweenService") local CameraInfo = TweenInfo.new( 0.3, Enum.EasingStyle.Quint,
Enum.EasingDirection.Out,
0,
false,
0
)local CrouchedGoal = {CameraOffset = Vector3.new(Humanoid.CameraOffset.X,-1.9,Humanoid.CameraOffset.Z)} local UncrouchedGoal = {CameraOffset = Vector3.new(Humanoid.CameraOffset.X,0,Humanoid.CameraOffset.Z)}
local CrouchedTween = TweenService:Create(Humanoid, CameraInfo, CrouchedGoal) local UncrouchedTween = TweenService:Create(Humanoid, CameraInfo, UncrouchedGoal) if Humanoid.RigType == Enum.HumanoidRigType.R15 then Animations.Name = 'Animations2' local CrouchAnimation = Instance.new('Animation', Animations) CrouchAnimation.AnimationId = script.R15.Animation.AnimationId --your animation here CrouchAnimation.Name = 'CrouchAnimation' local LoadCrouchAnimation = Humanoid:LoadAnimation(CrouchAnimation) LoadCrouchAnimation.Looped = true UIS.InputBegan:Connect(function(Input) if Input.KeyCode == Enum.KeyCode.LeftControl and Humanoid.WalkSpeed < 15 then if Humanoid.Health > 0 then Humanoid.WalkSpeed = 8 -- Crouch speed script.Crouching.Value = true CrouchedTween:Play() Character.HumanoidRootPart.Running.PlaybackSpeed = 0.70 LoadCrouchAnimation:Play()
codewhile wait() do for i, v in pairs(game.Workspace["Forgetten Realms"]:GetDescendants()) do if v.Name == "Crouchpart" then if script.Crouching.Value == true then v.CanCollide = false else v.CanCollide = true end end end if Humanoid.MoveDirection.Magnitude > 0 then LoadCrouchAnimation:AdjustSpeed(0.7) --<<<You can use LoadCrouchAnimation:AdjustSpeed(1) too. else LoadCrouchAnimation:AdjustSpeed(0) end end end end end) UIS.InputEnded:Connect(function(Input) if Input.KeyCode == Enum.KeyCode.LeftControl and Humanoid.WalkSpeed < 15 then script.Crouching.Value = false UncrouchedTween:Play() LoadCrouchAnimation:Stop() Character.HumanoidRootPart.Running.PlaybackSpeed = 1 Humanoid.WalkSpeed = 14-- walk speed end end) - Assistant