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

How to make after a certain amount of time a lighting variable will be enabled?

Asked by 2 years ago

**The title kinda explains itself. I want it so that after a certain amount of time a color correction effect will be enabled for a couple secs. I'm also very new to scripting so it would be awesome if y'all could explain it to me and show me, thanks!

0
do you mean you want it to toggle once after x amount of time or continously forever, also if you want it to be for everyone or specific player(s) enzotinman1 23 — 2y
1
i want it to toggle after like 90000 seconds and then turn off after like 10 seconds. and yeah for everyone. Ey_Yatzy 11 — 2y
1
what the heck, 90000 seconds is 25 hours, u good? greatneil80 2647 — 2y
0
lol yeah, its a really long waiting game Ey_Yatzy 11 — 2y
View all comments (3 more)
0
anyways, heres a solution: wait(90000) game.Lighting.ColorCorrection.Enabled = true wait(10) game.Lighting.ColorCorrection.Enabled = false lmao greatneil80 2647 — 2y
0
wow. i feel stupid now Ey_Yatzy 11 — 2y

1 answer

Log in to vote
0
Answered by
xxaxxaz 42
2 years ago
Edited 2 years ago

script:

local part = script.Parent -- replace that with the location of the part
local time = 1 -- replace 1 with the amount of time in between
local sheep = false

local Color1 = Red -- replace red with what color you want it to change back to
local Color2 = Blue -- replace red with what color you want it to change to



while wait(time) do
    sheep = not sheep
    if sheep == true
        part.BrickColor = Enum.BrickColor[Color1]
    else
        part.BrickColor = Enum.BrickColor[Color2]
    end
end

another way script:

local part = script.Parent -- replace that with the location of the part
local time1 = 1 -- replace 1 with the amount of time in between
local time2 = 1 --replace 1 with the amount of time in between
local sheep = false

local Color1 = Red -- replace red with what color you want it to change back to
local Color2 = Blue -- replace red with what color you want it to change to


while wait()
    if sheep = true
        wait(time1)
        sheep = true
        part.BrickColor = Enum.BrickColor[Color1]
    else
        wait(time2)
        sheep = false
        part.BrickColor = Enum.BrickColor[Color1]
    end
end
Ad

Answer this question