local player = game.Players.LocalPlayer
local humanoid = player.Character.Humanoid
local UserInputService = game:GetService("UserInputService")
local anim = Instance.new("Animation")
anim.AnimationId = "5351326151"
local LeftControl = Enum.KeyCode.LeftControl
local function LeftControlDown()
if UserInputService:IsKeyDown(LeftControl) then
local PlayAnim = humanoid:LoadAnimation(anim)
PlayAnim:Play()
end
end
Basically I am trying to replicate the Minecraft sneak mechanic where when you hold down a key it plays the crouching animation, and when you release it then you return to a stand animation. Any help would be greatly appreciated.

2 comments
this script works without any errors, but when I hold down the key it doesnt stay in the crouching position
Then there might be a problem with the animation, check if it loops.