Need help writing a simple script

Hi, I’m trying to write a simple script to change the color of the outdoor ambiance and have very little knowledge of scripting. I wrote “game.lighting.oudoorambient = 216,170,54” and obviously this didn’t work. Can anyone help rewrite this to change the outdoor ambient color to RGB 216, 170, 54?

2 Likes

you need to tell it that it’s a color3 value when setting it

game.Lighting.OutdoorAmbient = Color3.fromRGB(216,170,54)
2 Likes

You can use something like Color = Color3.fromRGB(216,170,54) (change the color proprety to whatever proprety it used for the color.)

You’re going to first want to pay attention to capitalization for various things in the studio. For example, lighting is capitalized in Studio. So what you’ll first need to do is go from change it to game.Lighting.OutdoorAmbient. Second, when setting color you’ll want to use Color3, and for the numbers you’re using you’ll want to use Color3.fromRGB, which basically sets them on the RGB scale.
Taking all that into consideration you’ll be left with

game.Lighting.OutdoorAmbient = Color3.fromRGB(216, 170, 54)

Hey, let me give some pseudocode here.

If you were to type 243, 226, 124, maybe to you it means something, but it is confusing to not give complete detail about what this means. 243, 226, 124 could be your favorite numbers, the coordinates of a piece, the measures used in three parameters or whatever else, so you need to specify what those numbers mean.

In your case, 243, 226, 124 (well technically it’s not that but you get the point) would be the color code for a particular color. In the way you’re typing it it’s three completely different numbers unrelated to one another, if you do like these people are saying, to type Color3.New(0, 0, 0) you would get the color you want.

Now, another thing they haven’t mentioned to you. If when you put the colors the lighting stays white or becomes white, divide each of those numbers by 255, then set it in there, now it will appear as the color you want.

Game.Lighting.OutDoorAmbient = Color3.New(216 / 255, 170 / 255, 54 / 255)

Oh they’re using fromRgb I didnt know that. =/

1 Like