Script does not work for absolutely no reason?

So I want the player to spawn in with some setting with lighting, but the lighting makes it a bit distracting when I edit, so I made a script which copies the Instances onto game.Lighting, but it doesn’t work? Like theres no errors or anything, the script doesn’t function, at all. Its enabled, the instances are enabled, its all archivable. Is this a bug or something?

local function lighting()
	print("Worked") --doesn't work either
	for _,v in pairs(game.ReplicatedStorage.Lighting.Menu:GetChildren()) do
		local vv = v:Clone()
		vv.Parent = script.Parent
	end
end

lighting()

image

Where is this script located? Is it a LocalScript or a ServerScript? If its a local script, then read this.

Like what it said, LocalScripts only run if it is a descendant of the following:

1 Like

I moved it to PlayerScripts, still a no go…

Try StarterGui, if you dont want to keep adding lighting everytime they respawn, then parent the LocalScript to a ScreenGui, then in the ScreenGui turn off the ResetOnSpawn option.