Update Variables from script to script?

How can I update variables on a script located on the player from a script located on an object? I’ve read about setters and getters but haven’t seen a simple example beyond pseudo code, or maybe that’s even the wrong approach. Suggestions welcome!

Well, first you need to get the player object (by using for example "GameObject.FindGameObjectWithTag(tag)) then you use “playerVariable.GetComponent(scriptName)”, and hou store it as Script or something, Than “script.variable = key”
function Update() { var player : GameObject = GameObject.FindGameObjectWithTag("player"); var scr : YourScript = player.GetComponent(YourScript); Src.YourVariable = whatevervalue; }