Event When Attempting To Use Item

Started by SilverSpook, Wed 18/11/2015 20:52:33

Previous topic - Next topic

SilverSpook

Is there a way to have a certain script happen whenever you attempt to use a certain item on anything?  For example, the player has a lighter and if they try to use it without any fuel inside I want a message to say, "I can't use this till I find some fuel." 

I see you can set in the events properties "Use inventory on this item", but that only works when another inventory item is used on it.  Is there somewhere you can make an event like, "This item used on anything" sort of function?

Thanks!

Grok

This aught to do the trick

Code: ags

function on_mouse_click(MouseButton button) 
{
  if(cPerson.ActiveInventory==iLighter)
    {
      Display("I can't use this till I find some fuel.");
    }
}


SMF spam blocked by CleanTalk