{"name":"local","operator":null,"title":"local","type":"command","url":"https://community.bistudio.com/wiki/local","revid":349662,"updated":"2023-11-18T17:02:32Z","groups":["Multiplayer"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"global","effect":null,"server_exec":false},"exec":null,"description":"Check if given unit is local on the computer in multiplayer games - see Multiplayer Scripting#Locality.\n\nThis can be used to determine on which computer some code must be run. In single player all objects are local.","syntaxes":[{"syntax":"local object","since":null,"effect":null,"exec":null,"params":[{"name":"object","type":null,"optional":false,"default":null,"description":"Object or Group (since Arma 3 v1.32)","types":["Object","Group"],"since":null,"text":"object: Object or Group (since Arma 3 v1.32)"}],"returns":{"type":"Boolean","types":["Boolean"],"description":null,"text":"Boolean"},"form":"unary","operator":null,"left":null,"right":{"text":"object","types":["Object","Group"]}},{"syntax":"local variable = value From Arma 2 v1.00 until Arma 3 v1.54 - see private for later versions","since":"arma2 1.00","effect":null,"exec":null,"params":[],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"unary","operator":null,"left":null,"right":{"text":"variable = value From Arma 2 v1.00 until Arma 3 v1.54 - see private for later versions","types":[]}}],"examples":[{"text":"```sqf\nif (not local _unit) then\n{\n    hint format [\"%1 is remote\", name _unit];\n};\n```","code":["if (not local _unit) then\n{\n\thint format [\"%1 is remote\", name _unit];\n};"]},{"text":"```sqf\n_isLocalGroup = local group _unit;\n```","code":["_isLocalGroup = local group _unit;"]},{"text":"Sets variable's scope:\n\n```sqf\n// from Arma 2 v1.00 until Arma 3v1.54\nlocal _myVariable = 42;\n\n// since Arma 3 v1.54\nprivate _myVariable = 42;\n```","code":["// from Arma 2 v1.00 until Arma 3v1.54\nlocal _myVariable = 42;\n\n// since Arma 3 v1.54\nprivate _myVariable = 42;"]}],"multiplayer":"A few things to note amongst others:\n- A game logic / module is always local to the server\n- Terrain objects are local to every machine","problems":null,"aliases":[],"see_also":["Arma 3: Event Handlers","owner","setOwner"],"notes":[],"categories":[]}