local sWidth, sHeight = guiGetScreenSize()
local windowX, windowY = 500, 450
local pX, pY = (sWidth/2)-(windowX/2), (sHeight/2)-(windowY/2)
--Lets say you want to create a button in the center of the window:
local X, Y = 150, 25
local pX, pY = (windowX/2)-(X/2), (windowY/2)-(Y/2)
Try to understand it because I can't explain it in English.