env_skypaint Lag

I finally figured out that the entity env_skypaint.lua is causing massive amounts of usermessages lag on my server. If i remove the file, a few addons break, if i keep it there then it creates lag. I have Atmos on the server so is there anyway to keep it from breaking causing lag yet keep it there? I was thinking of disabling its stock features… But idk what to do. Any and all help is appreciated.
Thanks, Lemonhead



AddCSLuaFile()

ENT.Type				= "point"
ENT.DisableDuplicator	= true


--
-- Make this entity always networked
--
function ENT:UpdateTransmitState()	return TRANSMIT_ALWAYS end

--
-- Networked / Saved Data
--
function ENT:SetupDataTables()

	self:NetworkVar( "Vector",	0,	"TopColor",			{ KeyName = "topcolor", Edit = { type = "VectorColor", category = "Main", order = 1 } } );		
	self:NetworkVar( "Vector",	1,	"BottomColor",		{ KeyName = "bottomcolor", Edit = { type = "VectorColor", category = "Main", title = "Color Bottom", order = 2  } } );		
	self:NetworkVar( "Float",	0,	"FadeBias",			{ KeyName = "fadebias", Edit = { type = "Float", category = "Main", min = 0, max = 1, order = 3 } } );

	self:NetworkVar( "Float",	4,	"SunSize",			{ KeyName = "sunsize", Edit = { type = "Float", min = 0, max = 10, category = "Sun" } } );
	self:NetworkVar( "Vector",	2,	"SunNormal",		{ KeyName = "sunnormal" } ); -- No editing this - it's for coders only
	self:NetworkVar( "Vector",	3,	"SunColor",			{ KeyName = "suncolor", Edit = { type = "VectorColor", category = "Sun" } } );

	self:NetworkVar( "Float",	2,	"DuskScale",		{ KeyName = "duskscale", Edit = { type = "Float", min = 0, max = 1, category = "Dusk" } } );
	self:NetworkVar( "Float",	3,	"DuskIntensity",	{ KeyName = "duskintensity", Edit = { type = "Float", min = 0, max = 10, category = "Dusk" } } );
	self:NetworkVar( "Vector",	4,	"DuskColor",		{ KeyName = "duskcolor", Edit = { type = "VectorColor", category = "Dusk" } } );

	self:NetworkVar( "Bool",	0,	"DrawStars",		{ KeyName = "drawstars", Edit = { type = "Boolean", category = "Stars", order = 10 } } );
	self:NetworkVar( "String",	0,	"StarTexture",		{ KeyName = "startexture", Edit = { type = "Texture", group = "Stars", category = "Stars", order = 11 } } );

	self:NetworkVarElement( "Angle", 0, 'p', "StarScale", { KeyName = "starscale", Edit = { type = "Float", min = 0, max = 5, category = "Stars", order = 12 } } );
	self:NetworkVarElement( "Angle", 0, 'y', "StarFade", { KeyName = "starfade", Edit = { type = "Float", min = 0, max = 5, category = "Stars", order = 13 } } );
	self:NetworkVarElement( "Angle", 0, 'r', "StarSpeed", { KeyName = "starspeed", Edit = { type = "Float", min = 0, max = 5, category = "Stars", order = 14 } } );
	
	self:NetworkVar( "Float",	1, "HDRScale",			{ KeyName = "hdrscale", Edit = { type = "Float", category = "Main", min = 0, max = 1, order = 4 } } );

	--
	-- Entity defaults
	--
	if ( SERVER ) then

		self:SetTopColor( Vector( 0.2, 0.5, 1.0 ) )
		self:SetBottomColor( Vector( 0.8, 1.0, 1.0 ) )
		self:SetFadeBias( 1 )
		

		self:SetSunNormal( Vector( 0.4, 0.0, 0.01 ) )
		self:SetSunColor( Vector( 0.2, 0.1, 0.0 ) )
		self:SetSunSize( 2.0 )

		self:SetDuskColor( Vector( 1.0, 0.2, 0.0 ) )
		self:SetDuskScale( 1 )
		self:SetDuskIntensity( 1 )

		self:SetDrawStars( true )
		self:SetStarSpeed( 0.01 )
		self:SetStarScale( 0.5 )
		self:SetStarFade( 1.5 )
		self:SetStarTexture( "skybox/starfield" )

		self:SetHDRScale( 0.66 )

	end

end

--[[---------------------------------------------------------
   Name: Initialize
-----------------------------------------------------------]]
function ENT:Initialize()
	
	
end


--[[---------------------------------------------------------
   Name: KeyValue
   Desc:
-----------------------------------------------------------]]
function ENT:KeyValue( key, value )

	if ( self:SetNetworkKeyValue( key, value ) ) then
		return
	end

	-- TODO: sunposmethod 
	-- 		0 : "Custom - Use the Sun Normal to position the sun"
	--		1 : "Automatic - Find a env_sun entity and use that"

end


function ENT:Think()

	--
	-- Find an env_sun - if we don't already have one.
	--
	if ( SERVER && self.EnvSun == nil ) then
		
		-- so this closure only gets called once - even if it fails
		self.EnvSun = false;

		local list = ents.FindByClass( "env_sun" )
		if ( #list > 0 ) then
			self.EnvSun = list[1]
		end

	end
	
	--
	-- If we have a sun - force our sun normal to its value
	--
	if ( SERVER && IsValid( self.EnvSun ) ) then

		local vec = self.EnvSun:GetInternalVariable( "m_vDirection" );
		
		if ( isvector( vec ) ) then
			self:SetSunNormal( vec )
		end

	end

	--
	-- Become the active sky again if we're not already
	--
	if ( CLIENT && g_SkyPaint != self ) then

		if ( !IsValid( g_SkyPaint ) ) then
			g_SkyPaint = self
		end

	end

end

--
-- To prevent server insanity - only let admins edit the sky.
--
function ENT:CanEditVariables( ply )

	return ply:IsAdmin()

end

Scroll down for all the code

Uninstall atmos? It seems it changes sky parameters too often if it creates lag.

No, cause even without it the server lags like hell. I really dont know why. And if i keep Atmos and remove ev_skypaint then atmos doesnt work.

Remove addons one by one until you find the one that causes spam. Also, what gamemode you run?

I did, and none of them caused the lag. Darkrp2.4.3 Im working on 2.5. Do you think that updating will help?

So, uh, removing all addons doesn’t stop the lag? That doesn’t make sense.

The lag stops when i remove Env_skypaint.lua in base entities So im not sure what to do. The server lags with it, and without it two addons are broken.

What two addons? One Atmos, second?

No. When i goto gamemodes > base > entities > entities and remove env_skypaint then an addon called Zones and a tool labeler break.

That doesn’t make any sense. Those addons are not even using the sky entity, why would they break?

That’s why i don’t get it. And i don’t know what to do. You have alot of experience so i thought you might understand.

Would anyone know why the skybox would be causing lag?