local bloom = game.Lighting.BloomEffectHere
local disabletime = 1
local enabletime = 1 -- Change this value
game.Lighting:GetPropertyChanged("ClockTime"):Connect(function()
if game.Lighting.ClockTime == disabletime then
bloom.Enabled = false
end
if game.Lighting.ClockTime == enabletime then
bloom.Enabled = true
end
end)
This is a lot longer than it needs to be. It should be just this:
local bloom = game.Lighting.BloomEffectHere
local disabletime = 1
local enabletime = 1 -- Change this value
game.GetPropertyChangedSignal("ClockTime"):Connect(function()
if game.Lighting.ClockTime == disabletime then
bloom.Enabled = false
end
if game.Lighting.ClockTime == enabletime then
bloom.Enabled = true
end
end)
Assuming that disabletime and enabletime have the same time representation of TimeOfDay and ClockTime (respectively), this implementation introduces redundancy as TimeOfDay and ClockTime are essentially synced.
Furthermore, @WooleyWool provides a more simplified version above.
now im getting awfully confused, do i need to do it in like roblox player? is there a difference? nothing seems to be working and i feel like its some silly small mistake like all the other mistakes i make in developing
im not getting anything in output or any script errors, i dunno why it wouldnt work. its a great script and everything else is good so im completely confused here
Try playtesting your game and set the clocktime value in the properties tab to whatever enabled/disabled clocktime is. If itās enabled, then it works.
When i move the ClockTime Slider in the properties of lighting it does not actually change the time or anything in the game window, but rather just changes the number in it and pretends like it changed the time.
local bloom = game.Lighting.BloomEffectHere
local disabletime = 1
local enabletime = 1 -- Change this value
game.Lighting:GetPropertyChangedSignal("ClockTime"):Connect(function()
if game.Lighting.ClockTime == disabletime then
bloom.Enabled = false
end
if game.Lighting.ClockTime == enabletime then
bloom.Enabled = true
end
end)
What code are you using to change the time of day? Since weāre only checking if the time is exactly disabletime/enabletime, maybe the time of day is changing so much that it goes OVER it, not exactly it.