{"name":"publicVariableClient","title":"publicVariableClient","type":"command","url":"https://community.bistudio.com/wiki/publicVariableClient","revid":379458,"updated":"2026-10-31T00:09:12Z","groups":["Multiplayer","Variables"],"status":"ok","games":{"arma2oa":"1.62","tkoh":"1.00","arma3":"0.50"},"since":"arma2oa 1.62","arma3_since":"0.50","description":"Send the variable value to the client computer - same limitations regarding variable type as publicVariable.\n\nThe Client ID is the temporary ID given to a connected client for that session. You can find out this ID with the owner command (using it on a player's character, for example, will give you that players client ID).\n\n> [!NOTE]\n> **Arma 3:** In Arma 3 it is possible to broadcast nil value","syntaxes":[{"syntax":"clientID publicVariableClient varName","params":[{"name":"clientID","type":"Number","type_expr":"Number"},{"name":"varName","type":"String","type_expr":"String"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"clientID"},"right":{"text":"varName"}}],"examples":[{"code":["3 publicVariableClient \"CTFscoreOne\";"]}],"see_also":["clientOwner","owner","publicVariable","publicVariableServer","addPublicVariableEventHandler","remoteExecutedOwner"],"notes":[{"user":"Kylania","date":"2012-08-24T00:00:00Z","text":"publicVariableServer (run on client)\npublicVariableClient (run on server)\n\nPublishes a variable (name as STRING) to a specific client, from the server. This is useful where you want to synchronize a variable with only a specific client.\n\nThis is a useful way to cut down on network traffic, as publicVariable commands are issued as a priority message. So use publicVariable sparingly, and these commands where they apply. - [Rocket](http://forums.bistudio.com/showthread.php?136494-ARMA-2-OA-beta-build-94209-(1-60-MP-compatible-build-post-1-60-release)&p=2179795&viewfull=1#post2179795)"},{"user":"Killzone_Kid","date":"2013-09-21T00:00:00Z","text":"While publicVariable is JIP compatible and persistent, publicVariableClient is not. If you log out then log in with the same owner id the public variable sent to your client prior will be nil.\n\n```sqf\n//server\npv = 123;\n3 publicVariableClient \"pv\";\n//connected client with id 3\nhint str pv; //123\n//\n//client log out/log in\n//\n//client id is still 3\nhint str pv; //error, undefined variable pv\n```"},{"user":"Killzone_Kid","date":"2015-04-12T09:27:00Z","text":"Tested in Arma 3 v1.43, publicVariableClient works client-to-client if owner id of the targeted client is known."}]}