How to convert number to integer?

Try using a LocalScript. Scripts run on the server, and the server has no knowledge of a player’s screen size info. The absolute size of a gui element will, of course, depend on the resolution it is displayed on.

But I printed out the variable and it said 1050, so it does know the absolute size of the gui element.

Just try using a local script, ok? Scripts shouldn’t even belong in gui in the first place.

1 Like

Tried it and still doesn’t work. I know scripts don’t belong in gui with FE, but my game doesn’t have FE

I’ve got some other things I’d like you to try:

  1. Print AbsY. Is it the value you expect?
  2. Remove the if-statement. Does the size get updated appropriately? (You could try doing print (AbsX, AbsX*1.78, AbsY) right before the if-statement for a good diagnosis)
  3. Could you try adding a small wait() at the beginning of the script? I have a feeling that the absolute size isn’t updated immediately the moment the gui is cloned to the player.
2 Likes

You are right, it wasn’t updated until after the gui is already cloned to the player.

If @XAXA’s answer fixed your problem, mark it as the solution :slight_smile:

1 Like