my game closes with this error message :ObjectOn: Invalid Object specified
in reference to object 3
function hHotspot1_UseInv()
{
if (player.ActiveInventory == (iLasso))
player.Say("Okay.");
object[1].Visible = true;
sLever.Play();
object[2].Visible = true;
object[3].Visible = true;
sLadder.Play();
object[0].Visible = true;
RestoreWalkableArea(6);
}
I have all 4 objects set to false before the character throws a switch. So why 3 of them work and the other one does not.. I have no idea
For a start you had two missing braces:
function hHotspot1_UseInv()
{
if (player.ActiveInventory == (iLasso))
{
player.Say("Okay.");
object[1].Visible = true;
sLever.Play();
object[2].Visible = true;
object[3].Visible = true;
sLadder.Play();
object[0].Visible = true;
RestoreWalkableArea(6);
}
}
Also check out your Object ID's..
Yes, doublecheck if there really is an object 3 in the room.
Also, it's better to give objects (and hotspots!) names. The code will be a lot easier to read and you can avoid referencing objects that don't exist.