Open Source Universal GetDevice
Key RequiredUniversal

Open Source Universal GetDevice

Universal ScriptCMDSCMDS 11.2K views 21 executesUpdated Feb 4, 2024
Unrated
00
Lua Script•18 lines (523 chars)
local GuiService = game:GetService("GuiService")

local UserInputService = game:GetService("UserInputService")

local function GetDevice()
    if (GuiService:IsTenFootInterface()) then
        return "Console"
    elseif (UserInputService.TouchEnabled and not UserInputService.MouseEnabled) then
        local DeviceSize = workspace.CurrentCamera.ViewportSize
        if (DeviceSize.Y >= 600) then
            return "Tablet"
        else
            return "Phone"
        end
    else
        return "Desktop"
    end
end

Features & Information

code for your scripts and things (made by PawsThePaw)
#Universal#Code

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts