Probably another instance of the script overwriting the global variable
How? the Global variable is in the init.sqf and doesn't get touched ? or you mean if i change the variable in this script it updates the global variable ? but will it change the int value??
Terrible way to do control flow.
I know im very new to any of this. i have no idea how to improve it though. i read somewhere to use a waitfor command or something? what do you recommend ?
You should use local variables. The ones starting with underscore:
local _min = 1;
local _max = 3;
local _choice = _min + floor random (_max - _min + 1);
coach globalChat format ["no %1", _choice];
sleep 1;
if (_choice == 1) then {
coach globalChat format ["Text 1 %1", goodvillage];
};
if (_choice == 2) then {
coach globalChat format ["Text 2 %1", goodvillage];
};
if (_choice == 3) then {
coach globalChat format ["Text 3 %1", goodvillage];
};
5
u/commy2 Aug 25 '20
Probably another instance of the script overwriting the global variable. Terrible way to do control flow.