Hello so I am wondering if its possible to have multiple different lighting options where players can select them.
So basically I want a blurr, sunny lighting, Night lighting etc.
And players can select either or. So lets say they want a blurr lighting they can have that. But then they want a sunny lighting so they switch to that.
So I assume you would be talking about localised lighting settings for people to choose. All of this could be done over the client side by making a GUI and having options of each lighting settings you want. Then when that button is selected, have a couple of folders in ReplicatedStorage and it will clone everything from that folder and place them it into lighting.
For example:
script.Parent.MouseButton1Click:Connect(function()
if game.ReplicatedStorage.LightingOptions:FindFirstChild(script.Parent) then
local SelectedLighting = game.ReplicatedStorage.LightingOptions:FindFirstChild(script.Parent)
game.Lighting:ClearAllChildren()
for i,v in pairs(SelectedLighting:GetChildren()) do
v:Clone().Parent = game.Lighting
end
end
end)
Well that would be a lot more intensive, you’d have to like setup a store of what they’ve selected. I’d probably start off by making a folder within the player that saves their different options like:
Note you’d have to create this when the player joins the game.
local OptionsFolder = Instance.new("Folder")
OptionsFolder.Name = "LightingOptions"
OptionsFolder.Parent = Player
local OptionOne = Instance.new("ObjectValue")
OptionOne.Name = "Blur"
OptionOne.Value = BLURSELECTED
OptionOne.Parent = OptionsFolder
local OptionTwo = Instance.new("ObjectValue")
OptionTwo.Name = "Atmosphere"
OptionTwo.Value = ATMOSPHERE
OptionTwo.Parent = OptionsFolder
Then when you want to change your lighting setting, you’d have to refer to these settings.
If you selected a button that changed atmosphere, you’d write something like this
script.Parent.MouseButton1Click:Connect(function()
if game.ReplicatedStorage.LightingOptions:FindFirstChild(script.Parent) then
if Player.OptionsFolder.Atmosphere.Value ~= nil then
Player.OptionsFolder.Atmosphere.Value:Destroy()
end
Player.OptionsFolder.Atmosphere.Value = game.ReplicatedStorage.LightingOptions:FindFirstChild(script.Parent):Clone()
Player.OptionsFolder.Atmosphere.Value.Parent = game.Lighting
end
end)