#Weird error im getting
13 messages · Page 1 of 1 (latest)
what key ru pressing
send the script
Its alr in the video
input ended should be outside of input began. add a variable to check if input has stopped and use a while loop inside the input began to check for it
Doesn't work
I did try that but it didn't work
send the script as text here
local UIS = game:GetService("UserInputService")
local canAnimRun = true
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:FindFirstChildWhichIsA("Humanoid")
local anim = hum:LoadAnimation(script.RunAnimation)
local anim2 = hum:LoadAnimation(script.CrouchIdle)
local IsRunning = false
if hum then
UIS.InputBegan:Connect(function(input, IsTyping)
if IsTyping then return end
if input.KeyCode == Enum.KeyCode.LeftShift then
hum.WalkSpeed = 28
anim:Play()
IsRunning = true
UIS.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
hum.WalkSpeed = 16
anim:Stop()
IsRunning = false
end
end)
end
end)
UIS.InputBegan:Connect(function(input, IsTyping)
if IsTyping then return end
if IsRunning == true then return end
if input.KeyCode == Enum.KeyCode.C or Enum.KeyCode.LeftControl then
print(input.KeyCode)
hum.WalkSpeed = 6
anim2:Play()
UIS.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftControl or Enum.KeyCode.C then
print(input.KeyCode)
hum.WalkSpeed = 16
anim2:Stop()
end
end)
end
end)
end
Ok i actually fixed it
I had to remove the LeftControl