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

Why does this script not work? It is supposed to destroy the ScreenGui for good.

After destroying the script's parent from the StarterGUI, you can reset and the same GUI it is supposed to destroy will pop back up on the screen. It should only appear once and never show again, correct?

wait(1) 

local RHCcontrol = script.Parent.Parent.RHCcontrol

script.Parent.Background.Button.Accept.MouseButton1Click:connect(function()
	if RHCcontrol.Frame.Visible == false then
	RHCcontrol.Frame.Visible = true
		
		wait(.1)
			
		script.Parent:Destroy()
	end
	
end)
	

1 answer

✓ Accepted answer

You placed it in StarterGui so that means Children of it are cloned and put into PlayerGui which means it will be cloned every time the player spawns or respawns. if you only want the gui visible the first time the player spawns then set ResetPlayerGuiOnSpawn to false. for more info http://wiki.roblox.com/index.php?title=API:Class/StarterGui

2 comments

0

How can I use ResetPlayerGuiOnSpawn?

0

Well its a boolean so its as simple as, game.StarterGui.ResetPlayerGuiOnSpawn = false

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