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

How would i Change position of a gui on click of a button?

So ive got bar at the bottom of my game and i want it to have a button on each side and when clicked it moves the bar to that side by 20 pixels.....and im sorry if this is a noob question, but im a big noob at LUA :P, how would i go about doing this?

I have this button

function die()
script.Parent.Parent.TestMovePos. --this is where i think im stuck at
end 
script.Parent.MouseButton1Down:connect(die)

idk but i hope its as simple as finishing that line...but im not sure.

If somone could guide me to how to do this that would be awesome :)

1 answer

✓ Accepted answer

First off, it's "Lua", not "LUA".

Second off, here's what you need to learn.

To move the position of a gui nice and smoothly, you can learn tweening. Tweening allows you to smoothly transition Guis to the designated position. Otherwise, you can just use

YourGuiNameHere.Position = YourGuiNameHere.Position + AmountYouWantToAdd

1 comment

0

:) thanks hehe, and sorry, didnt know there was a difference between LUA and Lua

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