#Crawling Script

19 messages · Page 1 of 1 (latest)

rancid pike
#
UIS.InputEnded:Connect(function()
        --make the player go back to normal
end)
#

@silk garnet

tulip flintBOT
#

studio** You are now Level 1! **studio

rancid pike
#

You didn

#

you didnt just copy and paste it did you

#
​lua
local UIS = game:GetService("UserInputService")
local char = script.Parent
local hum = char:WaitForChild("Humanoid")
local anim = hum:LoadAnimation(script:WaitForChild("Animation"))
local isCrawling = false

UIS.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.C then
        if not isCrawling then
            hum.WalkSpeed = 4
            isCrawling = true
            anim:Play()
        else
            hum.WalkSpeed = 12
            anim:Stop()
            isCrawling = false
            --Put it here!!!
        end
    end
end)
tulip flintBOT
#

studio** You are now Level 3! **studio

rancid pike
#

tell me if it works

#

Not to "Google it" you, but there's almost certainly a tutorial on how to use UIS to make a press and hold action

#

ah

#

here

#

UserInputService:IsKeyDown()

#

That should work

#

@silk garnet

#

For you it would be UIS:IsKeyDown()

tulip flintBOT
#

studio** You are now Level 2! **studio

rancid pike
#
#

You can try doing:
while UIS:IsKeyDown() do

end

#

Make sure to check for the key though