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

Attempt to index local 'LIGHTS' (a nil value) ?

Asked by 5 years ago

Trying to make a lighting system. Whenever I click a button to change the lights, i get the message: Attempt to index local 'LIGHTS' (a nil value)

My script:

local rs = game:GetService("ReplicatedStorage") local re = rs:WaitForChild("lightsRE")

re.OnServerEvent:connect(function(plr, event, LIGHTS) if event == "white" then local start = LIGHTS:WaitForChild("Light").Color local End = LIGHTS:WaitForChild("Light"):WaitForChild("white").Color

    for i = 0,1,0.1 do
        wait()
        local color = start:lerp(End,i)
        LIGHTS:WaitForChild("Light").BrickColor = BrickColor.new(color)
        LIGHTS:WaitForChild("Light"):WaitForChild("MainLight").Color = color
    end
end

end)

0
Use code blocks. mixgingengerina10 223 — 5y
0
please post the script that fires the server, and note that you DONT need to put player as an argument when firing the server!!! radusavin366 617 — 5y

Answer this question