|
| 15 Jan 2015 01:24 PM |
Hey,
I want to know how you can check if a player is on tablet, or PC. |
|
|
| Report Abuse |
|
|
|
| 15 Jan 2015 01:25 PM |
| Check if they have a keyboard with UserInputService. |
|
|
| Report Abuse |
|
|
|
| 15 Jan 2015 01:29 PM |
Here's one way to do it:
local UIS = game:GetService("UserInputService")
local isMobile = not UIS.KeyboardEnabled and not UIS.MouseEnabled
if (isMobile) then print("Mobile") else print("Not mobile") end
'isMobile' evaluates as true only if the user does not have a keyboard nor a mouse. Another thing you could do is swap out the 'not MouseEnabled' part with simply 'TouchEnabled' to make sure that they in fact have a touch screen device too. |
|
|
| Report Abuse |
|
|
|
| 15 Jan 2015 01:31 PM |
@crazy
Yeah, thanks for that - Really helped :) |
|
|
| Report Abuse |
|
|
|
| 15 Jan 2015 02:15 PM |
UserInputService.TouchEnabled okay
logic is logical |
|
|
| Report Abuse |
|
|