@name Link Props To Array
@inputs DamageDetector:wirelink
@persist Blocks:array
@trigger 

interval( 10 )
runOnLast( 1 )

while ( Blocks:count() < 10 && propCanCreate() )
{
    NewBlock = propSpawn( "models/hunter/blocks/cube1x1x1.mdl", 0 )
    Blocks:pushEntity( NewBlock )
    
    DamageDetector[ "Entities", array ] = Blocks
    DamageDetector[ "On", number ] = 1
}

for ( I = 1, Blocks:count() )
{
    Block = Blocks[ I, entity ]
    if ( Block == DamageDetector[ "Victim", entity ] )
    {
        Block:setColor( vec( 255, 0, 0 ) )
    }
    else
    {
        Block:setColor( vec( 255, 255, 255 ) )
    }
}

if ( last() )
{
    Blocks:propDelete()
}


