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

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

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

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)

1 comment

0

Then how would I use UDim2 to do what I attempted in the code I put? Like, Position.XOffset = UDim2.new or what?

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