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

GUI Script Not Working?

Asked by 9 years ago
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

Log in to vote
2
Answered by 9 years ago

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);
Ad
Log in to vote
0
Answered by
Xoqex 75
9 years ago

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)
0
Thanks Ill Test Now :) theawesome624 100 — 9y
0
Now I Get An Error Saying if GUIClosed == false then NewGUI end theawesome624 100 — 9y
0
'=' expected near 'end' theawesome624 100 — 9y
Log in to vote
0
Answered by 9 years ago
NewGUI = Instance.new("Frame", game.StarterGui")
Log in to vote
0
Answered by 9 years ago

Change the script to "LocalScript" Problem solved.

Answer this question