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: Tablet and Desktop GUIs - Scripting Help

Previous Thread :: Next Thread 
AwesomeMe003 is not online. AwesomeMe003
Joined: 23 Feb 2016
Total Posts: 86
27 Feb 2017 07:02 AM
The other day I was scripting my new game, and I thought to myself, wouldn't it be smart to make it so the tablet has its own GUI setup? I started to make the GUIs, but then I realized, how do I make all of the GUIs show up only on the Tablet, and the Desktop GUIs only show up while using a Desktop?

So, if anyone has a script to enable a GUI if the player is using a certain device, please copy and paste it into a reply to this thread.

Thanks!
Report Abuse
Disillusions is not online. Disillusions
Joined: 10 Jul 2011
Total Posts: 6365
27 Feb 2017 07:06 AM
UserInputService.TouchEnabled is best guess


Report Abuse
iiFylth is not online. iiFylth
Joined: 17 Sep 2014
Total Posts: 140
27 Feb 2017 07:09 AM
If UserInputService.TouchEnabled then
--code here(for tablet)
else
--code here (shows the gui for desktop)
end
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
27 Feb 2017 07:09 AM
You could check the 'TouchEnabled' property of UserInputService to decide whether or not the client is on mobile.


Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
27 Feb 2017 07:10 AM
lol ninja'd twice while wiki'ing


Report Abuse
AwesomeMe003 is not online. AwesomeMe003
Joined: 23 Feb 2016
Total Posts: 86
27 Feb 2017 07:21 AM
Thank you all. I'm going to see if the scripts that you guys gave me work. Also, thank you so much for responding so quickly!
Report Abuse
AwesomeMe003 is not online. AwesomeMe003
Joined: 23 Feb 2016
Total Posts: 86
27 Feb 2017 07:21 AM
Although, where do I put the script and what type of script?
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
27 Feb 2017 08:03 AM
LocalScript in somewhere that replicates to the client

StarterPlayerScripts, StarterCharacterScripts, StarterGui, StarterPack


Report Abuse
AwesomeMe003 is not online. AwesomeMe003
Joined: 23 Feb 2016
Total Posts: 86
27 Feb 2017 02:42 PM
I put it in all of those, and it wasn't working. UserInputService is marked red by the coding program. Any ideas why?
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
27 Feb 2017 02:43 PM
Do what MM2 does and prompt the user for the device they are on
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
27 Feb 2017 02:44 PM
to differentiate between a phone and a tablet
Report Abuse
AwesomeMe003 is not online. AwesomeMe003
Joined: 23 Feb 2016
Total Posts: 86
27 Feb 2017 02:48 PM
Thats what I'm trying to do, but i don't know how.
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
27 Feb 2017 02:49 PM
"prompt the user"

Ask them.

Create 2 gui button, phone and tablet with a text label asking them which device they are on
Report Abuse
AwesomeMe003 is not online. AwesomeMe003
Joined: 23 Feb 2016
Total Posts: 86
27 Feb 2017 02:51 PM
Well i know how to do that. I want to know how to make the window for tablet / ##### appear only on those devices, and not the desktop.
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
27 Feb 2017 02:52 PM
If UserInputService.TouchEnabled then
--display the prompt
else
--nowt
end
Report Abuse
AwesomeMe003 is not online. AwesomeMe003
Joined: 23 Feb 2016
Total Posts: 86
27 Feb 2017 02:54 PM
It doesn't work. It said "Expected =, got UserInputService"
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
27 Feb 2017 02:55 PM
add this at top

local UserInputService = game:GetService("UserInputService")
Report Abuse
AwesomeMe003 is not online. AwesomeMe003
Joined: 23 Feb 2016
Total Posts: 86
27 Feb 2017 02:57 PM
Still has the same message.
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
27 Feb 2017 03:00 PM
make sure it is in a localscript

if game:GetService("UserInputService").TouchEnabled == true then
--prompt
end
Report Abuse
AwesomeMe003 is not online. AwesomeMe003
Joined: 23 Feb 2016
Total Posts: 86
27 Feb 2017 03:02 PM
Is there a way to turn that into an "If Else" script?
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
27 Feb 2017 03:03 PM
oml im not gonna spoon feed you do it yourself
Report Abuse
AwesomeMe003 is not online. AwesomeMe003
Joined: 23 Feb 2016
Total Posts: 86
27 Feb 2017 03:05 PM
Dude, I'm asking a question. It's part of the original question asked. Look at the top of this forum page!
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
27 Feb 2017 03:05 PM
"turn is into an if else statement" this is simple lmao even a 3 year old could do it
Report Abuse
AwesomeMe003 is not online. AwesomeMe003
Joined: 23 Feb 2016
Total Posts: 86
27 Feb 2017 03:07 PM
Do you just add an else under it or something like that?
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
27 Feb 2017 03:08 PM
yes and put the end under it
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