I wanted to ask if anyone here knows a better way of changing lighting for different maps.
I at first tried to copy and paste lighting but that is not possible, so the only thing I could potentially come up with is manually doing it via script, writing down each specific variable for lighting, atmosphere, sky etc and changing it for the specific map.
surely there is a more efficient way though, I’d hate to waste my time typing all those properties.
I don’t believe there is a specific way. But what you can do to get a table is like
local PropertiesToSave = {"Ambiet","Brightness"}
local Object = game.Lighting
local function GeneratePropertiesTable()
local ObjectInformation = {}
for i,v in pairs(PropertiesToSave ) do
if Object[v] then
ObjectInformation[v] = Object[v]
end
end
print(ObjectInformation)
end
GeneratePropertiesTable()
Then you can have a seperate function for setting them
local YourTable = --Paste your table that was printed
local Object = game.Lighting
local function SetObjectProperties()
for i,v in pairs(YourTable) do
if Object[i] then
Object[i] = v
end
end
print("Set")
end
SetObjectProperties()
When passing through the function, it errors at the color (i.e. ambient and any thing using the color3), I tried using different formatting but I couldn’t seem to get it to work (parentheses, curly brackets)