I am making a night system table and trying to make the fog system but the only problem is when the NightFog = false the Fog still spawns when it shouldn’t also does math.random need a number to work
My script
-- Before the Night starts
local NightHint = {
NightName = "Night 1",
NightFog = false,
BloodMoon = false, -- Boost Zombies damage + walkspeed
BlueMoon = false, -- Boosts Players Gun Damage
GreenMoon = false, -- Boosts Players health + walkspeed
PurpleMoon = false, -- Decreases Zombies health + walkspeed
}
wait(10)
NightHint["NightFog"] = math.random
NightHint["BloodMoon"] = math.random
NightHint["BlueMoon"] = math.random
NightHint["GreenMoon"] = math.random
NightHint["PurpleMoon"] = math.random
for NightPicked, value in pairs(NightHint) do
print(value)
end
for NightFog, value in pairs(NightHint) do -- Fog System
wait(1)
local lighting = game:GetService("Lighting")
lighting.FogStart = 1
lighting.FogEnd = 100
lighting.FogColor = Color3.fromRGB(171, 168, 158)
local NightFog = NightFog
if NightHint.Value == false then
lighting.FogStart = 1000
lighting.FogEnd = 100
lighting.FogColor = Color3.fromRGB(248, 248, 248)
end
end