local MaxPlayers = 6 local Players = 0 local Dif_Mode = false ents.GetAllRealPlayers = function() local players = {} for index, ply in pairs(ents.GetAllPlayers()) do if ply:IsRealPlayer() then table.insert( players, ply ) end end return players end local DifTimer = timer.Create( 5, function() if Dif_Mode then Players = #ents.GetAllRealPlayers() for _, player in pairs( ents.GetAllRealPlayers() ) do local frac = math.max( MaxPlayers / Players, 1 ) player:SetAttributeValue( "dmg penalty vs players", frac ) player:SetAttributeValue( "mult max health", frac ) player:SetAttributeValue( "engy building health bonus", frac ) player:SetAttributeValue( "heal rate bonus", frac ) player:SetAttributeValue( "collect currency on kill", 1 ) end end end, 0) function SetDif( dif, _, _ ) MaxPlayers = dif end function ToggleDifMode( _, _, _ ) if Dif_Mode == true then Dif_Mode = false else Dif_Mode = true end print( "Dif mode is now set to: ", Dif_Mode ) end