Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by
nicros 165
9 years ago

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

Log in to vote
1
Answered by 9 years ago

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
0
:) thanks hehe, and sorry, didnt know there was a difference between LUA and Lua nicros 165 — 9y
Ad

Answer this question