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

How do I make a gui flash then close automatically?

Basically, I am making a horror game. The gui that it begins with needs to flash at a certain point in an audio, and then close automatically as it finishes. As I have really basic scripting skills, I am wondering if any of you guys could possibly help?

What I have so far: (basically pointless)

****Highlighted: -Gui -Audio

1 comment

0

NOT A REQ SITE!

1 answer

✓ Accepted answer

Dude this is the most basic scripting. Just make the frame flash white then black like this.

local Frame = script.Parent--//wherever the main frame of the gui is.
local gui = script.Parent.Parent--//wherever your gui is.

function flashfunc()
local i = 5 --//How long flashing is. (1 = 1 SECOND)
repeat
	flashtimes()--//Calling the 'flashtimes' function
	flashtimes()
	flashtimes()
	flashtimes()
	flashtimes()
until i == 1

gui.Enabled = false
end

function flashtimes()
	Frame.BackgroundColor3 = Color3.fromRGB(0,0,0)--//changing color to black.
	wait(0.1)
	Frame.BackgroundColor3 = Color3.fromRGB(255,255,255)--//changing color to white.
	wait(0.1)
end

Make sure to set the FRAME & GUI values to wherever your FRAME & GUIs are.

If you don't have a frame make one.

THIS IS NOT A REQ SITE!!!

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