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

Lighting Ambient Script won't work?

Asked by 10 years ago
lighting = game.Workspace.Lighting
function c()
lighting.Ambient = Color3.new(31/255,31/255,31/255)
script.Parent.Visible = false
end
script.Parent.MouseButton1Down:connect(c)

I've looked it over and it seems fine to me, but it does not work. No errors either.

1 answer

Log in to vote
0
Answered by 10 years ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.
lighting = game.Lighting
function c()
lighting.Ambient = Color3.new(31/255,31/255,31/255)
script.Parent.Visible = false
end
script.Parent.MouseButton1Down:connect(c)
0
"Lighting" is a service, so it should be referenced by "game.Lighting" (it's not a child of the Workspace) BlueTaslem 18071 — 10y
Ad

Answer this question