Whenever I load the game, the map won't load because of this error? I have no idea why, Can someone help me?
Here is the script,
local function set_lighting(mname) local dolist={"Ambient","ColorShift_Bottom","ColorShift_Top","OutdoorAmbient"} for i=1, #dolist do light[dolist[i]]=color(lightset[mname][dolist[i]][1]/255,lightset[mname][dolist[i]][2]/255,lightset[mname][dolist[i]][3]/255) end mapname.Value=lightset[mname].Name end
Here is the error that occurs when I load the game.
20:53:34.461 - ServerScriptService.server:2152: attempt to index field '?' (a nil value)
Any help?
local function set_lighting(mname) local dolist={"Ambient","ColorShift_Bottom","ColorShift_Top","OutdoorAmbient"} for i,v in pairs(dolist) do -- Switched to pairs to make it easier for you light[v]=Color3.new(lightset[mname][v][1]/255,lightset[mname][v][2]/255,lightset[mname][v][3]/255) -- You did not use "Color3.new" which is required for Color3 colors. end mapname.Value=lightset[mname].Name end
If this helped, make sure to upvote/accept it!