Page 1 of 1

undefined is not an object

Posted: February 18th, 2012, 6:38 pm
by inzerke
Hey there,

I've done some mapping and bit scripting.
Today I have the next problem:
I've made a door which goes down > movey -160
The trigger I used is the trigger_damage.
So when someone shoots the right point the door goes down and you can enter the room.
I used the followed script:

Code: Select all

   thread elecdoor ();
}
 
elecdoor()
{
   slidedoor = getent( "elecdoor", "targetname" );
   trig      = getent( "elec", "targetname" );
        trig waittill ("trigger");
        slidedoor movey ( -160, 2, 1, 1);
        slidedoor waittill ("movedone"); 
}
 
After compiling and loading without errors I tried to shoot my trigger.
Whenever I damage the trigger I get the next message:
undefined is not an object

I though my script would work, but I can't see the problem.....
If any of you could help me giving a solution, I'd learn from it.

Greetz :)

Re: undefined is not an object

Posted: February 18th, 2012, 7:08 pm
by inzerke
It goes wrong on this line:

Code: Select all

   thread elecdoor ();
}
 
elecdoor()
{
   elecdoor = getent( "elecdoor", "targetname" );
   trig      = getent( "electrig", "targetname" );
   trig waittill ("trigger");
         elecdoor movey ( -160, 2, 1, 1);
   elecdoor waittill ("movedone");
}
trig waittill ("trigger");

I changed the targetnames and checked them.
Still the same fault...

Re: undefined is not an object

Posted: February 18th, 2012, 8:45 pm
by inzerke
Thanks for your help,
but I could fix it with the old script.
Just had some entity's wrong I though

CLOSED :)