![]() |
Problem with obj.index()
Can anyone tell me why the index gets returned as -1 all the time?
List of my warp rings: PHP Code:
The script. NPC Code: RC. PHP Code:
ADD: Any why doesnt if (hasweapon(weaponname)) work anymore? |
player.weapons is a list of objects I think, not names.
|
Wrong. I tried echo ( player.weapons); and it displayed all my Weapons + some global Weapons.
And I also tried something like this.var = player.weapons; and to use index on that, didnt work either. |
findweapon("name") == value [1/NULL]
Very weird... I've just tried this too, same error. Although it works on other things... [not players.weapons] |
player.weapons is an array. When you output an array then it's outputing its content as string, most objects print their name when you just print the object. I can check this though, to make sure its working correctly.
The function hasweapon(oldstring) is still working, in new scripting it would be findweapon(string)!=NULL. findweapon(string) is searching for a weapon with the specified name in the players inventory. There is also findweaponnpc(string) for finding any existing weapon, although you can also just access the weapons by name, you need to use the correct case though. |
Is
NPC Code:echo( this.warpingrings[i] @ ": " @ findweapon(this.warpingrings[i])); supposed to show i.e. PHP Code:
Shouldnt it show this instead: PHP Code:
|
| All times are GMT +2. The time now is 10:34 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.