TweenService Pointlight range in a loop [Only affects a single pointlight]

As the title stated, It only affects a single pointlight even tho the other tween works perfectly fine.

Also is there any way i can improve this script, it feels like its a bit poorly scripted. + Will this ever cause Memory Leaks? If yes, what can i do to prevent them?

local TweenService = game:GetService("TweenService")
local tweenInfo1 = TweenInfo.new(
	5,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.InOut,
	0,
	false,
	0
)

local Goal1 = {Transparency = 1}
local Goal2 = {Transparency = .2}


local LightGoal1 = {Range = 0}
local LightGoal2 = {Range = 60}

local RunService = game:GetService("RunService")
local AreaLights = workspace.Game["World One"].Lighting["Area Lights"]:GetChildren()

for i, v in pairs(AreaLights) do
	local lightPart = v:FindFirstChild("LightingPart")
	local pointLight = lightPart.PointLight
	pointLight.Range = 0
	
	local Tween1 = TweenService:Create(lightPart, tweenInfo1, Goal1)
	local Tween2 = TweenService:Create(lightPart, tweenInfo1, Goal2)
	
	local lightTween1 = TweenService:Create(pointLight, tweenInfo1, LightGoal1)
	local lightTween2 = TweenService:Create(pointLight, tweenInfo1, LightGoal2)
	
	task.spawn(function()
		while true do
			if game.Lighting:GetMinutesAfterMidnight() > 6*60 then
				Tween1:Play()
				lightTween1:Play()
				lightPart.Material = Enum.Material.Plastic
				pointLight.Enabled = false
			end
			if game.Lighting:GetMinutesAfterMidnight() > 18*60 then
				Tween2:Play()
				lightTween2:Play()
				lightPart.Material = Enum.Material.Neon
				pointLight.Enabled = true
			end
			task.wait()
		end
	end)
end

Switch out your script with this:

--//Services
local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")
local Lighting = game:GetService("Lighting")

--//Variables
local AreaLights = workspace.Game:WaitForChild("World One").Lighting:WaitForChild("Area Lights")

--//Controls
local tweenInfo1 = TweenInfo.new(
	5,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.InOut,
	0,
	false,
	0
)

local Goal1 = {Transparency = 1}
local Goal2 = {Transparency = 0.2}

local LightGoal1 = {Range = 0}
local LightGoal2 = {Range = 60}

--//Functions
local function InitializeAreaLight(areaLight)
	local lightPart = areaLight.LightingPart
	
	local pointLight = lightPart.PointLight
	pointLight.Range = 0

	local Tween1 = TweenService:Create(lightPart, tweenInfo1, Goal1)
	local Tween2 = TweenService:Create(lightPart, tweenInfo1, Goal2)

	local lightTween1 = TweenService:Create(pointLight, tweenInfo1, LightGoal1)
	local lightTween2 = TweenService:Create(pointLight, tweenInfo1, LightGoal2)
	
	Lighting:GetPropertyChangedSignal("ClockTime"):Connect(function()
		if Lighting:GetMinutesAfterMidnight() > 6*60 then
			Tween1:Play()
			lightTween1:Play()
			
			lightPart.Material = Enum.Material.Plastic
			pointLight.Enabled = false
		end

		if Lighting:GetMinutesAfterMidnight() > 18*60 then
			Tween2:Play()
			lightTween2:Play()
			
			lightPart.Material = Enum.Material.Neon
			pointLight.Enabled = true
		end
	end)
end

for i, areaLight in ipairs(AreaLights:GetChildren()) do
	task.spawn(function()
		InitializeAreaLight(areaLight)
	end)
end

AreaLights.ChildAdded:Connect(function(areaLight)
	InitializeAreaLight(areaLight)
end)

The objects might have loaded before the script ran. Also, you should use events instead of while true do loops.

If you’re using my script no. All the connections are automatically disconnected when the instance is destroyed so no memory leaks will occur.

Sorry for the late response, But it sadly still doesn’t work.

The weird part is. Is that the other tween works perfectly fine. Has this something to do with the pointlight or?

Someone have any idea what might be wrong. Should i make 2 different loops?

No, try adding a print in the local function that initializes each light and tell me if it prints for every light.

It indeed prints every Pointlight.

The weird part is that the other tween works perfectly fine which is the transparency. Parent of the PointLight.