Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I make the Gui invisible after certain time?

I have a script where if you touch a block it will show a GUI, but the GUI stays on your screen and do not disappear, how can I fix this, or what script should I add and where?

Local script inside of a Gui

local ReplicatedStorage = game:GetService('ReplicatedStorage')
local ClientRemote = ReplicatedStorage:WaitForChild('RemoteEvent1')
local Gui = script.Parent:WaitForChild('Frame') 

function OpenGui() -- Function to fire.
    Gui.Visible = true
end

ClientRemote.OnClientEvent:Connect(OpenGui)

2 answers

✓ Accepted answer

Here

local time = 5 --// change to the time you want
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local ClientRemote = ReplicatedStorage:WaitForChild('RemoteEvent1')
local Gui = script.Parent:WaitForChild('Frame') 

function OpenGui() -- Function to fire.
Gui.Visible = true
wait(time)
Gui.Visible = false
end

ClientRemote.OnClientEvent:Connect(OpenGui)

3 comments

0

You dont need "time" you can just do wait(5) and also this works but its timed, unless that's what you want

0

^ Really i think he knows... Lol He's doing that so the guy can edit it easier

0

Tysm! It work :D

Try this

Part.Touched:Connect(function()
YourGUIName.Visible = true
end)

Part.TouchedEnded:Connect(function()
YourGUIName.Visible = false
end)

sorry if it doesnt work

This discussion is preserved as it was. New answers, comments, and votes are closed.