Advertisement
EconomicSerg

ROBLOX UserInputService

Oct 13th, 2020 (edited)
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. local UIS = game:GetService("UserInputService") --Instead of "UIS" you could also say "UserInputService"
  2.  
  3. UIS.InputBegan:Connect(function(key)
  4.     if key.KeyCode == Enum.KeyCode.F then --You could use any other key on the keyboard other than "F"
  5.         print("F") -- It doesn't have to be a print. You could make it do whatever!
  6.     end
  7. end)
  8.  
  9. -- This is just an example of UserInputService. Don't use this exact code for an actual game, unless your just using "print("")" to test that it works! :D
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement