So I was watching a youtube tutorial on how to create a shift to sprint script, and I was able to follow everything. But when it came to testing, when I pressed shift all it did was go to shiftlock. But the youtube tutorial didn’t have any shiftlock on their screen, and worked fine on theirs.
The only things I can see that would be wrong are:
You are missing an end in the last conditional.
The “walk” variable is being used wrong. ( You need to watch capital letters )
You used a colon in the wrong place when accessing Players. ( Correct: game.Players )
Fixed Code:
local uis = game:GetService(“UserInputService”)
local player = game.Players.LocalPlayer
local char = workspace:WaitForChild(player.Name)
local walk = 16
local run = 30
uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
char.Humanoid.WalkSpeed = run
end
end)
uis.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
char.Humanoid.WalkSpeed = walk
end
end)