@@ -18,6 +18,13 @@ SF.Holograms.personalquota = CreateConVar( "sf_holograms_personalquota", "300",
1818SF .Holograms .burstrate = CreateConVar ( " sf_holograms_burstrate" , " 10" , { FCVAR_ARCHIVE , FCVAR_REPLICATED },
1919 " The default number of holograms allowed to spawn in a short interval of time via Starfall scripts for a single instance ( burst )" )
2020
21+ SF .Holograms .timerdelay = CreateConVar ( " sf_holograms_timerdelay" , " 0.25" , {FCVAR_ARCHIVE ,FCVAR_REPLICATED },
22+ " The default rate at which the burst counter is reduced ( rate at which players can spawn holograms )" )
23+
24+ cvars .AddChangeCallback ( " sf_holograms_timerdelay" , function ()
25+ timer .Adjust ( " SF_Hologram_BurstCounter" , SF .Holograms .timerdelay :GetFloat () or 1 / 4 , 0 , burstCounter )
26+ end )
27+
2128SF .Holograms .Methods = hologram_methods
2229SF .Holograms .Metatable = hologram_metamethods
2330
@@ -277,13 +284,14 @@ local function personal_max_reached ( i )
277284 return plyCount [ i .player ] >= SF .Holograms .personalquota :GetInt ()
278285end
279286
280- timer . Create ( " SF_Hologram_BurstCounter " , 1 / 4 , 0 , function ()
287+ local function burstCounter ()
281288 for i , _ in pairs ( insts ) do
282289 if i .data .holograms .burst < SF .Holograms .burstrate :GetInt () or 10 then -- Should allow for dynamic changing of burst rate from the server.
283290 i .data .holograms .burst = i .data .holograms .burst + 1
284291 end
285292 end
286- end )
293+ end
294+ timer .Create ( " SF_Hologram_BurstCounter" , SF .Holograms .timerdelay :GetFloat () or 1 / 4 , 0 , burstCounter )
287295
288296--- Creates a hologram.
289297-- @server
0 commit comments