**********
**Fixed**
**********
I am currently trying to make a script to teleport the player along a set path by using structs that are numbered using "script_noteworthy".
The trigger is threaded into the function and the structs that are to be used as TP points are all targeted by the trigger and have seperate KVP's
I.E:
"script_noteworthy - 1"
"script_noteworthy - 2"
and so on.
When nothing happens when activating the trigger
I want to know why but I when I try to assign the trigger from structs to the path array it doesn't work
function multiSetTP()
{
structs = struct::get_array(self.target,"targetname");
path = ();
for(i=0;i<(structs.size);i++)
{
for(y=0;y<(structs.size);y++)
{
if((structs(i).script_noteworthy) == y)
{
path(i) = structs(i);
}
}
}
while(1)
{
self waittill("trigger",player);
for(x=0;x<(structs.size);x++)
{
IPrintLnBold(structs(x).script_noteworthy);
}
IPrintLnBold(path.size);
foreach(player in GetPlayers())
{
if(player IsTouching(self))
{
for(i=0;i<structs.size;i++)
{
thread sendPlayer(player,path(i));
wait(level.waitTime);
}
}
else
{
IPrintLnBold(player + " is not close enough");
}
}
}
}
Turns out when comparing i to the script_noteworthy I was comparing two different data_types. converting the kvp value to a integer worked flawlessly