So I have a play button that pops up when u join and when u click it it goes away. Below is the script...
-- Local Script inside the button script.Parent.MouseButton1Down:connect(function() p = game.Players.LocalPlayer p.PlayerGui.ExampleGui:Destroy() end)
Now I'm needing a time wait mabey like 5 seconds before they are able to close. Why? Because I want them to make sure they read rules so they know what the game is about :)
-- Local Script inside the button local clicked = false script.Parent.MouseButton1Down:connect(function() if clicked == false then clicked = true local timer = 5 -- timer is 5 seconds local p = game.Players.LocalPlayer while timer > 0 do -- while the timer is bigger than 0 subtract 1, every second wait(1) timer = timer - 1 p.PlayerGui.IntroGui.ShopFrame.Close.Text = "Cooldown ("..timer..")" -- changing the text of the button to the cooldown, and indicates the seconds remaining till the gui is removed end p.PlayerGui.IntroGui:Destroy() end end)
Hope this helps!