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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - kobaloi147

So I'm trying to write a script that will give a player a perk for completing a challenge. (x number of kills for jug or x number of headshots for deadshot, etc.) I'm new to scripting and learning as I go, can't seem to find anything on it anywhere. Any help greatly appreciated. I had more written but tried to get it working by simplifying it, didn't work.


function jug()
{
    level.totalkills = 5;
    totalkills = 0;
    players = GetPlayers();
    for( i=0;i<players.size;i++ )
        {
            if(isdefined(players.pers["kills"]))
               {
                   totalkills += players.pers["kills"];
               }
                   if(totalkills >= 5)
                   {
                       zm_perks::give_perk(PERK_JUGGERNOG);
                   }
       }
   return totalkills;
}
3 years ago
Loading ...