MechSlayer 18 Posted April 12, 2019 I have this code GSO_fnc_necesidades = { while {true} do { _sed = player getVariable "sed"; _sed = _sed - 1; player setVariable ["sed", _sed, true]; Sed = _sed; sleep 5; }; while {true} do { _hambre = player getVariable "hambre"; _hambre = _hambre - 1; player setVariable ["hambre", _hambre, true]; Hambre = _hambre; sleep 10; }; }; And I call it with [] spawn GSO_fnc_necesidades; The problem is that it runs only the first while loop, any fix? Share this post Link to post Share on other sites
GEORGE FLOROS GR 4206 Posted April 12, 2019 28 minutes ago, MechSlayer said: The problem is that Hello there MechSlayer ! You cant add two loops like this and why to do this actually ? add them in one code. Share this post Link to post Share on other sites
MechSlayer 18 Posted April 12, 2019 Hmm strange, I made it work like this before. I need to run them separate because one must go slower than the other Share this post Link to post Share on other sites
GEORGE FLOROS GR 4206 Posted April 12, 2019 1 minute ago, MechSlayer said: run them separate Should be the best option. Share this post Link to post Share on other sites
GEORGE FLOROS GR 4206 Posted April 12, 2019 else you can do this : GSO_fnc_necesidades = { []spawn{ while {true} do { systemchat "1"; sleep 5; }; }; []spawn{ while {true} do { systemchat "2"; sleep 3; }; }; }; call GSO_fnc_necesidades; 2 1 Share this post Link to post Share on other sites
MechSlayer 18 Posted April 12, 2019 Thanks, gonna try it Share this post Link to post Share on other sites
MechSlayer 18 Posted April 12, 2019 7 minutes ago, GEORGE FLOROS GR said: else you can do this : GSO_fnc_necesidades = { []spawn{ while {true} do { systemchat "1"; sleep 5; }; }; []spawn{ while {true} do { systemchat "2"; sleep 3; }; }; }; call GSO_fnc_necesidades; Now it won't continue after the "call GSO_fnc_necesidades; GSO_fnc_InitCliente = { cutText ["","BLACK OUT"]; waituntil {!(IsNull (findDisplay 46))}; cutText [format ["Recuperando datos de %1", name player],"BLACK OUT"]; [player] remoteExecCall ["Servidor_fnc_crearJugador", 2]; sleep 6; [] spawn GSO_fnc_configuraciones; [] spawn GSO_fnc_necesidades; 1 cutRsc ["HUD","PLAIN",-1,false]; call GSO_fnc_hud; (findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 == 219) then {[] spawn GSO_fnc_abrirMenu;};"]; cutText ["", "PLAIN"]; ["Datos cargados", "info", 5] spawn GSO_fnc_notificaciones; }; Share this post Link to post Share on other sites
MechSlayer 18 Posted April 12, 2019 Okey fixed by using [] spawn instead of call 1 Share this post Link to post Share on other sites
killzone_kid 1326 Posted April 13, 2019 10 hours ago, MechSlayer said: Now it won't continue after the "call GSO_fnc_necesidades; If both loops are spawned there is no reason for it not to continue, you must be doing something else you are not showing 1 Share this post Link to post Share on other sites