UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Teleporter With Multiple set spots

broken avatar :(
Created 2 years ago
by zkiller56
0 Members and 1 Guest are viewing this topic.
313 views
broken avatar :(
×
broken avatar :(
Location: ca
Date Registered: 3 February 2016
Last active: 2 years ago
Posts
4
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
zkiller56's Groups
zkiller56's Contact & Social Links
**********
**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
Last Edit: December 19, 2021, 03:43:01 pm by zkiller56

 
Loading ...