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

How Can I Make My GUI Wait Before It's Visible?

Asked by
ImfaoXD 158
8 years ago

Can somebody help me?

Here's an image to see what I'm talking about:

https://gyazo.com/c3180653cda1102c3308f3a5fba1e9de

local player = game.Players.LocalPlayer
local gui = player.PlayerGui
function Touch()
    gui:findFirstChild("SonicTeam").Main.Visible = true
    wait(.1)
    gui:findFirstChild("TeamSelect").Main.Visible = false
end

script.Parent.MouseButton1Down:connect(Touch) 

1 answer

Log in to vote
0
Answered by 8 years ago

Im not too bad at debugging code but im horrible at wrighting it so pls correct me if im wrong:

you have put a dot next to the 1 like so:

local player = game.Players.LocalPlayer
local gui = player.PlayerGui
function Touch()
    gui:findFirstChild("SonicTeam").Main.Visible = true
    ***wait(.1)***
    gui:findFirstChild("TeamSelect").Main.Visible = false
end

script.Parent.MouseButton1Down:connect(Touch) 

The bolded bit and italic is where 1 of your errors are. The computer cannot halt its self for a tenth of a second, i must be between 1 second and infinity seconds as it counts time in seconds so I suggest doing:

local player = game.Players.LocalPlayer
local gui = player.PlayerGui
function Touch()
    gui:findFirstChild("SonicTeam").Main.Visible = true
    wait(2-3)
    gui:findFirstChild("TeamSelect").Main.Visible = false
end

script.Parent.MouseButton1Down:connect(Touch) 

Then you have it, the rest are hidden to me so try that. if that works or do 1 second where i put the minus 1. That is if you have included a calculator in yours. xD

0
Actually, the wait function can wait between 1/30th of a second to infinite. M39a9am3R 3210 — 8y
0
Did you found any errors? ImfaoXD 158 — 8y
Ad

Answer this question