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

GUI Script Not Working?

NewGUI = game.StarterGui Instance.new("Frame")
GUIClosed = false
Frame = game.StarterGui.Frame

if GUIClosed == false then
	NewGUI
end

Frame.Name = "Frame"
Frame.BackgroundColor3 = "255,255,255"
Frame.BackgroundTransparency = "0"
Frame.BorderColor3 = "0,0,0"
Frame.BorderSizePixel = "2"
Frame.Position = "{0,450},{0,10}"
Frame.Size = "{0,100},{0,100}"




Not Working. I Run The Script Then Get Nothing, Please Help!

4 answers

✓ Accepted answer

Actually, there are more issues than previously stated. First off, the GUI must be created in each player's > PlayerGui , not the > StarterGui . Another error, the > Frame will not be visible unless in a > ScreenGui . For example, you can put this in a LocalScript:

local plr = game.Players.LocalPlayer;
local folder = plr.PlayerGui;
local thing = Instance.new("ScreenGui", folder);
local Frame = Instance.new("Frame",thing);
Frame.Name = "Frame";
Frame.BackgroundColor3 = Color3.new(255,255,255);
Frame.BackgroundTransparency = 0;
Frame.BorderColor3 = Color3.new(0,0,0);
Frame.BorderSizePixel = 2;
Frame.Position = UDim2.new(0,450,0,10);
Frame.Size = UDim2,new(0,100,0,100);

I found the error, it's a simple grammar typo.

NewGUI = game.StarterGui Instance.new("Frame")

You didn't put a . between StarterGui and Instance.new

So it should be

NewGUI = game.StarterGui.Instance.new("Frame")

It may work better if you do

NewGUI = Instance.new("Frame", game.StarterGui)

3 comments

0

Thanks Ill Test Now :)

0

Now I Get An Error Saying if GUIClosed == false then NewGUI end

0

'=' expected near 'end'

Change the script to "LocalScript" Problem solved.

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