getCursorPos() contains an X & a Y table, so you have to return those, it also only returns the position on the current viewport (scrollposition), which means if you want to check if the cursor is in a certain position in the entire scene that you need to include the current scrollposition value too.
local pos = { x = (game.ScrollPosition.x + getCursorPos().x), y = (game.ScrollPosition.y + getCursorPos().y) }
if pos.x == 500 and pos.y == 700 then
-- do something
end
Maybe something along the lines of that.