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

I created a Local GUI script and it seems like it isn't working , why?

I created a Local GUI script and it seems like it isn't working , where is my error?

--INSTANCES

local ScreenGui = Instance.new("ScreenGui")
local Main = Instance.new("Frame")
local TITLE = Instance.new("TextButton")
local PINK = Instance.new("TextButton")
local ORANGE = Instance.new("TextButton")
local WHITE = Instance.new("TextButton")
local CYAN = Instance.new("TextButton")
local OpenAndClose = Instance.new("TextButton")

--Properties

ScreenGui.Parent = game.StarterGui
Main.Position = UDim2.new(0.511, 0,0.247, 0)
Main.Size = UDim2.new(0, 422,0, 329)
Main.Parent = ScreenGui
Main.Visible = false
Main.BackgroundColor3 = Color3.fromRGB(20, 255, 255)
TITLE.Position = UDim2.new(0, 0,0.082, 0)
TITLE.Size = UDim2.new(0, 422,0, 50)
TITLE.Text = "Undertales Roleplay"
TITLE.TextSize = 20
TITLE.Text = Main
PINK.Position = UDim2.new(0, 0,0.523, 0)
PINK.Size = UDim2.new(0, 200,0, 50)
PINK.Text = "UNDERGROUND"
PINK.TextSize = 20
PINK.Parent = Main 
PINK.BackgroundColor3 = Color3.fromRGB(79, 111, 255)
ORANGE.Position = UDim2.new(0.512, 0,0.523, 0)
ORANGE.Text = "ALPHYS LAB"
ORANGE.TextSize = 20
ORANGE.Parent = Main
ORANGE.BackgroundColor3 = Color3.fromRGB(79, 111, 255)
WHITE.Position = UDim2.new(0, 0,0.768, 0)
WHITE.Text = "SNOWDIN TOWN"
WHITE.TextSize = 20
WHITE.Parent = Main
WHITE.BackgroundColor3 = Color3.fromRGB(79, 111, 255)
CYAN.Text = "WATERFALL"
CYAN.Position = UDim2.new(0.512, 0,0.77, 0)
CYAN.TextSize = 20
CYAN.Parent = Main
CYAN.BackgroundColor3 = Color3.fromRGB(79, 111, 255)
OpenAndClose.Position = UDim2.new(-1.536, 0,0.422, 0)
OpenAndClose.Parent = Main
OpenAndClose.Text = "Open GUI"
OpenAndClose.BackgroundColor3 = Color3.fromRGB(79, 111, 255)

--OPENANDCLOSE

OpenAndClose.MouseButton1Down:connect(function()
	if Main.Visible then
		Main.Visible = false
	else
		Main.Visible = true
	end
end)

1 answer

ScreenGui.Parent = game.StarterGui

I belive you have to tell it to put it into a players gui not the games,

ScreenGui.Parent = game:GetService("Players").LocalPlayer.PlayerGui

^^ That should work!

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