generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Check if user is on Tablet

Previous Thread :: Next Thread 
DeveloperAlvin is not online. DeveloperAlvin
Joined: 22 Feb 2011
Total Posts: 894
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
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
15 Jan 2015 01:25 PM
Check if they have a keyboard with UserInputService.
Report Abuse
crazyman32 is not online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
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
DeveloperAlvin is not online. DeveloperAlvin
Joined: 22 Feb 2011
Total Posts: 894
15 Jan 2015 01:31 PM
@crazy

Yeah, thanks for that - Really helped :)
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
15 Jan 2015 02:15 PM
UserInputService.TouchEnabled okay

logic is logical
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image