I want to have a GUI run mobile ads to award players points but there's no point in having a PC player's screen's being taken up by an essentially useless GUI. Any way to detect if the local player is using a touchscreen tablet/phone?
You can use the UserInputService, here's an example.
Here's how to detect if its mobile
(LocalScript)
--Made by ElmEditor --To answer question on scriptinghelpers.org game:GetService("UserInputService").KeyboardEnabled==false and game:GetService("UserInputService").TouchEnabled==true then --If there is no keyboard but a touch device print 'Mobile' elseif game:GetService("UserInputService").KeyboardEnabled==true and game:GetService("UserInputService").TouchEnabled==false then --No touch device but a keyboard print 'Computer/Laptop' else --If its not Computer/Laptop or Mobile print 'Xbox or other' --It'd be Xbox end --Must be localscript
Note: If somebody is playing on a gamepad and keyboard is enabled it'd print "Computer/Laptop", but if they are playing on Gamepad w/ Touch Device it'd print Mobile. You can add other detections if you'd like.
Hope this helps, if it did press that ^ button; it helps alot!
-ElmEditor