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

Why wont the Gui show up?

Asked by
NRCme 0
9 years ago

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

Log in to vote
0
Answered by 9 years ago

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

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

0
This is building on the previous answer. WolfgangVonPrinz 0 — 9y
0
I will try NRCme 0 — 9y
0
Wait how does that work? NRCme 0 — 9y
Ad
Log in to vote
-1
Answered by 9 years ago

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
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 :) NRCme 0 — 9y
0
I have just tested both netather have worker is somthing wrong with my studio? NRCme 0 — 9y
1
None of them were even in the player gui NRCme 0 — 9y

Answer this question