While typing my crouch script activates, any way around this as its annoying and needs to be fixed?
crawling = false
local humanoid = script.Parent.Humanoid
crawlAnim = nil
crawlAnimIdle = nil
game:GetService("UserInputService").InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.C then
if crawling == true then
crawling = false
crawlAnim:Stop()
crawlAnim:Destroy()
crawlAnimIdle:Stop()
crawlAnimIdle:Destroy()
humanoid.WalkSpeed = humanoid.WalkSpeed*2
humanoid.Parent.Head.Running.PlaybackSpeed = 1.85
else
crawling = true
crawlAnim = humanoid:LoadAnimation(script.CrawlAnim)
crawlAnimIdle = humanoid:LoadAnimation(script.CrawlAnimIdle)
humanoid.WalkSpeed = humanoid.WalkSpeed/2
humanoid.Parent.Head.Running.PlaybackSpeed = 1
end
end
end)
while wait()do
if crawling == true then
crawlAnim:AdjustSpeed(humanoid.WalkSpeed/8)
if humanoid.MoveDirection ~= Vector3.new(0,0,0)then
if crawlAnim.IsPlaying ~= true then
crawlAnim:Play()
end
else
crawlAnim:Stop()
crawlAnimIdle:Play()
end
end
end

2 comments
if not UIS:GetFocusedTextBox() then
This doesn't work? Any help?