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

How would I make these GUI visible at random times?

I have a pop up GUI in my game that I want to pop up randomly

m = math.Random (1,2)

m == 1 then
wait(m)
script.Parent.Visible = true

How would I go about this?

1 answer

--LocalScript

local player = game.Players.LocalPlayer
local guiName = "ScreenGui"
local gui = player.PlayerGui:FindFirstChild(guiName)

local randomTime = math.random(5, 10) --the countdown will select a random number 5 - 10

while gui do
	--Countdown
	for i=randomTime,0,-1 do
		if i == 0 then
			gui.Enabled = true
			wait(3)
			gui.Enabled = false
		end
 		
		wait(1)
	end
	
	wait(0.1)
end

--If the gui is not found, then this will print... You don't have to write this
print("Gui is not found!")

change the guiName to the your gui's name

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