How do I find a particular object that contains a particular value

something like this...

if (obj.var < 3)
{
with (obj.var < 3)
{
obj.var += 1;
}
}

//==========================================================================

I want to make it so:

if (a particular obj with the smallest value of var && that are less then a value of 3)
{
// code
}

//==========================================================================

//This should help explain this more!

keep in mind, this script can NOT be attached to the object itself, it must be attached to a different object.

- So if the player touches object2, and object1 exists containing a value < 3, then object1 value will be += 1 and object2 will be deleted.
 

TsukaYuriko

☄️
Forum Staff
Moderator
Almost there. Try something more along the lines of:
GML:
with (object)
{
    if (condition)
    {
        do_thing();
    }
}
 
Top