i maked a crouch script and its not working
local UIS = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local Animation = script:WaitForChild("Animation", 10)
local Character = Player.Character or Player.CharacterAdded:Wait()
local crouch = false
local Track = Character:FindFirstChild("Humanoid"):LoadAnimation(Animation)
UIS.InputBegan:Connect(function(Input, GameProcessed)
if Input.KeyCode == Enum.KeyCode.C then
Track.Priority = Enum.AnimationPriority.Movement
if crouch== false then
Track.Looped = true
Track:Play()
crouch= true
end
if crouch== true then
Track:Stop()
crouch = false
end
end
end)