Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Selected Weapon (https://forums.graalonline.com/forums/showthread.php?t=27159)

SSRobgeta 04-08-2002 12:31 PM

Selected Weapon
 
How would I do this....
NPC Code:
selectedweapon = 0;


Doesn't seem to work.

joseyisleet 04-08-2002 09:09 PM

-=Josey=-
Is selectedweapon a proper function? If so it would most likely go something like; this.weapon=selectedweapon;. No clue though...

SSRobgeta 04-09-2002 05:19 AM

Quote:

Originally posted by joseyisleet
-=Josey=-
Is selectedweapon a proper function? If so it would most likely go something like; this.weapon=selectedweapon;. No clue though...

Kai said it was once.

Gohan43331 04-09-2002 05:57 AM

I thought selectedweapon was read only...but then again...most things arent (This would approximate to chaning the id of npcs[0] :O )

Saga2001 04-09-2002 03:43 PM

-FooL-

I've seen it used in for loops before. Ex:

NPC Code:

for (i=0;i<weaponscount;i++){
if (strequals(#w(i),bow))selectedweapon=i;
}


Spanko 04-09-2002 05:31 PM

It used to be changeable. After all it's necesarry to normally make custom weapon menus.
(Well it can also be done differently, but there's an in-built variable anyway so you might as well make use of it)

amonrabr 04-10-2002 01:34 AM

Re: Selected Weapon
 
Quote:

Originally posted by SSRobgeta
How would I do this....
NPC Code:
selectedweapon = 0;


Doesn't seem to work.

It works, u will select the first Weapon if u use it..
try something like:

timeout=.1;
if (keydown(3)&&this.a<weaponscount)this.a++;
if (keydown(1)&&this.a>0)this.a--;
selectedweapon=this.a;


All times are GMT +2. The time now is 10:00 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.