I want to make it so when i press shift then i start running?
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character.Humanoid
local mouse = player:GetMouse()
local origSpeed = humanoid.WalkSpeed
local runSpeed = 100 --modify this value to be the speed you want when running
mouse.KeyDown:connect(function(key)
if key:lower() == "LeftShift" then
humanoid.WalkSpeed = runSpeed
end
end)
1 | mouse.KeyUp:connect( function (key) |
2 | if key:lower() = = "LeftShift" then |
3 | humanoid.WalkSpeed = origSpeed |
I want to make it so when I press shift I start running but idk the shift key in lua