local x, y = guiGetScreenSize ()
local guiWidth, guiHeight = 500, 400
local centerX, centerY = (x / 2) - (guiWidth / 2), (y / 2) - (guiHeight / 2)
this is pretty elementary lol, you get the half of the screen total width, and subtract it with the half of the guiWidth. If we didn't do the latter, the GUI's top left corner would be the centre instead.