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

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

Asked by 8 years ago

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

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

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

0
How can I use ResetPlayerGuiOnSpawn? UpdatingCurrently 10 — 8y
0
Well its a boolean so its as simple as, game.StarterGui.ResetPlayerGuiOnSpawn = false HyperSpeed05 40 — 8y
Ad

Answer this question