Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I want to make it so when i press shift then i start running?

Asked by 5 years ago

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)

mouse.KeyUp:connect(function(key)
    if key:lower() == "LeftShift" then
        humanoid.WalkSpeed = origSpeed
    end
end)

I want to make it so when I press shift I start running but idk the shift key in lua

0
please add your code between ~~~ ~~~ so that we can properly read it mixgingengerina10 223 — 5y
0
Please search before posting Creacoz 210 — 5y
0
Use the service called UserInputService instead of :GetMouse() and also :connect() is deprecated instead use :Connect() Theswagger66 54 — 5y

Answer this question