Bloom Turns off/on at a specific time of day?

Hey, Im currently making a roleplay game that involves police cars, and i prefer much brighter lights.
During night, it looks very nice, like so:
image
But during the daytime, everything else around is extremely bright, as shown here.
image

  1. What do you want to achieve? A working script that toggles the bloom effect ingame, turning on at night around time 17:48:00 and back off at time 06:12:00.

  2. What is the issue? At day, when the bloom effects made for night are applied, it is so bright i might need to see my eye doctor the next time i see it.

  3. What solutions have you tried so far? Ive looked on the developer hub and on google and youtube, but failed to find any scripts or solutions.

I have some basic understanding of scripting so im assuming its something like Lighting.lvrpbloom.Enabled = false?

Edit: this is my second post on this forum so my apologies if this is in a wrong topic, i can change it upon request

2 Likes
while wait(1) do
if game.Lighting.TimeOfDay == "0:00:00" then -- choose time of day
Lighting.lvrpbloom.Enabled = false
      end
end

Does this involve the toggling on or do i do another script change the time and do true
also where would this be placed?

1 Like

local bloom = game.Lighting[“SPECIFY HERE”]

local disabletime = “00:00:00” – choose
local enabletime = “00:00:00” – choose

game.Lighting:GetPropertyChanged(“TimeOfDay”):Connect(function()
if game.Lighting.TimeOfDay == disabletime then
bloom.Enabled = false
end
if game.Lighting.TimeOfDay == enabletime then
bloom.Enabled = true
end
end)

1 Like

Where is the script placed? workspace? lighting?

ServerScriptService or Workspace (your choice.) Make the script a Script. Not a LocalScript.

1 Like

rodger dodger, thank you! sorry i couldnt respond btw, emergency trip to culvers

hey, this doesn’t seem to work. i put it in serverscriptservice and changed the time and it still doesnt do anything.

I fixed the post marked as a solution. Just make sure you don’t remove any numbers, but you can change them. (I think the problem was that there was a missing 0)

Oh ahah, thanks ill try it out right now

do i need to like… do it in roblox player and not studio? its not turning on when i do :time 1 in adonis admin

Use GetPropertyChanged rather than having a while loop as it yields your code.

dunno what this means, please elaborate?

GetPropertyChanged checks when a property of an Instance changes.

Here Script
local bloom = game.Lighting["SPECIFY HERE"]

local disabletime = "00:00:00" -- choose 
local enabletime = "00:00:00" -- choose

game.Lighting:GetPropertyChanged("TimeOfDay"):Connect(function()
	if game.Lighting.TimeOfDay == disabletime then
		bloom.Enabled = false
	end
	if game.Lighting.TimeOfDay == enabletime then
		bloom.Enabled = true
	end	
end)

alright, so if that works better i guess could you implement that into the script? im sorry if im overtiring you or anything

Edited the last post I have made…------------------------

Essentially this: Instance | Documentation - Roblox Creator Hub

What you will have to do code wise is the following:

local bloom = game.Lighting.WhateverItIs

local disabletime = “00:00:00” – choose a specific time (ie 17, 18, 19)
local enabletime = “00:00:00” – choose

game.Lighting:GetPropertyChanged(“TimeOfDay”):Connect(function()
if game.Lighting.ClockTime == disabletime then
bloom.Enabled = false
end
if game.Lighting.ClockTime == enabletime then
bloom.Enabled = true
end
end)

Clock time is a lot better to use as the time changes, it’ll be easier to detect what time it is.

1 Like

alright thanks ill try this and DevCramp’s

im getting a bunch of red underlines in this one.

Please show us rather than just stating it.