Search the Community
Showing results for tags 'script editing'.
Found 1 result
-
[solved] Non-Combatant script issue
lkincheloe posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I'm working on a script that allows for players to be non-combatants on a belligerent side (i.e. not civilian), however while expanding to nested If statements I have encountered an Error missing ) issue in the else statement, it's perplexed me and I think a rubber duck debug is in order. private ["_noncomState", "_wArray"]; _noncomState = player getVariable "var_lk_noncom"; _wArray = weapons player; if (count _wArray == 0) then { if (_noncomState == false) then { player setCaptive 1.44; hint "You are a non-Combatant!"; player setVariable ["var_lk_noncom", true] } else []; } else { if (_noncomState == true) then ( player setCaptive 0; hint "You are a Combatant!"; player setVariable ["var_lk_noncom", false] ) else []; }; This is the error that's produced: 16:36:46 Error in expression <te == true) then ( player setCaptive 0; hint "You are a Combatant!"; player se> 16:36:46 Error position: <; hint "You are a Combatant!"; player se> 16:36:46 Error Missing ) 16:36:46 File C:\Users\Lynn\Documents\Arma 3 - Other Profiles\Kinch\missions\n..., line 29 16:36:46 Error in expression <te == true) then ( player setCaptive 0; hint "You are a Combatant!"; player se> 16:36:46 Error position: <; hint "You are a Combatant!"; player se> 16:36:46 Error Missing ) 16:36:46 File C:\Users\Lynn\Documents\Arma 3 - Other Profiles\Kinch\missions\n..., line 29 16:36:46 Mission id: 4964a4130cdf29b09d84b46e8d2333956209f5c6 The error points to if (_noncomState == true) as being the culprit, however being formatted identically to the first part is confusing me. The script is initialized from a sequence starting from InitPlayerLocal.sqf, and the intent of the variable var_lk_noncom is to give the script something to check against so that the SetCaptive command isn't spammed every time a player's inventory changes state. Suggestions?