Keltrin
|
  |
| Joined: 01 Jan 2014 |
| Total Posts: 2085 |
|
| |
|
Keltrin
|
  |
| Joined: 01 Jan 2014 |
| Total Posts: 2085 |
|
|
| 28 Jun 2015 03:03 PM |
| NO ONE knows how to check if the shift key is being pressed? |
|
|
| Report Abuse |
|
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
|
| 28 Jun 2015 03:04 PM |
local plr = game.Players.LocalPlayer local mouse = plr:GetMouse()
mouse.KeyDown:connect(function(button) if string.byte(button) == 14 or string.byte(button) == 15 then print("Shift clicked") end end)
must be a local script
-Baheeg |
|
|
| Report Abuse |
|
|
IRyan70
|
  |
| Joined: 08 Jun 2011 |
| Total Posts: 484 |
|
|
| 28 Jun 2015 03:07 PM |
| Thanks! I actually needed this, ill be sure to give credit :) |
|
|
| Report Abuse |
|
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
Keltrin
|
  |
| Joined: 01 Jan 2014 |
| Total Posts: 2085 |
|
|
| 28 Jun 2015 03:07 PM |
| That didn't work, no output and nothing printed. |
|
|
| Report Abuse |
|
|
IRyan70
|
  |
| Joined: 08 Jun 2011 |
| Total Posts: 484 |
|
|
| 28 Jun 2015 03:11 PM |
| Cant Confirm if it works, havent tested.. |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2015 03:15 PM |
local UserInputService = game:GetService("UserInputService")
local shiftDown = false
UserInputService.InputBegan:connect( function(input, gameProcessedEvent) if not gameProcessedEvent then if input.KeyCode == Enum.KeyCode.LeftShift then shiftDown = true end end end )
UserInputService.InputEnded:connect( function(input, gameProcessedEvent) if not gameProcessedEvent then if input.KeyCode == Enum.KeyCode.LeftShift then shiftDown = false end end end ) |
|
|
| Report Abuse |
|
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
|
| 28 Jun 2015 03:21 PM |
it doesnt work for some reason
-Baheeg |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2015 03:21 PM |
i love how you post and within 6 minutes you are guessing nobody knows... pls |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2015 03:22 PM |
| game:GetService("UserInputService"):IsKeyDown(Enum.KeyCode.LeftShift) |
|
|
| Report Abuse |
|
|
IRyan70
|
  |
| Joined: 08 Jun 2011 |
| Total Posts: 484 |
|
|
| 28 Jun 2015 03:27 PM |
| Epicbreakers's seems alot easier...doesnt it work the same as the one above? |
|
|
| Report Abuse |
|
|
| |
|
|
| 28 Jun 2015 03:42 PM |
| haha I had no idea that you could simplify it to that :P |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2015 03:50 PM |
| You can also do UserInputService::GetKeysPressed() to get an array of all keys pressed. |
|
|
| Report Abuse |
|
|
|
| 28 Jun 2015 03:54 PM |
| wow userinputservice is probably my favorite service now |
|
|
| Report Abuse |
|
|