Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to check if player is playing on phone?

Hello, I am wondering on how to check if the player is playing on phone, not tablet or console or pc?

1 answer

You would use this code:

local UIS = game:GetService("UserInputService")
local GuiService = game:GetService("GuiService")

if UIS.TouchEnabled and not UIS.KeyboardEnabled and not UIS.MouseEnabled
   and not UIS.GamepadEnabled and not GuiService:IsTenFootInterface() then

   -- mobile device

end

Hope it helps.

3 comments

0

I am saying only phone, not others like tablet

0

Edited my answer.

0

I know 100% you don't need this no longer and sorry for this bump. But this is for those who still need it.

This discussion is preserved as it was. New answers, comments, and votes are closed.