#Weird error im getting

13 messages · Page 1 of 1 (latest)

red shore
celest sierra
red shore
#

None

#

Theres a reason why it says Unknown instead of C

celest sierra
#

send the script

red shore
#

Its alr in the video

celest sierra
#

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

red shore
#

Doesn't work

red shore
celest sierra
red shore
#

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