I know getting the AbsoluteSize
of a ScreenGui
inside the player's PlayerGui
can achieve this, but what if you need to get the size of the screen, without relying on a GUI's AbsoluteSize property? Is there any other way to do this?
You can get the screen size through the ViewSizeX
and ViewSizeY
properties of the player's mouse.
Here's an example:
local player = game.Players.LocalPlayer local mouse = player:GetMouse() mouse.Button1Down:connect(function() print(mouse.ViewSizeX .."x" ..mouse.ViewSizeY) end)
Assuming the size of the game window is 800x600, this would print:
800x600
Keep in mind, this represents the size of the game window, not the necessarily the full screen. Hope this helped.