Quote:
|
Originally Posted by excaliber7388
as well as the weapon switching, I don't know how to set a player's weapon
|
Hello again ive combined a few things for you to look at
NPC Code:
if (keypressed) {
if (keydown2(keycode(r),true)) {
for (i=0;i<weaponscount;i++) {
if (strequals(#w(i),Bomb)) {
selectedweapon = i;
}
}
}
}
Basically its just going through Indexes of the weapons until it finds bomb, then setting "Selectedweapon" to Bomb.
You could use it probably for a whole inventory system by just setting a string like "Equipped Weapon" and replacing bomb with your string to always set it.
Good Luck.