Since Keyboard Input is deprecated, how would you use UserInputService to see if someone has pressed /?
You can use InputBegan event.
1 | game:GetService( "UserInputService" ).InputBegan:connect( function (input,proc) |
2 | if not proc and input.KeyCode = = Enum.KeyCode.Slash then |
3 | --code |
4 | end |
5 | end ) |
'proc' is a variable that prevents input from getting accessed while typing in chat and similar.
For more information, check out these:
http://wiki.roblox.com/index.php?title=API:Class/UserInputService http://wiki.roblox.com/index.php?title=API:Class/InputObject http://wiki.roblox.com/index.php?title=API:Enum/KeyCode