|
| 31 Jan 2013 05:16 PM |
local player = game.Players.LocalPlayer; player:GetMouse().KeyDown:connect(function (key) if key:hold() == "Shift" then player.Character.Walkspeed = 19 end end)
I tryed to make like a run script, as you can see it didnt work out.. I wanted it to do like if someone holds down Shift then they will start to run When they let go it will go back to 16 I am not a very Good scripter, please help! |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2013 05:19 PM |
local player = game.Players.LocalPlayer; player:GetMouse().KeyDown:connect(function (key) if key == "Shift" then player.Character.Walkspeed = 19 end end) player:GetMouse().KeyUp:connect(function (key) if key == "Shift" then player.Character.Walkspeed = 16 end end) |
|
|
| Report Abuse |
|
|
Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 31 Jan 2013 05:20 PM |
local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse()
Mouse.KeyDown:connect(function(Key) if Key:byte() == 48 then Player.Character.Humanoid.Walkspeed = 19; end end
Mouse.KeyUp:connect(function(Key) if Key:byte() == 48 then Player.Character.Humanoid.Walkspeed = 16; end end |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2013 05:23 PM |
| @Quenty, you should also include :byte() == 47, that also represents shift. |
|
|
| Report Abuse |
|
|
Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 31 Jan 2013 05:26 PM |
True. I recently posted this list (Like, 1 hour ago)
http://www.roblox.com/Forum/ShowPost.aspx?PostID=88198480
For the script I was writing that uses it. :) |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2013 05:31 PM |
Nothing worked :/ I tryed em both, and edited em to when they first did'nt work. |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2013 05:37 PM |
Got it nvm
local mouse = game.Players.LocalPlayer:GetMouse() mouse.KeyDown:connect(function (key) for i, v in pairs(game.Players:GetChildren()) do if key == "q" then v.Character.Humanoid.WalkSpeed = 25 print("Walkspeed = 25") end mouse.KeyUp:connect(function (key) if key == "q" then v.Character.Humanoid.WalkSpeed = 16 print("Walkspeed = 16") end end) end end)
|
|
|
| Report Abuse |
|
|
Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 31 Jan 2013 05:39 PM |
| Lol. We forgot ending ), and key:byte() was probably wrong. |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2014 12:16 AM |
| I dont get it. what is byte? |
|
|
| Report Abuse |
|
|
dodleman
|
  |
| Joined: 22 Dec 2007 |
| Total Posts: 1118 |
|
|
| 08 Feb 2014 12:17 AM |
Dude this post is over a year old, just post a new thread instead of bumping one idiot.
Life is potatoes to me |
|
|
| Report Abuse |
|
|
Scumbob
|
  |
| Joined: 13 Oct 2012 |
| Total Posts: 342 |
|
| |
|