Im using UNHANDLED EVENT,
if ((what==2) && (type==3)) //Use inventory on object
{
player.Say("Dont work.");
}
the problem is that it works ok but not on an object with this code on it:
function hElectdoor_UseInv()
{
if (player.ActiveInventory == iCtrluni)
{
player.Walk(130, 125, eBlock, eWalkableAreas);
player.FaceObject(oPorton, eBlock);
aClick.Play();
Wait(5);
aDoorclose.Play();
hElectdoor.Enabled = false;
oPorton.Visible = true;
player.Say("Listo, la puerta esta abierta.");
}
}
If the function "function hElectdoor_UseInv()" is running it doesnt work :( //i think it doesnt matter the code, just that the useinv function is on.
Example: I got a garage door that opens only with an inventory item (remote control). I got a (bottle) as another inventory item.
If i use the (bottle) on the door it would be great that the "Dont work" message would be displayed, but because the function hElectdoor_UseInv() have code on it for the
remote control to open the door, if i use the bottle on the door the message wont display so the unhandled event dont work.
So is there any option for this to happen in the rigth way?:confused:???
I need it in the simple way possible because im not a programer.
function hElectdoor_UseInv()
{
if (player.ActiveInventory == iCtrluni)
{
player.Walk(130, 125, eBlock, eWalkableAreas);
player.FaceObject(oPorton, eBlock);
aClick.Play();
Wait(5);
aDoorclose.Play();
hElectdoor.Enabled = false;
oPorton.Visible = true;
player.Say("Listo, la puerta esta abierta.");
}
else if "Don't work."; // probably the easiest solution.
}
Asked an answered just a few days ago: http://www.adventuregamestudio.co.uk/forums/index.php?topic=52905.msg636525113#msg636525113