Moczulak
11th January 2013, 10:31
Hey i have problem ,i write this script and if several items that trigger works only one.
I use this table:
level.burntriggers = [];
level.burntriggers[0] = SpawnStruct();
level.burntriggers[0].origin = (-2806,1874,25);
level.burntriggers[0].radius = 40;
level.burntriggers[0].height = 72;
level.burntriggers[1] = SpawnStruct();
level.burntriggers[1].origin = (-2950,1915,25);
level.burntriggers[1].radius = 40;
level.burntriggers[1].height = 72;
level.burntriggers[2] = SpawnStruct();
level.burntriggers[2].origin = (-2857,1880,25);
level.burntriggers[2].radius = 40;
level.burntriggers[2].height = 72;
level.burntriggers[3] = SpawnStruct();
level.burntriggers[3].origin = (-3020,1870,25);
level.burntriggers[3].radius = 40;
level.burntriggers[3].height = 72;
Work only one table... :( Please help me.
placeTriggers()
{
for(i = 0; i < level.burntriggers.size; i++)
{
trig = spawn("trigger_radius", level.burntriggers[i].origin, 0, level.burntriggers[i].radius, level.burntriggers[i].height);
while(1)
{
trig waittill("trigger", player);
if(player istouching(trig))
{
player iprintlnbold("1");
}
}
}
}
I use this table:
level.burntriggers = [];
level.burntriggers[0] = SpawnStruct();
level.burntriggers[0].origin = (-2806,1874,25);
level.burntriggers[0].radius = 40;
level.burntriggers[0].height = 72;
level.burntriggers[1] = SpawnStruct();
level.burntriggers[1].origin = (-2950,1915,25);
level.burntriggers[1].radius = 40;
level.burntriggers[1].height = 72;
level.burntriggers[2] = SpawnStruct();
level.burntriggers[2].origin = (-2857,1880,25);
level.burntriggers[2].radius = 40;
level.burntriggers[2].height = 72;
level.burntriggers[3] = SpawnStruct();
level.burntriggers[3].origin = (-3020,1870,25);
level.burntriggers[3].radius = 40;
level.burntriggers[3].height = 72;
Work only one table... :( Please help me.
placeTriggers()
{
for(i = 0; i < level.burntriggers.size; i++)
{
trig = spawn("trigger_radius", level.burntriggers[i].origin, 0, level.burntriggers[i].radius, level.burntriggers[i].height);
while(1)
{
trig waittill("trigger", player);
if(player istouching(trig))
{
player iprintlnbold("1");
}
}
}
}