Quote:
Originally Posted by ffcmike
player.weapons is an array of objects rather than strings.
If you were to do:
PHP Code:
for(temp.w : player.weapons){
echo(temp.w.name);
}
You would see the names of each weapon object.
I wouldn't recommend using that method though, it would take up more script time unnecessarily.
|
Well I was going to use it to check if a player no longer has a skill (and therefore delete the weapon). Is there a better method you would suggest?
I was going to do something like loop:
PHP Code:
function onCheckSkills(){
for(i=0;i<weapon array.size();i++){
if(!(weapon array[i] in client.skills){
removeWeapon(weapon array[i]);
}
}
}
(where "weapon array" is the variable holding the weapon array)