I am making an FPS and am currently customizing the main menu and I have got a Script so far Ill add it at the End. Anyway I have the script Insert a Text button and make the Text change to loading... and I want to make It so that when it reads "Ready To Play" It will Delete itself from the specific PlayerGui Folder. Any Ideas? SCRIPT--
-- Create ScreenGui
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = script.Parent
-- Create TextButton
local textButton = Instance.new("TextButton")
textButton.Parent = screenGui
textButton.Position = UDim2.new(0, 25, 0, 50)
textButton.Size = UDim2.new(0, 150, 0, 50)
textButton.BackgroundColor3 = BrickColor.Black().Color
textButton.Text = "Click To Play!"
--[[Bind function to button click]]--
textButton.MouseButton1Down:connect(function()
textButton.Text = "Loading..."
end)
wait(3)
textButton.Text = "Ready To Play!"
if textButton.Text == "Ready To Play" then
game.Players.user.PlayerGui.ScreenGui:Destroy()
if game.Players.user.PlayerGui.ScreenGui:Destroy() == true then print("MainMenu Deleted")
end
end

3 comments
Why don't you clone the GUI into their playerGUI so it's unique to them?
Why don't you clone the GUI into their playerGUI so it's unique to them?
I'm just going out on a limb here -- is a surface GUI in play anywhere in this process? It doesn't sound like it, but as a helpful warning either way, you can't find who clicked a surface GUI.