Is it possible to interact with an object, then that object be deleted?

Started by BockerAlex, Thu 12/06/2008 15:51:11

Previous topic - Next topic

BockerAlex

I was wondering if it was possible for an item (in this case a sign) to be interacted with, so that the display text function will tell the user that they have done something to change it, thus either deleting said item, and putting a different item in their inventory.

So basically; the guy walks up to a sign, the user tells him to interact with the sign, bending off the bars, so that he will only have the sign in his backpack.

I looked through the script dropdown menu thing, but can't find anything that says delete, or remove or anything.
Is there any other function that could do that?

Thanks.

TwinMoon

It's Visible you need.

You need to be aware that objects on the screen are different from inventory items.

The solution to your problem would be to make an inventory item which is only the sign.
When the user interacts with the sign you remove the sign and add the sign to his/her inventory:

Code: ags
oSign.Visible = false;
player.AddInventory(iSign);


oSign is the object in the room and iSign is the inventory item.

SMF spam blocked by CleanTalk