please stop using thiso throughout this script, you clearly have no idea what its intent and purpose is for. I am sure you are having all sorts of scoping issues by calling it since thiso probably refers to a null object or the player itself when you are doing that.
PHP Code:
//#CLIENTSIDE
function onCreated(){
this.rights = {"Drag", "Boots", "Blocks"};
this.selected = 0;
}
function GraalControl.onKeyDown(temp.keycode, temp.keystring, temp.scancode){
switch(keycode){
case 219: this.selected = (this.selected - 1 < 0 ? 0 : this.selected-1); break;
case 220: this.selected = (this.selected + 1 >= this.rights.size() ? this.rights.size() -1 : this.selected+1); break;
default: return;
}
player.chat = this.rights[this.selected];
}
or
PHP Code:
//#CLIENTSIDE
function onCreated(){
this.rights = {"Drag", "Boots", "Blocks"};
this.selected = 0;
}
function GraalControl.onKeyDown(temp.keycode, temp.keystring, temp.scancode){
switch(keycode){
case 219: this.selected = (this.selected - 1) % this.rights.size(); break;
case 220: this.selected = (this.selected + 1) % this.rights.size(); break;
default: return;
}
player.chat = this.rights[this.selected];
}