Hi
I think my mind's gone dead because I can't quite get this to script to work.
I want to check for two conditions if an active inventory item is clicked on another inventory item:
if (player.ActiveInventory == idriver) AND if {player.HasInventory(iwire)); An action happens and of course an ELSE Display("You need some wire first");
In the inventory you can have an electrical plug, screwdriver, pliers and
wire. You should only be able to use the screwdriver on the plug if you have the wire...
Something like this:
function iplug_UseInv()
{
if (player.ActiveInventory == iscrew)
if (player.HasInventory(iwire))
Display("You use the screwdriver to attach the wire to the plug");
cChris.LoseInventory(iwire);
cChris.LoseInventory(iplug);
cChris.LoseInventory(iscrew);
cChris.AddInventory(iplugwire);
Display("You now have a plug with some electrical wire attached.");
}
Should i try and use a dummy screwdriver until the wire has been got or is there a better way?
Can someone with a sound mind please advice..?
cheers
barefoot
Sounds like you want something like:
function iplug_UseInv()
{
if (player.ActiveInventory == iscrew && player.HasInventory(iwire))
{
Display("You use the screwdriver to attach the wire to the plug");
cChris.LoseInventory(iwire);
cChris.LoseInventory(iplug);
cChris.LoseInventory(iscrew);
cChris.AddInventory(iplugwire);
Display("You now have a plug with some electrical wire attached.");
}
}
Sounds good Ben.. of course i should have known.. or do but not on all cylinders at the moment...
cheers
barefoot