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

Outdoor Ambient Doesnt change?

Asked by 5 years ago
Edited 5 years ago

I am working on core freezedown and meltdown but The Outdoor Ambient value in Lighting doesnt change here is the script

while true do
temp = game.Workspace.Temp.Value
if temp == -300 then
script.Parent.Parent.Ice:Play()
script.Parent.Parent.Music:Play()
script.Parent.Parent.Alarm2:Play()
wait(5)
script.Parent.Parent.Power:Play()
wait(0.1)
game.Lighting.Brightness = 0
game.Lighting.OutdoorAmbient = 0, 0, 0 //here is the problem
elseif temp == -301 then
script.Parent.Parent.Ice:Play()
script.Parent.Parent.Music:Play()
script.Parent.Parent.Alarm2:Play()
wait(5)
script.Parent.Parent.Power:Play()
wait(0.1)
game.Lighting.Brightness = 0
game.Lighting.OutdoorAmbient = 0, 0, 0//here is it too
elseif temp == -302 then
script.Parent.Parent.No:Play()
elseif temp == -303 then
script.Parent.Parent.No:Play()
elseif temp == -304 then
script.Parent.Parent.No:Play()
else
script.Parent.Parent.No:Play()
end
wait()
end
0
please put all of your code in the codeblock theking48989987 2147 — 5y
0
posted it TrueMatejGamez 4 — 5y
0
This indentation deserves an award. User#25115 0 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Firstly, let's indent this code. It's a mess.

while true do
    temp = game.Workspace.Temp.Value

    if temp == -300 then
        script.Parent.Parent.Ice:Play()
        script.Parent.Parent.Music:Play()
        script.Parent.Parent.Alarm2:Play()
        wait(5)
        script.Parent.Parent.Power:Play()
        wait(0.1)
        game.Lighting.Brightness = 0
        game.Lighting.OutdoorAmbient = 0, 0, 0 //here is the problem
    elseif temp == -301 then
        script.Parent.Parent.Ice:Play()
        script.Parent.Parent.Music:Play()
        script.Parent.Parent.Alarm2:Play()
        wait(5)
        script.Parent.Parent.Power:Play()
        wait(0.1)
        game.Lighting.Brightness = 0
        game.Lighting.OutdoorAmbient = 0, 0, 0//here is it too
    elseif temp == -302 then
        script.Parent.Parent.No:Play()
    elseif temp == -303 then
        script.Parent.Parent.No:Play()
    elseif temp == -304 then
        script.Parent.Parent.No:Play()
    else
        script.Parent.Parent.No:Play()
    end
    wait()
end

Much better. We can now easily see the problem.


Remember that in assignment, additional results are discarded. So game.Lighting.OutdoorAmbient = 0, 0, 0 was not assigning OutdoorAmbient to black color, but instead to zero. The last two zeroes are discarded. You must use the Color3.fromRGB (or new) constructor to create a Color3.

game.Lighting.OutdoorAmbient = Color3.fromRGB(0, 0, 0)
-- # or game.Lighting.OutdoorAmbient = Color3.fromRGB() 
-- # since not passing any arguments will just return a color3 0, 0, 0
0
Thanks for answering TrueMatejGamez 4 — 5y
Ad

Answer this question