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

Surface light changing color script?

Asked by 4 years ago
Edited 4 years ago

i legit really started scripting today but my script to change light isnt working. i looked on the developer website but i didnt find anything that helped

local light = game.Workspace.Light
light.Color = Color3.new(225, 225, 225)
wait (2)
light.Color = Color3.new(138, 171, 133)

Im not sure if im missing something or i got it completely wrong.

If you need to know the part name its called Brick, before it was called Part and was changing colors from other scripts.

The surface light name is light.

0
What is the Class Name? raid6n 2196 — 4y
0
sorry i dont know what that is lol gpp_CSRO 4 — 4y

3 answers

Log in to vote
0
Answered by 4 years ago

Whoops, I saw a space between wait and (2) in line 2, it probably the problem with your script

local light = game.Workspace.Light
light.Color = Color3.new(225, 225, 225)
wait(2) -- Fixed
light.Color = Color3.new(138, 171, 133)
0
Still doesnt work gpp_CSRO 4 — 4y
Ad
Log in to vote
0
Answered by
raid6n 2196 Moderation Voter Community Moderator
4 years ago

Remember, The Color3 parameters should be on the range [0, 1].

local light = game.Workspace.Light
light.Color = Color3.new(225/255, 225/255, 225/255)
wait(2) 
light.Color = Color3.new(138/255, 171/255, 133/255)
0
Still doesnt work. Does the script have to be a child of the surface light or something? gpp_CSRO 4 — 4y
Log in to vote
0
Answered by 4 years ago

Figured it out i did

game.Workspace.Brick

instead of

game.Workspace.Brick.SurfaceLight

Answer this question