I want to make a textbutton for my gui that is invisible and after x seconds it makes visible.
I try making a script like this:
wait(3)
but it doesn't work. Please could you help me?
First thing I notice is that you're calling StarterGui. Changing things in StarterGui during the game won't affect the player's Gui.
So how do we change the player's Gui? The answer is simple. Inside a local script, we need to first find the player.
--inside a local script local Player = game.Players.LocalPlayer --Getting the local player from the service Players.
Then we simply locate the Gui from Player
and change the property.
--inside a local script local Player = game.Players.LocalPlayer --Getting the local player from the service Players. Player.PlayerGui.ScreenGUI.Frame.TextButton.Visible = false
So here's the finished product.
--inside a local script local Player = game.Players.LocalPlayer --Getting the local player from the service Players. wait(3) Player.PlayerGui.ScreenGUI.Frame.TextButton.Visible = false
EDIT An easier solution would be making a local script just inside the TextButton and writing this:
--inside a local script local button = script.Parent wait(3) button.Visible = false
Remember that since the Gui is in StarterGui, it'll already be replicated to the PlayerGui for you.
I think your code should work to be honest..
local gui = *Your Gui Path* wait(3) gui.Visible = true
The above code should work but maybe another setting is disabled. For instance, the Enabled property.
My solution would be to instead of making it visible, cloning it from ReplicatedStorage or ReplicatedFirst(whatever fits your needs more), and then destroying the gui when you are done with it. It is much easier because no settings have to be changed, literally just:
local gui = *Your Gui Path* local player = game:GetService("Players").LocalPlayer wait(3) local clone = gui:Clone() clone.Parent = player.PlayerGui wait(3) clone:Destroy()
Of course, you don't need to wait to destroy, you could make a button when pressed do that. Sorry if the code is wrong, I just wrote it really fast. You make the decision which is better for you, and I hoped I helped!
Edit: OH, you also forgot to add brackets to the tick