local BONUS_TYPE_BOSS = 1 local coopStarposts = CV_FindVar("coopstarposts") local nonBossCoopStarposts = CV_RegisterVar( { name = "nonbosscoopstarposts"; defaultvalue = "Per-player"; flags = CV_NETVAR|CV_SHOWMODIF|CV_CALL|CV_NOINIT; PossibleValue = { ["Per-player"] = 0; Shared = 1; Teamwork = 2; }; func = function(consoleVariable) if multiplayer and isserver and mapheaderinfo[gamemap].bonustype ~= BONUS_TYPE_BOSS then CV_Set(coopStarposts, consoleVariable.string) end end; } ) local allowRespawningDuringBosses = CV_RegisterVar( { name = "allowrespawningduringbosses"; defaultvalue = "No"; flags = CV_NETVAR|CV_SHOWMODIF|CV_CALL; PossibleValue = CV_YesNo; func = function(consoleVariable) if multiplayer and isserver and mapheaderinfo[gamemap].bonustype == BONUS_TYPE_BOSS then if consoleVariable.string == "Yes" then CV_Set(coopStarposts, nonBossCoopStarposts.string) elseif consoleVariable.string == "No" then CV_Set(coopStarposts, "Teamwork") end end end; } ) if isserver and coopStarposts.string ~= "Teamwork" then CV_Set(nonBossCoopStarposts, coopStarposts.string) end addHook("MapChange", function(map) if multiplayer and isserver and allowRespawningDuringBosses.string == "No" then if mapheaderinfo[map].bonustype ~= BONUS_TYPE_BOSS then CV_Set(coopStarposts, nonBossCoopStarposts.string) else CV_Set(coopStarposts, "Teamwork") end end end)