local UserInputService = game:GetService("UserInputService")
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local crawlAnim = humanoid:LoadAnimation(script:WaitForChild("CrawlAnim"))
local isCrawling = false
humanoid.Running:Connect(function(speed)
if speed > 0 then
crawlAnim:AdjustSpeed(1)
else
crawlAnim:AdjustSpeed(0)
end
end)
UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
if not isCrawling then
isCrawling = true
crawlAnim:Play()
crawlAnim:AdjustSpeed(0)
humanoid.WalkSpeed = 8
humanoid.JumpPower = 0
else
crawlAnim:Stop()
humanoid.WalkSpeed = 16
humanoid.JumpPower = 50
isCrawling = false
end
end
end)
also it has an animation inside of it called “CrawlAnim”