When i want to do a color3 on my games to color like fog color it turns into something else even though i put it in the fog color it becomes something else like the color white instead of the color i wanted.
Skills = {"Silence"} while true do SkillInUse = Skills[math.random(1, #Skills)] cooldown = math.random(10,20) wait(cooldown) if SkillInUse == "Silence" then game.Workspace.ShadowScream:Play() game.Lighting.FogEnd = 50 game.Lighting.FogColor = Color3.new(0,0,0) wait(15) game.Lighting.FogEnd = 150 game.Lighting.FogColor = Color3.new(161, 161, 161) -- problem end end
Color3 has only 2 values. 1 and 0. 0,0,0 is black 1,1,1 is white 1,0,0 is red and etc. So why do we use 255? It isn't supposed to be. So to make it not white we need it to be a decimal number. Imagine something 255 times brighter than white. Exactly. So we need to get 161 and divide it by 255.
Skills = {"Silence"} while true do SkillInUse = Skills[math.random(1, #Skills)] cooldown = math.random(10,20) wait(cooldown) if SkillInUse == "Silence" then game.Workspace.ShadowScream:Play() game.Lighting.FogEnd = 50 game.Lighting.FogColor = Color3.new(0,0,0) wait(15) game.Lighting.FogEnd = 150 game.Lighting.FogColor = Color3.new(161/255, 161/255, 161/255) --"/" means divide. end end
Pretty simple. Hope it helps!
Hello.
The reason it doesn't work properly is because Color3
takes either a decimal or a fraction.
Wrong way:
Color3.new(161,161,161)
Right way:
Color3.new(161/255,161/255,161/255,)
Fixed Version of your code:
Skills = {"Silence"} while true do SkillInUse = Skills[math.random(1, #Skills)] cooldown = math.random(10,20) wait(cooldown) if SkillInUse == "Silence" then game.Workspace.ShadowScream:Play() game.Lighting.FogEnd = 50 game.Lighting.FogColor = Color3.new(0,0,0) wait(15) game.Lighting.FogEnd = 150 game.Lighting.FogColor = Color3.new(161/255, 161/255, 161/255) -- problem end end