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

How do I make the GUI Disappear forever?

Asked by 4 years ago

Hello, I made a Welcome GUI with a close button but if a character resets the GUI with the close button appear again is there any way I can make it Disappear even if the player dies?

0
Destroy it Spjureeedd 385 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago

You can destroy the gui e.g.

local Gui = game:GetService("StarterGui")

--//Whatever code you put
--//Now when you want to destroy it, write this code
Gui:Destroy()
Ad
Log in to vote
0
Answered by
WN0820 11
4 years ago
Edited 4 years ago

I would use this put this as localscript inside the button that closes it

local event = game.ReplicatedStorage.RemoteEvent
script.Parent.MouseButton1Click:Connect(function()
      script.Parent.Parent.Visible = false
      event:FireServer()
end)

Put this in ServerScriptService as a script

local Name = game.StarterGui:FindFirstChild("GUINAME")
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function()
      Name:Destroy()
end
0
You can rename your Remotevent to whatever you want WN0820 11 — 4y

Answer this question