in this script i have,
var opensavingthrow : int = 1;
var hacksavingthrow : int = 1;
var amiaHACKdoor : boolean = false;
var playerholder : GameObject;
var player : player_script;
function OnTriggerEnter (other : Collider) {
if(amiaHACKdoor == true){
if(other.GetComponent(player_script).Hackskill >= hacksavingthrow){
DestroyObject (gameObject);
player.pointtext.text = "-door hacked open.";
}
else if(other.GetComponent(player_script).Openskill < opensavingthrow){{
player.pointtext.text = "-Hack skill required:"+hacksavingthrow;
}
}
else if(amiaHACKdoor == false){
if(other.GetComponent(player_script).Openskill >= opensavingthrow){
DestroyObject (gameObject);
player.pointtext.text = "-door picked open.";
}
else if(other.GetComponent(player_script).Openskill < opensavingthrow){{
player.pointtext.text = "-Lockpick skill required:"+opensavingthrow;
}
}
}
function Start(){
playerholder = GameObject.FindGameObjectWithTag("Player");
player = playerholder.GetComponent(player_script);
}
but comes up with the error,
Assets/scripts/skilltest.js(16,47): BCE0044: expecting :, found '='.
but at that line,
player.pointtext.text = "-Hack skill required:"+hacksavingthrow;
there is no equals sign at that point, the error message says it's in the middle of the word skill, in the string. I tried copying the script, deleting it, making a new script, and pasting it in, but that didn't work.
Any ideas?
↧