Framerate drops only while play testing or playing the game

Title explains it all

Basically i just realized it only drops framerates for the client but when i change to server mode it’s not dropping any framerates
image

image
It was these scripts

I realizde they we’re not optimization friendly.

local Lighting = game:GetService("Lighting")
local RunService = game:GetService("RunService")

local function updateLights()
	local timeOfDay = tonumber(Lighting.ClockTime)

	local isNight = (timeOfDay >= 17.9) or (timeOfDay <= 6.3)

	for _, light in pairs(workspace:GetDescendants()) do
		if light:IsA("PointLight") or light:IsA("SpotLight") or light:IsA("SurfaceLight") then
			if light.Name == "KopruLight1" then
				light.Enabled = isNight
			end
		end
	end
end

RunService.RenderStepped:Connect(updateLights)