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

OutdoorAmbient Script Won't Work? [SIMPLE]

Asked by 9 years ago

GUYS, SERIOUSLY STOP GIVING ME -1s ON ALL MY POSTS!

b = script.Parent.Shop.setf.sanity.OFF
tcb = true
function c()
    if tcb == true then
        game.Lighting.OutdoorAmbient = Color3.new(147,147,147)
    end
end
b.MouseButton1Down:connect(c)

I did Color3.new, but script still doesn't work. And, also, I can't use the dev console, so I made one myself and I found this error: C:/Users/R****/AppData/Local/Roblox/Versions/version-71b693:172: attempt to index local 'RbxGui' (a nil value) and Error loading core script StarterScript

1
That error in output is an error in the CoreGuis, it's not related to your script. I don't see any problems with your code off the bat. Can you add a print statement inside the c function to verify that it's actually being called? Merely 2122 — 9y
0
Well, I've tested the script many times and found that the ambient would not change. And please clarify what print statement means... does it mean print('print')? PyccknnXakep 1225 — 9y
0
Wait... never mind XD. But seriously, is my studio outdated or something? PyccknnXakep 1225 — 9y
0
Yeah guys, this is a very good question, and people run into this problem a lot. Please stop downvoting it. Merely 2122 — 9y

2 answers

Log in to vote
3
Answered by
Merely 2122 Moderation Voter Community Moderator
9 years ago

The Color3 constructor takes numbers from 0 to 1. You have to divide each number by 255 in order for it to work.

game.Lighting.OutdoorAmbient = Color3.new(147/255,147/255,147/255)
Ad
Log in to vote
1
Answered by
Thetacah 712 Moderation Voter
9 years ago

You have to divide it by 255

b = script.Parent.Shop.setf.sanity.OFF
tcb = true
function c()
    if tcb == true then
        game.Lighting.OutdoorAmbient = Color3.new(147/255,147/255,147/255)
    end
end
b.MouseButton1Down:connect(c)

0
I've figured it out already. Thanks anyways. PyccknnXakep 1225 — 9y

Answer this question