Hi
I'm in the middle of doing some scripting and I've come across this:
What would be a script for ' if player has NOT got an inventory item..'
I have other conditions set off by a region as well so it will need to fit in with other bits in the script..
I have used another way but maybe you have a better way?
cheers
barefoot
.
you can use the ! operator to negate any boolean expression.
so if (!player.HasInventory(iKey)) checks if player does NOT have iKey.
Thank you very much Calin :=
barefoot
It's probably better to get used to using the ! operator, but in case it's troubling for you, this would be exactly the same:
if (player.HasInventory(iKey) == false)
Cheers Ryan
2 ways.. great :=
barefoot
or if you really want to complicate your life you could do this:
if (!(player.HasInventory(iKey) == true))
...hehe
Or, without using !, there's
if (player.InventoryQuantity[iKey] == 0)
and if you want a nose-bleed:
if (!(!(player.HasInventory(iKey) == true)) != true)*
*dont try this at home
if (player.HasInventory(iKey) ^ true)
Which is an extremely misleading usage of the XOR operator. :)
if ((player.HasInventory(iKey)) ^ (((true) && (false)) ^ ((true) || (false))))
Do I win? :=
Nosebleed and nausea... ::)
great... cheers guys... :=
barefoot
QuoteI'm glad I didn't participate..
sure sure!! ;)