|
| 10 Jun 2017 04:17 PM |
I'm fairly new to ROBLOX Lua. I'm attempting to make a script that increases the users walk speed. I put a local script in the starter pack and typed this ------------------------------------------------- repeat wait() until game.Players.LocalPlayer local mouse = game.Players.LocalPlayer:GetMouse() local player = game.Players.LocalPlayer
mouse.KeyDown:connect(function(keydown) if KeyDown == "0" then player.Character.Humanoid.WalkSpeed = 50 end end)
mouse.KeyUp:connect(function(KeyUp) if KeyUp == "0" then player.Character.Humanoid.WalkSpeed = 16 end end) ------------------------------------------------------------ Anyone know what's wrong? Thanks.
But what if you both cry? ¯\_(ツ)_/¯ |
|
|
| Report Abuse |
|
|
Mindmixer
|
  |
| Joined: 05 Jul 2011 |
| Total Posts: 1878 |
|
| |
|
|
| 10 Jun 2017 04:27 PM |
I'm not seeing any.
But what if you both cry? ¯\_(ツ)_/¯ |
|
|
| Report Abuse |
|
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 10 Jun 2017 04:45 PM |
| Don't user KeyboardInput use UserInputService or ContextActionService |
|
|
| Report Abuse |
|
|
|
| 10 Jun 2017 04:46 PM |
also u dont have to do the repeat wait thing the local player has to exist before local scripts can run |
|
|
| Report Abuse |
|
|