I am trying to make an object appear if the player uses an inventory item in room 1. That works fine. But if the player uses the inventory item in another room then i get an error because the object is not in the other room. How would the script look if i wanted the object to appear only in room1 when the inventory item is used.
You can use the Character.Room property to test it:
/* if player used inventory item */
if (player.Room == 1) { /* if the player is in room 1 */
/* turn object on and do stuff */
}
else {} /* otherwise, do nothing */
If you are using AGS 2.62 or earlier, you would have to replace player with character[GetPlayerCharacter()]. I hope this helps. :=
Cool, thanx alot!