{"name":"setWaypointScript","title":"setWaypointScript","type":"command","url":"https://community.bistudio.com/wiki/setWaypointScript","revid":377760,"updated":"2026-01-03T00:58:20Z","groups":["Waypoints"],"status":"ok","games":{"ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofpe 1.00","arma3_since":"0.50","description":"Attaches a script to a scripted waypoint. In early versions of Arma, command consisted of a script name and additional script arguments and the script had to use SQS Syntax. The script receives the following arguments in _this variable: [group, position, target] + [the optional passed arguments]. The optional arguments are appended to the end of the arguments array.\n\n> [!NOTE]\n> **Arma 3:** In Arma 3, *command* argument can be a reference to .sqf script (it will have to explicitly end with **`.sqf`**) or a reference to `.sqs` script.","syntaxes":[{"syntax":"waypoint setWaypointScript command","params":[{"name":"waypoint","type":"Waypoint","type_expr":"Waypoint"},{"name":"command","type":"String","type_expr":"String"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"waypoint"},"right":{"text":"command"}}],"examples":[{"code":["[_grp, 2] setWaypointScript \"find.sqs player\";"]},{"code":["[_grp, 2] setWaypointScript \"somescript.sqf [1,2,3,4,5,6,7,8]\";"]}],"see_also":["waypoints","deleteWaypoint","copyWaypoints","setCurrentWaypoint","setWaypointBehaviour","setWaypointCombatMode","setWaypointCompletionRadius","setWaypointDescription","setWaypointFormation","setWaypointHousePosition","setWaypointPosition","setWaypointSpeed","setWaypointStatements","setWaypointTimeout","setWaypointType","setWaypointVisible","waypointAttachVehicle","waypointAttachedVehicle","setWaypointLoiterRadius","waypointLoiterRadius","addWaypoint","setWaypointLoiterType","waypointSpeed"]}