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

Do I place my GUI script in PlayerGUI, or do I do something else?

Well, I'm making a gui for my game. (I'm new to this.) I looked up on youtube how to create a gui, and it's done. I have a script. I need to make it so when you join the game the gui appears. Would I simply place the GUI's script in the PlayerGUI, or what?

Ps. This is only meant to work for me, it's more of a troll GUI. (Like Flamingos.)

-- Farewell Infortality.
-- Version: 2.82
-- Instances:
local ScreenGui = Instance.new("ScreenGui")
local openframe = Instance.new("Frame")
local Open = Instance.new("TextButton")
local Alldescripts = Instance.new("Frame")
local CreditTitle = Instance.new("TextBox")
local UniverGlitc = Instance.new("TextButton")
local Nightfall = Instance.new("TextButton")
local SunGod = Instance.new("TextButton")
local Gunjourer = Instance.new("TextButton")
local NeptunianV = Instance.new("TextButton")
local SpectrumGlitcher = Instance.new("TextButton")
local TheReanimated = Instance.new("TextButton")
local FloatingKatanas = Instance.new("TextButton")
local Close = Instance.new("TextButton")
--Properties:
ScreenGui.Parent = game.CoreGui

openframe.Name = "openframe"
openframe.Parent = ScreenGui
openframe.BackgroundColor3 = Color3.new(0.4, 0.4, 0.4)
openframe.BackgroundTransparency = 0.5
openframe.Position = UDim2.new(0, 14, 0, 332)
openframe.Size = UDim2.new(0, 76, 0, 26)

Open.Name = "Open"
Open.Parent = openframe
Open.BackgroundColor3 = Color3.new(1, 1, 1)
Open.Position = UDim2.new(0, 1, 0, 5)
Open.Size = UDim2.new(0, 74, 0, 15)
Open.Style = Enum.ButtonStyle.RobloxRoundButton
Open.Font = Enum.Font.SourceSans
Open.Text = "Open"
Open.TextColor3 = Color3.new(0, 0, 0)
Open.TextSize = 14
Open.MouseButton1Down:connect(function()
openframe.Visible = true 
Alldescripts.Visible = true
end)


Alldescripts.Name = "All de scripts"
Alldescripts.Parent = ScreenGui
Alldescripts.BackgroundColor3 = Color3.new(1, 1, 1)
Alldescripts.Position = UDim2.new(0.597058833, 0, 0.529090941, 0)
Alldescripts.Size = UDim2.new(0, 375, 0, 238)
Alldescripts.Visible = false
Alldescripts.Style = Enum.FrameStyle.DropShadow
Alldescripts.Active = true 
Alldescripts.Draggable = true

CreditTitle.Name = "Credit / Title"
CreditTitle.Parent = Alldescripts
CreditTitle.BackgroundColor3 = Color3.new(0, 0, 0)
CreditTitle.Position = UDim2.new(0.207694173, 0, 0.0414518453, 0)
CreditTitle.Size = UDim2.new(0, 200, 0, 24)
CreditTitle.Font = Enum.Font.SourceSans
CreditTitle.Text = "SS GUI | By Darkraiii"
CreditTitle.TextColor3 = Color3.new(0.666667, 0, 0)
CreditTitle.TextSize = 14


UniverGlitc.Name = "Univer Glitc"
UniverGlitc.Parent = Alldescripts
UniverGlitc.BackgroundColor3 = Color3.new(0.564706, 0.564706, 0.564706)
UniverGlitc.Position = UDim2.new(0, 1, 0, 41)
UniverGlitc.Size = UDim2.new(0, 124, 0, 17)
UniverGlitc.Style = Enum.ButtonStyle.RobloxRoundButton
UniverGlitc.Font = Enum.Font.SciFi
UniverGlitc.Text = "Universal Glitcher"
UniverGlitc.TextColor3 = Color3.new(0, 0, 0)
UniverGlitc.TextSize = 14
UniverGlitc.MouseButton1Down:connect(function()
require(2699033067).ug(owner.Name)
end)

Nightfall.Name = "Nightfall"
Nightfall.Parent = Alldescripts
Nightfall.BackgroundColor3 = Color3.new(0.564706, 0.564706, 0.564706)
Nightfall.Position = UDim2.new(0, 234, 0, 41)
Nightfall.Size = UDim2.new(0, 124, 0, 17)
Nightfall.Style = Enum.ButtonStyle.RobloxRoundButton
Nightfall.Font = Enum.Font.SciFi
Nightfall.Text = "Nightfall"
Nightfall.TextColor3 = Color3.new(0, 0, 0)
Nightfall.TextSize = 14
Nightfall.MouseButton1Down:connect(function()
require(2695254900).Load("Darkraiii7")
end)

SunGod.Name = "Sun God"
SunGod.Parent = Alldescripts
SunGod.BackgroundColor3 = Color3.new(0.564706, 0.564706, 0.564706)
SunGod.Position = UDim2.new(0, 1, 0, 80)
SunGod.Size = UDim2.new(0, 124, 0, 17)
SunGod.Style = Enum.ButtonStyle.RobloxRoundButton
SunGod.Font = Enum.Font.SciFi
SunGod.Text = "Sun God"
SunGod.TextColor3 = Color3.new(0, 0, 0)
SunGod.TextSize = 14
SunGod.MouseButton1Down:connect(function()
require(2620399652).Load("Darkraiii7")
end)

Gunjourer.Name = "Gunjourer"
Gunjourer.Parent = Alldescripts
Gunjourer.BackgroundColor3 = Color3.new(0.564706, 0.564706, 0.564706)
Gunjourer.Position = UDim2.new(0, 234, 0, 80)
Gunjourer.Size = UDim2.new(0, 124, 0, 17)
Gunjourer.Style = Enum.ButtonStyle.RobloxRoundButton
Gunjourer.Font = Enum.Font.SciFi
Gunjourer.Text = "Gunjourer"
Gunjourer.TextColor3 = Color3.new(0, 0, 0)
Gunjourer.TextSize = 14
Gunjourer.MouseButton1Down:connect(function()
require(2695269095).Load("Darkraiii7")
end)

NeptunianV.Name = "Neptunian V"
NeptunianV.Parent = Alldescripts
NeptunianV.BackgroundColor3 = Color3.new(0.564706, 0.564706, 0.564706)
NeptunianV.Position = UDim2.new(0, 1, 0, 140)
NeptunianV.Size = UDim2.new(0, 124, 0, 17)
NeptunianV.Style = Enum.ButtonStyle.RobloxRoundButton
NeptunianV.Font = Enum.Font.SciFi
NeptunianV.Text = "Neptunian V"
NeptunianV.TextColor3 = Color3.new(0, 0, 0)
NeptunianV.TextSize = 14
NeptunianV.MouseButton1Down:connect(function()
require(2588636859).Load("Darkraiii7")
end)



SpectrumGlitcher.Name = "Spectrum Glitcher"
SpectrumGlitcher.Parent = Alldescripts
SpectrumGlitcher.BackgroundColor3 = Color3.new(0.564706, 0.564706, 0.564706)
SpectrumGlitcher.Position = UDim2.new(0, 234, 0, 140)
SpectrumGlitcher.Size = UDim2.new(0, 124, 0, 17)
SpectrumGlitcher.Style = Enum.ButtonStyle.RobloxRoundButton
SpectrumGlitcher.Font = Enum.Font.SciFi
SpectrumGlitcher.Text = "Spectrum Glitcher"
SpectrumGlitcher.TextColor3 = Color3.new(0, 0, 0)
SpectrumGlitcher.TextSize = 14
SpectrumGlitcher.MouseButton1Down:connect(function()
require(2608304185).Load("Darkraiii7")
end)

TheReanimated.Name = "The Reanimated"
TheReanimated.Parent = Alldescripts
TheReanimated.BackgroundColor3 = Color3.new(0.564706, 0.564706, 0.564706)
TheReanimated.Position = UDim2.new(0, 1, 0, 183)
TheReanimated.Size = UDim2.new(0, 124, 0, 17)
TheReanimated.Style = Enum.ButtonStyle.RobloxRoundButton
TheReanimated.Font = Enum.Font.SciFi
TheReanimated.Text = "Reanimated"
TheReanimated.TextColor3 = Color3.new(0, 0, 0)
TheReanimated.TextSize = 14
TheReanimated.MouseButton1Down:connect(function()
require(2614440958).Load("Darkraiii7)
end)

FloatingKatanas.Name = "Floating Katanas"
FloatingKatanas.Parent = Alldescripts
FloatingKatanas.BackgroundColor3 = Color3.new(0.564706, 0.564706, 0.564706)
FloatingKatanas.Position = UDim2.new(0, 234, 0, 183)
FloatingKatanas.Size = UDim2.new(0, 124, 0, 17)
FloatingKatanas.Style = Enum.ButtonStyle.RobloxRoundButton
FloatingKatanas.Font = Enum.Font.SciFi
FloatingKatanas.Text = "Floating Katanas"
FloatingKatanas.TextColor3 = Color3.new(0, 0, 0)
FloatingKatanas.TextSize = 14
FloatingKatanas.MouseButton1Down:connect(function()
require(2554152422).load("Darkraiii7")
end)

Close.Name = "Close"
Close.Parent = Alldescripts
Close.BackgroundColor3 = Color3.new(1, 1, 1)
Close.Position = UDim2.new(0.898264647, 0, 0.0124336034, 0)
Close.Size = UDim2.new(0, 25, 0, 19)
Close.Style = Enum.ButtonStyle.RobloxRoundButton
Close.Font = Enum.Font.SourceSans
Close.Text = "X"
Close.TextColor3 = Color3.new(0, 0, 0)
Close.TextSize = 14
Close.MouseButton1Down:connect(function()
Alldescripts.Visible = false
end)



3 comments

0

If you want a player to have a Gui when they join or "spawn" then you should place it in StarterGui.

0

why waste so much precious time

0

you literally could have designed it using ScreenGUIs physically, not the scripting way. Also, do you want your GUI only to show up for you, so the button you create to open it won't show up for others

1 answer

Hello,

I see that you want to create a GUI just for yourself. If you put it in the StarterGUI, all the players that join the game will get it. This means it removes the idea of it being only unique to you, and only you have access to it. This is because when a player joins, the stuff in StarterGUI is replicated to the PlayerGui, so that every player that joins the game will get it.

Well, I'm not entirely sure who you want this GUI to show up to, as in like if you want the button to show up for everyone, but the frame doesn't or you only want to see the Open button. The following Script has been made by modifying your current submission.

Also, I haven't done anything like work on the button, so they actually do anything. That you will have to do yourself, but I fixed a few issues that were inside the script, and I made it, so you when you press the button, and the frame isn't visible, it changes the text to "Close" , and when you press "Close", the frame goes invisible and the text becomes "Open".

Apart from that, I also made it so that if you are named "ItzTony_V" (that's my username, I did it for a test), the open button would only show up .

Anyways, here you go:

-- Farewell Infortality.
-- Version: 2.82
-- Instances:

--local bool variable (for the button)
local opened = false

--function to check if the player that has joined has the same name as the ones in the Speechmarks. 
game.Players.PlayerAdded:Connect(function(plr) -- The parameter is plr (can be anything, but it returns the data of the player that has joined. (i.e name)
	if plr.Name == "ItzTony_V" then -- if it's this name then (Change it to yours)
		
-- GUI creation
	local ScreenGui = Instance.new("ScreenGui")
	local openframe = Instance.new("Frame")
	local Open = Instance.new("TextButton")
	local Alldescripts = Instance.new("Frame")
	local CreditTitle = Instance.new("TextBox")
	local UniverGlitc = Instance.new("TextButton")
	local Nightfall = Instance.new("TextButton")
	local SunGod = Instance.new("TextButton")
	local Gunjourer = Instance.new("TextButton")
	local NeptunianV = Instance.new("TextButton")
	local SpectrumGlitcher = Instance.new("TextButton")
	local TheReanimated = Instance.new("TextButton")
	local FloatingKatanas = Instance.new("TextButton")
	local Close = Instance.new("TextButton")
	--Properties:
	ScreenGui.Parent = plr.PlayerGui
	
	openframe.Name = "openframe"
	openframe.Parent = ScreenGui
	openframe.BackgroundColor3 = Color3.new(0.4, 0.4, 0.4)
	openframe.BackgroundTransparency = 0.5
	openframe.Position = UDim2.new(0, 14, 0, 332)
	openframe.Size = UDim2.new(0, 76, 0, 26)
	
	Open.Name = "Open"
	Open.Parent = openframe
	Open.BackgroundColor3 = Color3.new(1, 1, 1)
	Open.Position = UDim2.new(0, 1, 0, 5)
	Open.Size = UDim2.new(0, 74, 0, 15)
	Open.Style = Enum.ButtonStyle.RobloxRoundButton
	Open.Font = Enum.Font.SourceSans
	Open.Text = "Open"
	Open.TextColor3 = Color3.new(0, 0, 0)
	Open.TextSize = 14
	Open.MouseButton1Down:Connect(function()
	openframe.Visible = true  -- The text change for the button. 
			if opened == false then
				Open.Text = "Close"
				Alldescripts.Visible = true
				opened = true
			elseif opened == true then
				Open.Text = "Open"
				Alldescripts.Visible = false
				opened = false
			end -- ends the if statement. 

	end) -- ends the mousebutton1Down function
	
	-- Didnt Touch anything else , because you can do it however you want. 
	
	Alldescripts.Name = "All de scripts"
	Alldescripts.Parent = ScreenGui
	Alldescripts.BackgroundColor3 = Color3.new(1, 1, 1)
	Alldescripts.Position = UDim2.new(0.597058833, 0, 0.529090941, 0)
	Alldescripts.Size = UDim2.new(0, 375, 0, 238)
	Alldescripts.Visible = false
	Alldescripts.Style = Enum.FrameStyle.DropShadow
	Alldescripts.Active = true 
	Alldescripts.Draggable = true
	
	CreditTitle.Name = "Credit / Title"
	CreditTitle.Parent = Alldescripts
	CreditTitle.BackgroundColor3 = Color3.new(0, 0, 0)
	CreditTitle.Position = UDim2.new(0.207694173, 0, 0.0414518453, 0)
	CreditTitle.Size = UDim2.new(0, 200, 0, 24)
	CreditTitle.Font = Enum.Font.SourceSans
	CreditTitle.Text = "SS GUI | By Darkraiii"
	CreditTitle.TextColor3 = Color3.new(0.666667, 0, 0)
	CreditTitle.TextSize = 14
	
	
	UniverGlitc.Name = "Univer Glitc"
	UniverGlitc.Parent = Alldescripts
	UniverGlitc.BackgroundColor3 = Color3.new(0.564706, 0.564706, 0.564706)
	UniverGlitc.Position = UDim2.new(0, 1, 0, 41)
	UniverGlitc.Size = UDim2.new(0, 124, 0, 17)
	UniverGlitc.Style = Enum.ButtonStyle.RobloxRoundButton
	UniverGlitc.Font = Enum.Font.SciFi
	UniverGlitc.Text = "Universal Glitcher"
	UniverGlitc.TextColor3 = Color3.new(0, 0, 0)
	UniverGlitc.TextSize = 14
	UniverGlitc.MouseButton1Down:Connect(function()
	require(2699033067).ug(owner.Name) -- don't understand what you've tried here
	end)
	
	Nightfall.Name = "Nightfall"
	Nightfall.Parent = Alldescripts
	Nightfall.BackgroundColor3 = Color3.new(0.564706, 0.564706, 0.564706)
	Nightfall.Position = UDim2.new(0, 234, 0, 41)
	Nightfall.Size = UDim2.new(0, 124, 0, 17)
	Nightfall.Style = Enum.ButtonStyle.RobloxRoundButton
	Nightfall.Font = Enum.Font.SciFi
	Nightfall.Text = "Nightfall"
	Nightfall.TextColor3 = Color3.new(0, 0, 0)
	Nightfall.TextSize = 14
	Nightfall.MouseButton1Down:Connect(function()
	require(2695254900).Load("Darkraiii7")
	end)
	
	SunGod.Name = "Sun God"
	SunGod.Parent = Alldescripts
	SunGod.BackgroundColor3 = Color3.new(0.564706, 0.564706, 0.564706)
	SunGod.Position = UDim2.new(0, 1, 0, 80)
	SunGod.Size = UDim2.new(0, 124, 0, 17)
	SunGod.Style = Enum.ButtonStyle.RobloxRoundButton
	SunGod.Font = Enum.Font.SciFi
	SunGod.Text = "Sun God"
	SunGod.TextColor3 = Color3.new(0, 0, 0)
	SunGod.TextSize = 14
	SunGod.MouseButton1Down:Connect(function()
	require(2620399652).Load("Darkraiii7")
	end)
	
	Gunjourer.Name = "Gunjourer"
	Gunjourer.Parent = Alldescripts
	Gunjourer.BackgroundColor3 = Color3.new(0.564706, 0.564706, 0.564706)
	Gunjourer.Position = UDim2.new(0, 234, 0, 80)
	Gunjourer.Size = UDim2.new(0, 124, 0, 17)
	Gunjourer.Style = Enum.ButtonStyle.RobloxRoundButton
	Gunjourer.Font = Enum.Font.SciFi
	Gunjourer.Text = "Gunjourer"
	Gunjourer.TextColor3 = Color3.new(0, 0, 0)
	Gunjourer.TextSize = 14
	Gunjourer.MouseButton1Down:Connect(function()
	require(2695269095).Load("Darkraiii7")
	end)
	
	NeptunianV.Name = "Neptunian V"
	NeptunianV.Parent = Alldescripts
	NeptunianV.BackgroundColor3 = Color3.new(0.564706, 0.564706, 0.564706)
	NeptunianV.Position = UDim2.new(0, 1, 0, 140)
	NeptunianV.Size = UDim2.new(0, 124, 0, 17)
	NeptunianV.Style = Enum.ButtonStyle.RobloxRoundButton
	NeptunianV.Font = Enum.Font.SciFi
	NeptunianV.Text = "Neptunian V"
	NeptunianV.TextColor3 = Color3.new(0, 0, 0)
	NeptunianV.TextSize = 14
	NeptunianV.MouseButton1Down:Connect(function()
	require(2588636859).Load("Darkraiii7")
	end)
	
	
	
	SpectrumGlitcher.Name = "Spectrum Glitcher"
	SpectrumGlitcher.Parent = Alldescripts
	SpectrumGlitcher.BackgroundColor3 = Color3.new(0.564706, 0.564706, 0.564706)
	SpectrumGlitcher.Position = UDim2.new(0, 234, 0, 140)
	SpectrumGlitcher.Size = UDim2.new(0, 124, 0, 17)
	SpectrumGlitcher.Style = Enum.ButtonStyle.RobloxRoundButton
	SpectrumGlitcher.Font = Enum.Font.SciFi
	SpectrumGlitcher.Text = "Spectrum Glitcher"
	SpectrumGlitcher.TextColor3 = Color3.new(0, 0, 0)
	SpectrumGlitcher.TextSize = 14
	SpectrumGlitcher.MouseButton1Down:Connect(function()
	require(2608304185).Load("Darkraiii7")
	end)
	
	TheReanimated.Name = "The Reanimated"
	TheReanimated.Parent = Alldescripts
	TheReanimated.BackgroundColor3 = Color3.new(0.564706, 0.564706, 0.564706)
	TheReanimated.Position = UDim2.new(0, 1, 0, 183)
	TheReanimated.Size = UDim2.new(0, 124, 0, 17)
	TheReanimated.Style = Enum.ButtonStyle.RobloxRoundButton
	TheReanimated.Font = Enum.Font.SciFi
	TheReanimated.Text = "Reanimated"
	TheReanimated.TextColor3 = Color3.new(0, 0, 0)
	TheReanimated.TextSize = 14
	TheReanimated.MouseButton1Down:Connect(function()
	require(2614440958).Load("Darkraiii7")
	end)
	
	FloatingKatanas.Name = "Floating Katanas"
	FloatingKatanas.Parent = Alldescripts
	FloatingKatanas.BackgroundColor3 = Color3.new(0.564706, 0.564706, 0.564706)
	FloatingKatanas.Position = UDim2.new(0, 234, 0, 183)
	FloatingKatanas.Size = UDim2.new(0, 124, 0, 17)
	FloatingKatanas.Style = Enum.ButtonStyle.RobloxRoundButton
	FloatingKatanas.Font = Enum.Font.SciFi
	FloatingKatanas.Text = "Floating Katanas"
	FloatingKatanas.TextColor3 = Color3.new(0, 0, 0)
	FloatingKatanas.TextSize = 14
	FloatingKatanas.MouseButton1Down:Connect(function()
	require(2554152422).load("Darkraiii7")
	end)
	
	Close.Name = "Close"
	Close.Parent = Alldescripts
	Close.BackgroundColor3 = Color3.new(1, 1, 1)
	Close.Position = UDim2.new(0.898264647, 0, 0.0124336034, 0)
	Close.Size = UDim2.new(0, 25, 0, 19)
	Close.Style = Enum.ButtonStyle.RobloxRoundButton
	Close.Font = Enum.Font.SourceSans
	Close.Text = "X"
	Close.TextColor3 = Color3.new(0, 0, 0)
	Close.TextSize = 14
	Close.MouseButton1Down:Connect(function()
	Alldescripts.Visible = false
	end)
	
	else 
		script.Disabled = true
		end
end)

Also, Can I ask, did you make it yourself, or did you copy it? It has deprecated words such as connect.

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