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

How to add GUI's manually to the CoreGui?

Asked by 8 years ago

I am trying to add a gui to the CoreGui so it wont go away when a player resets. I am adding it to my admin, which is a module. So when a player joins, it clones the localscript into the players playergui so it executed the localscript which then adds the gui in their CoreGui.

But...

It doesn't work.

local s = Instance.new("ScreenGui", game.CoreGui)
local f = Instance.new("Frame", s)
f.Size = UDim2.new(1,0,1,0)
f.Position = UDim2.new(0,0,0,0)

I've seen people with GUIs where they dont go away, in scriptbuilder.. So it isnt in their startergui.

How do they make it so it doesn't go away?

0
CoreGui is not accessible by normal scripts. CoreGui is often changed by exploits or while in studio through a plugin, however, the latter doesn't transfer over to the game. Might I suggest looking into the http://wiki.roblox.com/index.php?title=API:Class/StarterGui/ResetPlayerGuiOnSpawn M39a9am3R 3210 — 8y
0
There's nothing on the page. BloxSimple 5 — 8y
0
It's just a property to change. Either that or you could use a local script to copy elements of a player's gui as they are being replaced, once the player's character has respawned you could remove the replacement guis and place the clones in the Player's Gui. M39a9am3R 3210 — 8y
0
oh. So I do like = true or = false on it BloxSimple 5 — 8y
0
Is vvvvvvvvv A problem? BloxSimple 5 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago
local S = Instance.new("ScreenGui", game.Players.LocalPlayer.PlayerGui)
local F = Instance.new("Frame", S)
F.Size = UDim2.new(0,50,0,50)

game:GetService("StarterGui").ResetPlayerGuiOnSpawn = false

This also does not work. When I respawn it removes the GUI ;( Any ideas to why?

0
Here's an idea why: The GUI appears in your PlayerGui and it doesn't start in the StarterGui at the beginning of the game, meaning the StarterGui properties aren't applied..? This is purely speculation. xXprohax0r1337Xx 74 — 4y
0
I think a fix, if I'm correct, is instead of using StarterGui, doing this: S.ResetOnSpawn = false xXprohax0r1337Xx 74 — 4y
Ad

Answer this question