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

Why does it become epileptic, trying to change Properties in lighting via script doesn't work, help?

local lighting = game:GetService("Lighting")
lighting.OutdoorAmbient = Color3.new(180, 165, 111)
lighting.FogColor = Color3.new(180, 165, 111)

Whenever I test it after using this, I see soo much painful black and white, and I look at the properties and they are both bizarre numbers like, (452452,91284,25359), etc.

2 answers

✓ Accepted answer

Use Color3.fromRGB(), else you'll have to divide each number by 255. FromRGB does this automatically and sets your number between 0 - 255 on the RGB scale.

local lighting = game:GetService("Lighting")
lighting.OutdoorAmbient = Color3.fromRGB(180, 165, 111)
lighting.FogColor = Color3.fromRGB(180, 165, 111)

3 comments

0

Can you help me with this too? It makes it 00:12:00 instead of 12:00:00 like I want it to be... lighting:SetMinutesAfterMidnight("00:00:00") wait(5) lighting:SetMinutesAfterMidnight("12:00:00")

0

game.Lighting.TimeOfDay = 12

0

Lol... thanks dude.

When working with colour3 units, they cannot exceed 1. If is exceeds 1, it will be black or white. To fix this, you will need to divide each RGB value by 255 so:

local lighting = game:GetService("Lighting")
lighting.OutdoorAmbient = Color3.new(180/255, 165/255, 111/255)
lighting.FogColor = Color3.new(180/255, 165/255, 111/255)

1 comment

0

Can you help me with this too? It makes it 00:12:00 instead of 12:00:00 like I want it to be... lighting:SetMinutesAfterMidnight("00:00:00") wait(5) lighting:SetMinutesAfterMidnight("12:00:00")

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