Originally Posted by
BaX
I made something like this :
[sharp]trap1()
{
kosa = getent("kosa_1", "targetname");
kosa_kill = getent("kosa_2", "targetname");
kosa_kill enablelinkto();
kosa_kill linkto(kosa);
{
kosa movex(82,5,2);
wait (0.5);
kosa movex(-82,5,2);
wait (0.5);
}
}[/sharp]
And it gives me that error:
When you get an error like that - calling an entity for which there is more than 1 - it is telling you that you need to use getEntArray() (plural) and not getEnt() (singlular).
When you use getEntArray() you must use a for() loop to find each member of the entity set. So, this is what you want:
PHP Code:
trap1()
{
kosa = getentArray("kosa_1", "targetname");
kosa_kill = getentArray("kosa_2", "targetname");
for( i=0; i < kosa.size; i++ )
{
for( j=0; j < kosa_kill.size; j++ )
{
kosa_kill[j] enablelinkto();
kosa_kill[j] linkto( kosa[i] );
kosa[i] movex(82,5,2);
wait( 0.5 );
kosa[i] movex(-82,5,2);
wait( 0.5 );
}
}
}