Hello,
I'm trying to make the background change when the player has an object in the inventory but without success.
The code is as follows:
Code: ags
The idea is:
Room 1 has a streetlight shut off.
Player walks in Room 2, remove a spanner from a generator
Generator starts running
Player goes back to Room 1 and the streetlight is on
To do this I thought to make the program check the presence of the spanner inside the inventory.
Obviously I'm doing something the wrong way.
Thank you in advance.
I'm trying to make the background change when the player has an object in the inventory but without success.
The code is as follows:
function room_AfterFadeIn()
{
if (player.ActiveInventory == iSpanner)
{
SetBackgroundFrame(1);
}
else
{
SetBackgroundFrame(0);
}
}
The idea is:
Room 1 has a streetlight shut off.
Player walks in Room 2, remove a spanner from a generator
Generator starts running
Player goes back to Room 1 and the streetlight is on
To do this I thought to make the program check the presence of the spanner inside the inventory.
Obviously I'm doing something the wrong way.
Thank you in advance.