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

How would I fix the position and or size of this gui to where it will show up on my screen?

I'm trying to make a gui for Script Builder by Voidacity, I've tested the gui on it and it would not show up, the script works, it's just that the gui isn't on my screen. (So it should be both position and size I believe)

I haven't worked on the rest of it yet, because I'm starting on this one so I have an example to work with.

Instance.new("ScreenGui", game.Players.LocalPlayer.PlayerGui)
q = Instance.new("Frame", game.Players.LocalPlayer.PlayerGui.ScreenGui)
o = Instance.new("TextButton", game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame)
r = Instance.new("TextLabel", game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame)
q.Position = UDim2.new(0.5, 0, 0.2, 0)
q.Size = UDim2.new(0, 100, 0, 100)
q.Style = "Custom"
q.Draggable = true
q.Active = true
q.Visible = false

o.Position = UDim2.new(1, 0, 0.2, 0)
o.Size = UDim2.new(0, 250, 0, 50)
o.Style = "Custom"
o.Text = "Execute"
o.Name = "TextButton"

r.Position = UDim2.new(1, 0, 0.2, 0)
r.Size = UDim2.new(0, 250, 0, 200)
r.Text = "--Type text here"
r.BackgroundColor3 = Color3.new(0,170,250)
r.FontSize = "Size14"
r.Name = "TextLabel

2 comments

0

You are setting the X Scale Position of your gui's to 1, therefore the top left corner is positioned off the screen. See http://wiki.roblox.com/index.php?title=The_Fundamentals_of_Scripting_with_GUIs#Manipulating_GUIs

0

Shouldn't be the issue. It's parented to q, which is on the screen. The scale is relative to the parent's object's bounding box.

2 answers

You are turning the gui invisible on line 10, with q.Visible = false

Try this:

Instance.new("ScreenGui", game.Players.LocalPlayer.PlayerGui)
q = Instance.new("Frame", game.Players.LocalPlayer.PlayerGui.ScreenGui)
o = Instance.new("TextButton", game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame)
r = Instance.new("TextLabel", game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame)
q.Position = UDim2.new(0.5, 0, 0.2, 0)
q.Size = UDim2.new(0, 100, 0, 100)
q.Style = "Custom"
q.Draggable = true
q.Active = true
q.Visible = true --Problem is this was on false, now it should be working.

o.Position = UDim2.new(1, 0, 0.2, 0)
o.Size = UDim2.new(0, 250, 0, 50)
o.Style = "Custom"
o.Text = "Execute"
o.Name = "TextButton"

r.Position = UDim2.new(1, 0, 0.2, 0)
r.Size = UDim2.new(0, 250, 0, 200)
r.Text = "--Type text here"
r.BackgroundColor3 = Color3.new(0,170,250)
r.FontSize = "Size14"
r.Name = "TextLabel

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