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

Why wont the Gui show up?

I am making a text button for a game but the text button wont even show up

gameStartGui = Instance.new("ScreenGui")
gameStartGui.Parent = game.StarterGui
gameStartGui.Name = "oneLoadScreen"

lightFire = Instance.new("TextButton")
lightFire.Name = "Light Fire"
lightFire.Text = "Light Fire"
lightFire.FontSize = "Size36"
lightFire.Font = "Arial"
lightFire.Parent = game.StarterGui.oneLoadScreen 
lightFire.Position = {0.95, 0},{0.38, 0}

2 answers

Make Light Fire's variable lf, easier to type. Also, try this

X = Instance.new("X", game.X.X)

3 comments

0

This is building on the previous answer.

0

I will try

0

Wait how does that work?

You need to create this gui in every player's PlayerGui. To do this I loop through all the players using a for loop.

I also noiticed you were not using an UDim2 value for the Position.

Method 1: Using a for loop and manipulating every Gui.

for _,n in pairs(Game.Players:GetPlayers()) do
	gameStartGui = Instance.new("ScreenGui",n.PlayerGui)
	gameStartGui.Name = "oneLoadScreen"
	lightFire = Instance.new("TextButton",gameStartGui)
	lightFire.Name = "Light Fire"
	lightFire.Text = "Light Fire"
	lightFire.FontSize = "Size36"
	lightFire.Font = "Arial"
	lightFire.Position = UDim2.new(0.95, 0,0.38, 0)
end

Method 2: Cloning

gameStartGui = Instance.new("ScreenGui")
gameStartGui.Name = "oneLoadScreen"
lightFire = Instance.new("TextButton",gameStartGui)
lightFire.Name = "Light Fire"
lightFire.Text = "Light Fire"
lightFire.FontSize = "Size36"
lightFire.Font = "Arial"
lightFire.Position = UDim2.new(0.95, 0,0.38, 0)

for _,n in pairs(Game.Players:GetPlayers()) do
	gameStartGui:Clone().Parent = n.PlayerGui
end

3 comments

0

Well yes but there is only one player in at a time but you have given me what i needed i think so thanks :)

0

I have just tested both netather have worker is somthing wrong with my studio?

1

None of them were even in the player gui

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