I’m working on a new choose your own adventure story, and I want to make it where when you load into the game, and you are greeted with an old 80’s computer boot up screen. So I was making it where at one point in the boot-up when it reaches the part where it says “USB Device(s):”, then, if you are playing with a touch screen then it says “1 touchscreen”, and if you aren’t playing with a touch screen, it says “1 keyboard and 1 mouse(and/or) 1 controller”.
When I try it in the emulator within Roblox Studio, it works. But when I go to play on mobile in Roblox it says “1 keyboard and 1 mouse(and/or) 1 controller”.
These errors kept popping up saying
" Players.anderdees4857743754.PlayerGui.ScreenGui.Frame.TextLabel.Script:30: Expected ‘end’ (to close ‘function’ at line 1), got ; did you forget to close ‘then’ at line 27?", which I discovered that this error popped up here because it needed 2 ends instead of 1.
if 'mobile' then
_G.GS = " 1 touch screen, 1 Storage device, 1 Hub"
end
Then I changed it to this…
if 'mobile' then
_G.GS = " 1 touch screen, 1 Storage device, 1 Hub"
end
end
The error went away. I looked around on dev forum, but I couldn’t find anything that could help me. Now for this I’m using 2 scripts. Here’s the first one:
function TabletOrPhone()
if game:GetService('UserInputService').TouchEnabled == false then
print 'Computer'
else
function TabletOrPhone()
if game:GetService('UserInputService').TouchEnabled == true then
print 'mobile'
end
end
if 'mobile' then
_G.GS = " 1 touch screen, 1 Storage device, 1 Hub"
end
end
if 'Computer' then
_G.GS = " 1 keyboard, 1 Storage device, 1 Hub"
end
end
Now the second script is way to long. I know I’ll prob get replies saying that there is much simpler and easier way to write it, but this is the way I prefer to write it. Anyways, here’s the script:
Here’s a link to the game so far: computer? - Roblox
Finally, here’s a link to the video with a boot up screen that I based my design off of: Old Computer Boot Up Screen - YouTube