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

How do I make a gui flash then close automatically? [closed]

Asked by 5 years ago
Edited 5 years ago

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

0
NOT A REQ SITE! kittonlover101 201 — 5y

Closed as Not Constructive by Azarth

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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!!!

Ad