Advertisement
Null_Cat

ContextActionService Check Example

Jul 21st, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. --Grab the Services for UIS and CAS
  2. local uIS = game:service'UserInputService'
  3. local CAS = game:service'ContextActionService'
  4.  
  5. --Check if the user is on a Computer or on a Phone/Tablet
  6. local mobileCheck
  7. if uIS.TouchEnabled and not uIS.KeyboardEnabled then
  8.     mobileCheck = true
  9.     else
  10.     mobileCheck = false
  11. end
  12.  
  13. if mobileCheck then
  14.     --Use ContextActionService:BindAction
  15. elseif not mobileCheck then
  16.     --Use UserInputService:InputBegan
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement