Help with gui collision math

I suggest u check this out. If it doesn’t work pls reply or dm me presonally.