Categories > Coding > Lua >

how do i parent guis to CoreGui

New Reply

Posts: 2

Threads: 2

Joined: Nov, 2024

Reputation: 0

Posted

How do i Parent guis to Game.CoreGui?

Comments

WetWipes 15 Reputation

Commented

local ScreenGui = Instance.new("ScreenGui") --create ScreenGUI
ScreenGui.Name = "TeleportToggleUI" --Name your GUI
ScreenGui.ResetOnSpawn = false --Self Explanatory
ScreenGui.Parent = LocalPlayer:WaitForChild("PlayerGui") --Wait for it to be made if they're on a bad executor/device this helps

local ToggleButton = Instance.new("TextButton") --Create something inside of the ScreenGUI, This is going to be your actual UI, this case its a button
ToggleButton.Size = UDim2.new(0, 150, 0, 50) --Button Size
ToggleButton.Position = UDim2.new(0, 20, 0, 200) --Button Position
ToggleButton.BackgroundColor3 = Color3.fromRGB(40, 40, 40) --Background Colour of Button
ToggleButton.TextColor3 = Color3.fromRGB(255, 255, 255) --Buttons Text colour
ToggleButton.Font = Enum.Font.SourceSansBold --Button Font
ToggleButton.TextSize = 20 --Button Text Size
ToggleButton.Text = "Teleports: OFF" --Button Text
ToggleButton.Parent = ScreenGui 
--[[BUTTON PARENT which has to be the ScreenGUI in
this case but other ways of creating a UI is making a ScreenGUI, then adding
a frame to the ScreenGUI and parenting everything to the frame]]

ThingYouWantParented.Parent = ParentName
  • 0

  • 0

  • Comment

_realnickk

Security Researcher

moderator

Posts: 87

Threads: 2

Joined: Feb, 2020

Reputation: 86

Replied

Pretty self-explanatory. Assign the Parent property of your GUI to the CoreGui service.

  • 0

  • Comment

Security researcher, low-level programmer, and system administrator.

https://github.com/reversed-coffee

Login to unlock the reply editor

Add your reply

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )