This is the code: local player = game.Players.LocalPlayer local mouse = player:GetMouse() local Animate local Humanoid = player.Character:FindFirstChild('Humanoid')
mouse.KeyDown:Connect(function(Key)
if Key == "c" then
local Animation = Instance.new("Animation", player.Character)
Animation.AnimationId = "rbxassetid://11900611628"
Animate = Humanoid:LoadAnimation(Animation)
Animate:Play()
wait(5)
end
end)
mouse.KeyUp:Connect(function(Key) if Key == "c" then Animate:Stop() end end). Yes I took it from YT

5 comments
I dont exactly understand what you want..?
My character stands up instead of staying in crouch position
the animation might not work have you tested if the animation makes someone crouch
Stands up instead of staying in crouch? So you want the player to press 'c' to crouch and not hold it?
Even if player holds the C key, the character stands up