Answered by
6 years ago Edited 6 years ago
Accept farizarps' answer lol, ours are both basically the same, I didn't include "gameProcessedEvent" because I thought it was pointless if it aint used in a function.
Well to get keybinds, you need a localscript, so the local sound part is already covered. Unless what you mean by that is a sound that is played GLOBALLY (heard by everyone) and not just for the player.
1 | UIS = game:GetService( "UserInputService" ) |
2 | local audio = whereversoundis |
3 | UIS.InputBegan:connect( function (inputObject) |
4 | if inputObject.KeyCode = = Enum.KeyCode.R |
I've never personally ever used keys, so I just copied & rewrote from the wiki:
https://developer.roblox.com/articles/Keyboard-Input-Methods