Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My gui is not enabling on tablet devices, why?

Asked by 3 years ago

I made a script to check if a player is on mobile, pc or tablet. The Pc works fine, so does the mobile, but the tablet does not.

My script:

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

if UIS.TouchEnabled and not UIS.KeyboardEnabled and not UIS.MouseEnabled then
    if not GuiService:IsTenFootInterface() then
        script.Parent.PcandtabletMenu.Enabled = false
    end
else
    script.Parent.PcandtabletMenu.Enabled = true
end

It does not show on tablet devices but does on pc.

Answer this question