Author Topic: if( !isObject( %obj.spawnBrick ) ) is always true.  (Read 996 times)

Whenever I try to check if the item is set on the brick, it is always true, even if the item is actually set on a brick.
Code: [Select]
function sonicRingItem::onAdd( %this, %obj )
{
if( !isObject( %obj.spawnBrick ) )
{
echo( isObject( %obj.spawnBrick ) );
%obj.schedule( 6000, "fadeOut" );
%obj.schedule( 7000, "delete" );
}
parent::onAdd( %this, %obj );
}
Yes, it's in package.
« Last Edit: November 18, 2012, 04:14:05 AM by Crystalwarrior »

Yes, it's in package.

Not really related to the actual question, but it doesn't need to be in a package.

Call the parent first.


Nevermind, I found the alternative to this. Could be helpful to know what's the problem here, though!


Calling the parent in this context would call ItemData::onAdd.

Calling the parent in this context would call ItemData::onAdd.
Yes, yes it would.

Has %obj.spawnBrick worked with other items before?
I know that variable works with players and vehicles but I've never done it with items.