The_Red
|
  |
| Joined: 23 May 2015 |
| Total Posts: 1287 |
|
|
| 22 Jul 2016 12:41 AM |
| It would really help. Thanks. |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2016 12:43 AM |
game:GetService"UserInputService".InputBegan:connect(function(key, gpe) if key.KeyCode == Enum.KeyCode.Slash and not gpe then --rip end end)
I'm using that for my custom chat ;3
|
|
|
| Report Abuse |
|
|
The_Red
|
  |
| Joined: 23 May 2015 |
| Total Posts: 1287 |
|
|
| 22 Jul 2016 01:19 AM |
| How would I use the IsKeyDown? |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2016 01:22 AM |
http://wiki.roblox.com/index.php?title=API:Class/UserInputService/IsKeyDown
Add 13,000 posts |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2016 01:24 AM |
I know you could check the Enum, but this way is a LOT more user friendly and readable in code.
UIS = game:GetService("UserInputService")
UIS.InputBegan:connect(K) local key = K.KeyCode.Name local UType = K.UserInputType.Name
if UType == "Keyboard" then if key == "A" then print'Pressed A!' end end
end) |
|
|
| Report Abuse |
|
|
The_Red
|
  |
| Joined: 23 May 2015 |
| Total Posts: 1287 |
|
|
| 22 Jul 2016 01:25 AM |
@Nar
Yeah, that's really helpful. |
|
|
| Report Abuse |
|
|