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

Challenges for perks?

broken avatar :(
Created 3 years ago
by kobaloi147
0 Members and 1 Guest are viewing this topic.
367 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 7 November 2020
Last active: 3 years ago
Posts
1
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
kobaloi147's Groups
kobaloi147's Contact & Social Links
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;
}

 
Loading ...