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

How do I make a GUI?

I want to make a Custom GUI without plugins just Scripting. I have no idea how to start it so if you could help me it would be really helpful.

1 comment

0

Are you in the experimental ribbon UI for studio or normal UI?

3 answers

Click on StarterGui Then click Insert Basic Object Then click Screen GUI (rename it what ever you want) Then click on Insert Basic Objects Then click Text Button (This is the button you can click on) (Or click Frame for a backing to your GUI) Go into the properties of each to change the Color or Text

I'm not great at the Commection line in functions but what I do is search up Shop GUI in free models and get the script from a or open button

That's how you start the GUI you can make it just Text Or you can make a shop which you would need to make stuff Visible = false and stuff

I know this isn't that helpful but this is all I know.

Basicly the person above answered your question as well as it gets... You are gonna need to completely explain everything you want to do what game it is for... But I guess all you are gonna get is what the people up there say I have no idea what you are requesting... For what I know you could be making somthing as advance as me, but yeah I am sure you got your answer...

Assuming that you're asking how to make a GUI purely out of code (so the code inserts the GUI objects) then the following code creates a GUI from scratch and inserts it into a player's PlayerGui when they touch a part.

function createGUI() -- function that creates our GUI
	-- creation of GUI objects
	local screenGui = Instance.new("ScreenGui")
	local frame = Instance.new("Frame", screenGui)
	local textButton = Instance.new("TextButton", frame)

	screenGUI.Name = "NewGui"

	frame.Size = UDim2.new(1, 0, 1, 0) -- UDim2 function is used to set the size and position of GUI
	textButton.Size = UDim2.new(0.1, 0, 0.1, 0)
	textButton.Position = UDim2.new(0.45, 0, 0.45, 0)

	return screenGui
end

part.Touched:connect(function(hit)
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)
	if player and not player.PlayerGui:FindFirstChild("NewGui") then
		-- insert GUI into the player's PlayerGui so it becomes visible
		createGUI().Parent = player.PlayerGui
	end
end)

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