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

[CLOSED] How do I get specific Gui Position values?

Asked by 10 years ago

I'm scripting an Open Options Gui, and I wanted to test making it scroll in, so I wrote this code:

local OptionsBG = script.Parent.Parent.Parent.OptionsBG

function open()
script.Parent.Parent.Parent.OptionsBG.Visible = true
 repeat wait(0.1)
    OptionsBG.PositionX = PositionX - 1
    until OptionsBG.PositionX == 60
end

script.Parent.MouseButton1Down:connect(open)

I'm just not sure how to get the specific values of the Gui. I guessed PositionX but I don't think that's right, I'm looking for this value: {0, 60 (<--THIS VALUE)}, {0, 0}

1 answer

Log in to vote
0
Answered by 10 years ago

Firstly, I would recommend Tweening for positioning, Search the wiki

Secondly, GUI Positions are UDIM2's, In brackets, you position the Gui as follows: script.Parent.Position = UDim2.new(X's Scale , X's Offset , Y's Scale, Y's Offset)

0
Then how would I use UDim2 to do what I attempted in the code I put? Like, Position.XOffset = UDim2.new or what? SlickPwner 534 — 10y
Ad

Answer this question