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?
COMMUNITY QUESTION
How do I make the GUI Disappear forever?
2 answers
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()
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
1 comment
0
You can rename your Remotevent to whatever you want
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Destroy it