local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local char = player.CharacterAdded:Wait()
local hum = char.Humanoid
local animation = Instance.new("Animation", player.Character)
animation.AnimationId = "rbxassetid://05107306531"
animation.Priority = Enum.AnimationPriority.Movement
mouse.KeyDown:Connect(function(key)
if key:lower() == "c" then
hum:LoadAnimation(animation)
animation:Play()
end
end)
mouse.KeyUp:Connect(function(key)
if key:lower() == "c" then
hum:LoadAnimation(animation)
animation:Play()
end
end)
I put this local script I made in StarterCharacterScripts. Some stuff here I learnt with tutorials. If you spot anything please tell me!

5 comments
is it a LocalScript?
Also, did you intend for the player to hold C or press C to toggle crouching?
I do not recommend using mouse.Keydown. Use UserInputService instead.
Main reason why is because mouse.Keydown is not what roblox intends for you to do anymore, just like _G is replaced with module scripts. Use InputBegan and Enum.KeyCode
@Davy I wouldn't say _G has been replaced with ModuleScripts. _G is much quicker for simpler things like a single variable that you want to share between scripts. It's easier using _G for a variable as opposed to a ModuleScript.