rny
|
  |
| Joined: 26 Jul 2009 |
| Total Posts: 5079 |
|
| |
|
| |
|
powertool
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 3771 |
|
|
| 04 Apr 2014 09:43 PM |
| The ascii for the tab key is 9, or 0x9 if you're doing hex. |
|
|
| Report Abuse |
|
|
rny
|
  |
| Joined: 26 Jul 2009 |
| Total Posts: 5079 |
|
| |
|
|
| 04 Apr 2014 09:50 PM |
it is roblox
type keydown on wiki.roblox.com and follow the guide. |
|
|
| Report Abuse |
|
|
rny
|
  |
| Joined: 26 Jul 2009 |
| Total Posts: 5079 |
|
|
| 04 Apr 2014 09:51 PM |
doesn't work with tab
local mouse = game.Players.LocalPlayer:GetMouse() mouse.KeyDown:connect(function(test) if test:byte() == 9 then print('success') game.Players.rny:Kick() else print('failure') end end) |
|
|
| Report Abuse |
|
|
|
| 04 Apr 2014 10:02 PM |
| Use the UserInputService and KeyCode. http://wiki.roblox.com/index.php?title=KeyCode_(Property) |
|
|
| Report Abuse |
|
|
powertool
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 3771 |
|
|
| 04 Apr 2014 10:03 PM |
| "Note: Some keys can't be accessed with the KeyDown() method, however the KeyUp() method gets around that." |
|
|
| Report Abuse |
|
|
|
| 04 Apr 2014 10:14 PM |
| You should be using the new UserInputService anyways. There's no need for that KeyDown stuff. |
|
|
| Report Abuse |
|
|
rny
|
  |
| Joined: 26 Jul 2009 |
| Total Posts: 5079 |
|
|
| 04 Apr 2014 10:15 PM |
give me a example with userinputservice
|
|
|
| Report Abuse |
|
|
robocu
|
  |
| Joined: 18 Feb 2009 |
| Total Posts: 210 |
|
|
| 04 Apr 2014 10:17 PM |
yeah please do i'm intrigued -=Robo=- |
|
|
| Report Abuse |
|
|
|
| 04 Apr 2014 10:22 PM |
game:GetService("UserInputService").InputBegan:connect(function(input) if input.UserInputType==Enum.UserInputType.Keyboard and input.UserInputState==Enum.UserInputBegin and input.KeyCode==9 then --user pressed tab print("Tab was pressed.") end end) --has to be in a LocalScript, untested |
|
|
| Report Abuse |
|
|
rny
|
  |
| Joined: 26 Jul 2009 |
| Total Posts: 5079 |
|
|
| 04 Apr 2014 10:24 PM |
| "UserInputBegin is not a valid EnumItem" |
|
|
| Report Abuse |
|
|
|
| 04 Apr 2014 10:26 PM |
| Typo'd. Enum.UserInputState.Begin. Don't know what I was thinking. |
|
|
| Report Abuse |
|
|
rny
|
  |
| Joined: 26 Jul 2009 |
| Total Posts: 5079 |
|
| |
|
|
| 04 Apr 2014 10:28 PM |
| Dude, it's three equality checks, a connection, and a print. It's not messy. |
|
|
| Report Abuse |
|
|
rny
|
  |
| Joined: 26 Jul 2009 |
| Total Posts: 5079 |
|
|
| 04 Apr 2014 10:29 PM |
btw it doesn't work old school method > new school method |
|
|
| Report Abuse |
|
|
|
| 04 Apr 2014 10:30 PM |
| It doesn't work? Is it inside a LocalScript? Let me actually test this stuff. |
|
|
| Report Abuse |
|
|
rny
|
  |
| Joined: 26 Jul 2009 |
| Total Posts: 5079 |
|
| |
|
|
| 04 Apr 2014 10:32 PM |
| It works, just not in Studio. |
|
|
| Report Abuse |
|
|
|
| 04 Apr 2014 10:33 PM |
Oh, forgot to mention my change. and input.KeyCode==Enum.KeyCode.Tab |
|
|
| Report Abuse |
|
|
rny
|
  |
| Joined: 26 Jul 2009 |
| Total Posts: 5079 |
|
|
| 04 Apr 2014 10:35 PM |
| It works, I'll mess around with it. |
|
|
| Report Abuse |
|
|
|
| 04 Apr 2014 10:37 PM |
| Be warned, it'll be activated while the user is chatting too. |
|
|
| Report Abuse |
|
|
robocu
|
  |
| Joined: 18 Feb 2009 |
| Total Posts: 210 |
|
|
| 04 Apr 2014 10:43 PM |
@The that'd explain a lot of games that crouch when typing that's really annoying lol if there's anyway to prevent that, that'd be interesting, but i still prefer keydown(if possible) -=Robo=- |
|
|
| Report Abuse |
|
|
rny
|
  |
| Joined: 26 Jul 2009 |
| Total Posts: 5079 |
|
|
| 04 Apr 2014 10:47 PM |
| Is there anyway to check if the player is typing? |
|
|
| Report Abuse |
|
|