Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

GUI moving all over the screen?

--It goes
While true do
game.startGUI.box1.position=(5, 5, 5)
wait(.01)
game.startGUI.box1.position=(6, 6, 6)
end

Is this right or did it say something wrong?

1 comment

0

Yes the 5 and 6 location is not correct but it is for examples.

1 answer

✓ Accepted answer

There are a multitude of syntactical and functional mistakes in what you have written, namely:

  1. While should be lower case, as in "while"
  2. position should be upper case, as in "Position"
  3. The Position property of a GUI Object takes a UDim2 object as input, and a Part takes a Vector3 - I can't tell which you need to use from this code because I don't know what box1 is.
  4. startGUI is not a valid member of game, it doesn't exist, the actual name is StarterGui
  5. The wait() function will only yield the thread (stop that script from running) for a minimum of 1/30th of a second, approximately 0.033, which is bigger than .01, so it will actually wait for 1/30th of a second instead of 1/100th.

A side note is that this script doesn't make any sense whatsoever: If box1 is a GUI Object then why would you be using 3 coordinates to describe it's position (user interfaces in Roblox are 2 dimensional), and if it is actually a 3D Part, why is it being stored in the game's StarterGui, which is for GUI objects.

FURTHERMORE, changing the position of a GUI Object in the StarterGui affects the template that is used to copy the GUI to each player, and not the Player's GUIs themselves, so even with a working script to change the position of box1 nobody would see it moving.

This discussion is preserved as it was. New answers, comments, and votes are closed.