Pun1sheR wrote:He if anyone can help me it would be great. I'm trying to make spinning circle trap fo my map but it doesn't work when I hit the activate button. My other two do idk if its script problem or what but here's my script.
Code: Select all
main()
{
Trap02 = getentarray ("trap02", "targetname");
If (isdefined(trap02))
For (I = 0; I < trap02.size; i ++) <-- THIS
Trap02[i] thread trap02_start();
}
Trap02_start()
{
Brush = getEnt ("trap02", "targetname"); <-- THIS
Trig = getEnt ("trap02_activate", "targetname");
Trig waittill ("trigger", who);
Trig delete();
{
Brush rotateYaw(360,0.5),
Wait 120;
}
}
[/size]
Any ideas what might be wrong?
Trap02 = getentarray ("trap02", "targetname"); // Multiple entities
Brush = getEnt ("trap02", "targetname"); // Single entity
If you have more the one entity in the map called "trap02", you can not use 'getEnt'.
For (I = 0; I < trap02.size; i ++) <-- THIS
'i++' not 'i ++'
Code: Select all
main()
{
trap02 = getEntArray ("trap02", "targetname");
if( isDefined( trap02 ))
for(i = 0; i < trap02.size; i++)
trap02[i] thread trap02_start();
}
trap02_start()
{
trig = getEnt ("trap02_activate", "targetname");
trig waittill ("trigger", who);
trig delete();
self rotateYaw(360,0.5),
wait 120;
}
There are still flaws with the code, but without knowing what you are doing and what you are aiming to achieve, I cannot fix it.