stlassen 16 Posted November 22, 2017 I'm getting an "Error Missing ;" in the code below. I'm at a lose as to way. Either I'm blind or I'm missing something basic scripting wise. If I remove the if-statement, there are no errors and it works. What am I missing here? addMissionEventHandler [ "TeamSwitch", { private ["_from","_to","_grpFrom","_grpTo"]; _from = _this select 0; _to = _this select 1; _grpFrom = group _from; _grpTo = group _to; _grpTo selectLeader _to; if (_grpFrom != _grpTo) { systemChat "DEBUG: Switched group."; }; } ]; The error I'm getting is as seen below: 19:19:25 Error in expression <ectLeader _to; if (_grpFrom != _grpTo) { systemChat "DEBUG: Switched group."; }> 19:19:25 Error position: <{ systemChat "DEBUG: Switched group."; }> 19:19:25 Error Missing ; 19:19:25 File C:\Users\Søren\Documents\Arma 3 - Other Profiles\Lassen\missions\My_Missions\Freedom.Altis\init.sqf, line 11 19:19:25 Error in expression <ectLeader _to; if (_grpFrom != _grpTo) { systemChat "DEBUG: Switched group."; }> 19:19:25 Error position: <{ systemChat "DEBUG: Switched group."; }> 19:19:25 Error Missing ; 19:19:25 File C:\Users\Søren\Documents\Arma 3 - Other Profiles\Lassen\missions\My_Missions\Freedom.Altis\init.sqf, line 11 19:19:25 Error in expression <.Altis\init.sqf" addMissionEventHandler [ "TeamSwitch", { private ["_from","_to"> 19:19:25 Error position: <[ "TeamSwitch", { private ["_from","_to"> 19:19:25 Error Generic error in expression 19:19:25 File C:\Users\Søren\Documents\Arma 3 - Other Profiles\Lassen\missions\My_Missions\Freedom.Altis\init.sqf, line 1 1 Share this post Link to post Share on other sites
lexx 1331 Posted November 22, 2017 Without leaning myself too far out of the window (I am a shitscripter), but you're missing the "then" from "if... then"? 1 Share this post Link to post Share on other sites
cosmic10r 2320 Posted November 22, 2017 addMissionEventHandler [ "TeamSwitch", { private ["_from","_to","_grpFrom","_grpTo"]; _from = _this select 0; _to = _this select 1; _grpFrom = group _from; _grpTo = group _to; _grpTo selectLeader _to; if (_grpFrom != _grpTo) then { // UP HERE TOO .... LEXX systemChat "DEBUG: Switched group."; }; }; // <<<<< RIGHT HERE !!!!!!!!!!!!!!!!!!!!!!!!!!!!! ]; might be the part i posted ... edit - lexx is right to i think Try Lexx's part first then if it still throws the error throw in the ; i suggested Share this post Link to post Share on other sites
Lucullus 71 Posted November 22, 2017 46 minutes ago, stlassen said: if (_grpFrom != _grpTo) { systemChat "DEBUG: Switched group."; }> 19:19:25 Error position: <{ systemChat "DEBUG: Switched group."; }> 19:19:25 Error Missing ; 19:19:25 File C:\Users\Søren\Documents\Arma 3 - Other Profiles\Lassen\missions\My_Missions\Freedom.Altis\init.sqf, line 11 19:19:25 Error in expression <ectLeader _to; 19:19:25 Error position: < ^^^ this marks the error "then" is missing. The missing semicolon is not significant. Share this post Link to post Share on other sites
stlassen 16 Posted November 22, 2017 Oh wow! What a miss. I was blind. Thanks for the help. Share this post Link to post Share on other sites
stlassen 16 Posted November 22, 2017 It was just the "then" that was missing. Share this post Link to post Share on other sites