BIS_fnc_MP is your best buddy for MP scripting. you can sync that across all clients by doing something similar to this:
Put this in your init.sqf
AUSMD_fnc_syncVariable =
{
_var = _this select 0;
_value = _this select 1;
_var = _value;
};
then to sync your variable across all clients you execute the function using this:
[["yourvariablenamehere",yourvaluehere],"AUSMD_fnc_syncVariable",nil,false] spawn BIS_fnc_MP;
Might not work, maybe it will. let me know if it doesn't and i'll try to find a way to fix it.
EDIT:
Also you can only use publicVariable "varhere";
if you want to sync more than one variable then you need to make another line with publicvariable "varhere"; But personally I found publicVariable to be broken in the way that it doesn't actually sync across all clients hilariously, maybe it was just for what I was using it for (maybe its fixed?).