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

how do i remove a gui after wait?

so i have a gui on my screen and i want to use a script to get rid of it after like 5 seconds can someone help me?

1 answer

You could do something like this:

This is the local script version (put this in startergui/starterplayerscripts):

local player = game.Players.LocalPlayer
local Gui = game.ServerStorage.Gui:Clone() 
Gui.Parent = player.PlayerGui
game:GetService("Debris"):AddItem(Gui,5)--This removes the Gui after 5 seconds.

Server Script Version (Put this in serverscriptservice):

game.Players.PlayerAdded:Connect(function(player)
local Gui = game.ServerStorage.Gui:Clone() 
Gui.Parent = player.PlayerGui
game:GetService("Debris"):AddItem(Gui,5)--This removes the Gui after 5 seconds.
end)

8 comments

0

yw :P Tell me if it works or not

0

wait where do i put it?

0

I updated the answer, check now

0

are frame and gui the same thing?

0

i have StarterGui>ScreenGui>Frame>then 3 more text labels

0

Put your ScreenGui in serverstorage then replace the "Gui" in local Gui = game.ServerStorage.Gui:Clone() to your ScreenGui's name

0

tysm it worked :D

0

Your welcome :P

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