SERVERSCRIPT
I made a GUI button if you click it it parents a sky to lighting and puts the other in ServerStorage. This all works perfect but the only problem is I thought it shows only for the player who clicked the button but it shows for everyone. I tried using a LocalScript but It doesn't work when I try reference things outside of StarterGUI with a LocalScript it just doesn't run but when I used a ServerScript, it worked but it happens for all players too.
local changeTime = true
local button = script.Parent
local day = game.Lighting.SunsetSereneSky
local night = game.ServerStorage.NightSky
button.MouseButton1Up:Connect(function()
if changeTime == true then
button.Text = "Time: Night"
day.Parent = game.ServerStorage
night.Parent = game.Lighting
changeTime = false
elseif changeTime == false then
button.Text = "Time: Day"
night.Parent = game.ServerStorage
day.Parent = game.Lighting
changeTime = true
end
end)
this is my problem plz fix it ty

2 comments
big brain formatting here
now that is what i've been missing... I forgot about my question lol and i kept it here for a week + and i forgot to see it if someone answered, but i see a big big mind talk here thanks.