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

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

Asked by
lysandr 49
6 years ago
Edited 6 years ago
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

Log in to vote
1
Answered by
Azarth 3141 Moderation Voter Community Moderator
6 years ago
Edited 6 years ago

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)
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") lysandr 49 — 6y
0
game.Lighting.TimeOfDay = 12 Azarth 3141 — 6y
0
Lol... thanks dude. lysandr 49 — 6y
Ad
Log in to vote
0
Answered by
INOOBE_YT 387 Moderation Voter
6 years ago

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)
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") lysandr 49 — 6y

Answer this question