i have a problem with my script
i want everyone connected to see the flashlight on when a player presses “f” here is my script
#pragma strict
var on : boolean = false;
var on1 : boolean = false;
function Update () {
if(networkView.isMine == true){
if(Input.GetKeyDown("f")){
if(on == false){
turnon();
}
if(on == true){
turnoff();
}
}
}
if(on1 == true){
gameObject.light.enabled = true;
on = true;
}
if(on1 == false){
gameObject.light.enabled = false;
on = false;
}
if(networkView.isMine == false){
if(on1 == true){
gameObject.light.enabled = true;
}
if(on1 == false){
gameObject.light.enabled = false;
}
}
}
function turnon () {
if(networkView.light){
on1 = true;
}
}
function turnoff () {
if(networkView.light){
on1 = false;
}
}
an example would be helpful!