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

set perks?

broken avatar :(
Created 10 years ago
by KDXDARK
0 Members and 1 Guest are viewing this topic.
3,500 views
broken avatar :(
×
broken avatar :(
Relentless Mapper
Location: al
Date Registered: 21 August 2011
Last active: 3 weeks ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
Nuclear
My Groups
More
×
KDXDARK's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Nuclear
Nuclear
DARKLEGION's requested title
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
KDXDARK's Contact & Social Links
how i can set perks to the player who reach a score number?
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 3 weeks ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Do you mean something like this?
Code Snippet
Plaintext
player = get_players();
if(player.score > 1499)
{
player maps\_zombiemode_score::minus_to_player_score(1500);
player setperk(specialty_quickrevive);
This gives the player the quick revive, but you can obvisouly change it to whatever perk you want.
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 9 months ago
Posts
5,551
Respect
6,691Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
Signature
If Java had true garbage collection, most programs would delete themselves upon execution.
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Do you mean something like this?
Code Snippet
Plaintext
player = get_players();
if(player.score > 1499)
{
player maps\_zombiemode_score::minus_to_player_score(1500);
player setperk(specialty_quickrevive);
This gives the player the quick revive, but you can obvisouly change it to whatever perk you want.
Code Snippet
Plaintext
//assume you have some code to know which player to give this to
if(player.score >= 1500)
{
player maps\_zombiemode_score::minus_to_player_score(1500);
player setperk("specialty_quickrevive");
}
Made some syntax corrections.
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 3 weeks ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Code Snippet
Plaintext
//assume you have some code to know which player to give this to
if(player.score >= 1500)
{
player maps\_zombiemode_score::minus_to_player_score(1500);
player setperk("specialty_quickrevive");
}
Made some syntax corrections.

Opps, I just looked through my scripts and just copy and pasted it, lol thanks for paying attention Treminaor.
broken avatar :(
×
broken avatar :(
Former UGX Lead Asset Creator
Location: ca
Date Registered: 17 August 2012
Last active: 5 years ago
Posts
1,932
Respect
Forum Rank
Zombie Destroyer
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
Personal Quote
Eh?
Signature

(Click to enter portfolio)
×
SajeOne's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
Opps, I just looked through my scripts and just copy and pasted it, lol thanks for paying attention Treminaor.
Also aren't accounting for hud.^^
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 3 weeks ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
How about this then?
Code Snippet
Plaintext
if(player.score >= 1500)	
{
player maps\_zombiemode_score::minus_to_player_score(1500);
player setperk("specialty_quickrevive");

player maps\_zombiemode_perks::perk_hud_create( "specialty_quickrevive" );
player thread maps\_zombiemode_perks::perk_think( "specialty_quickrevive" );
}
Last Edit: April 05, 2014, 09:01:07 am by Ege115
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
I couldn't get the perk giving part to work, but everything else works.

Code Snippet
Plaintext
money_watch()
{
target = 1000; // change this to whatever
cost_points = true;

while(1)
{
players = get_players();

for(i=0;i<players.size;i++)
{
if(players[i].score >= target)
{
if(cost_points == true)
{
iprintln("Taking points:" + target);
players[i] maps\_zombiemode_score::minus_to_player_score(target);

// insert perk giving code here
}
else
{
iprintln("Giving perks...");
// insert perk giving code here
}

}
}

wait(1);
}
}
Last Edit: April 05, 2014, 03:26:17 pm by daedra descent
broken avatar :(
×
broken avatar :(
Relentless Mapper
Location: al
Date Registered: 21 August 2011
Last active: 3 weeks ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
Nuclear
My Groups
More
×
KDXDARK's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Nuclear
Nuclear
DARKLEGION's requested title
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
KDXDARK's Contact & Social Links
How about this then?
Code Snippet
Plaintext
if(player.score >= 1500)	
{
player maps\_zombiemode_score::minus_to_player_score(1500);
player setperk("specialty_quickrevive");

player maps\_zombiemode_perks::perk_hud_create( "specialty_quickrevive" );
player thread maps\_zombiemode_perks::perk_think( "specialty_quickrevive" );
}
i try it and dont work :/

I couldn't get the perk giving part to work, but everything else works.

Code Snippet
Plaintext
money_watch()
{
target = 1000; // change this to whatever
cost_points = true;

while(1)
{
players = get_players();

for(i=0;i<players.size;i++)
{
if(players[i].score >= target)
{
if(cost_points == true)
{
iprintln("Taking points:" + target);
players[i] maps\_zombiemode_score::minus_to_player_score(target);

// insert perk giving code here
}
else
{
iprintln("Giving perks...");
// insert perk giving code here
}

}
}

wait(1);
}
}
this code looks like anti-cheat code(i going to use it), also it dont give me the perk :/

Code Snippet
Plaintext
{
target = 1000; // change this to whatever
cost_points = true;

while(1)
{
players = get_players();

for(i=0;i<players.size;i++)
{
if(players[i].score >= target)
{
if(cost_points == true)
{
iprintln("Taking points:" + target);
players[i] maps\_zombiemode_score::minus_to_player_score(target);

// insert perk giving code here
players[i] setperk("specialty_quickrevive");
}
else
{
iprintln("Giving perks...");
// insert perk giving code here
players[i] setperk("specialty_quickrevive");
}

}
}

wait(1);
}
}
broken avatar :(
×
broken avatar :(
Location: be
Date Registered: 17 August 2013
Last active: 3 years ago
Posts
369
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
Web & Software Developer and Designer
Signature
"Deleted code is debugged code." - Jeff Sickel
"Mathematicians stand on each others' shoulders and computer scientists stand on each others' toes." - Richard Hamming
×
JR-Imagine's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Continuing from daedra's script:
Code Snippet
Plaintext
money_watch()
{
target = 1000; // change this to whatever

while(1)
{
players = get_players();
for(i=0;i<players.size;i++)
{
if( players[i].score >= target && !players[i] HasPerk("specialty_armorvest") )
{
players[i] SetPerk("specialty_armorvest");
players[i] maps\_zombiemode_perks::perk_hud_create("specialty_armorvest");
players[i].maxhealth = level.zombie_vars["zombie_perk_juggernaut_health"];
players[i].health = level.zombie_vars["zombie_perk_juggernaut_health"];
}
}
wait 1;
}
}

Edit: Changed script so jugg will actually do what it's supposed to do. :derp:
Last Edit: April 17, 2014, 11:04:57 am by JR-Imagine
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 10 October 2013
Last active: 4 months ago
Posts
541
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
ProGamerzFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Continuing from daedra's script:
Code Snippet
Plaintext
money_watch()
{
target = 1000; // change this to whatever
cost_points = true;

while(1)
{
players = get_players();
for(i=0;i<players.size;i++)
{
if(players[i].score >= target)
{
if(cost_points == true)
{
players[i] iprintln("Taking points:" + target);
players[i] maps\_zombiemode_score::minus_to_player_score(target);
}
players[i] SetPerk("specialty_armorvest");
players[i] maps\_zombiemode_perks::perk_hud_create("specialty_armorvest");
}
}
wait 1;
}
}

Keep in mind that juggernaut is handled a little bit differently, as it sets the player's health in vending_trigger_think(), so you'll need to set the player's health in the script somehow, or else juggernaut won't work.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
i try it and dont work :/
this code looks like anti-cheat code(i going to use it), also it dont give me the perk :/

Code Snippet
Plaintext
{
target = 1000; // change this to whatever
cost_points = true;

while(1)
{
players = get_players();

for(i=0;i<players.size;i++)
{
if(players[i].score >= target)
{
if(cost_points == true)
{
iprintln("Taking points:" + target);
players[i] maps\_zombiemode_score::minus_to_player_score(target);

// insert perk giving code here
players[i] setperk("specialty_quickrevive");
}
else
{
iprintln("Giving perks...");
// insert perk giving code here
players[i] setperk("specialty_quickrevive");
}

}
}

wait(1);
}
}

It isn't meant to be anti-cheat, but if you want you can use it for that. Id be a bit carefully though because if the target is a number that a player can actually achieve then legit players will be affected by this code aswell.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 10 October 2013
Last active: 4 months ago
Posts
541
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
ProGamerzFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
i try it and dont work :/
this code looks like anti-cheat code(i going to use it), also it dont give me the perk :/

It probably gave you the perk, but didn't set the hud.
broken avatar :(
×
broken avatar :(
Location: gbLondon
Date Registered: 9 April 2014
Last active: 10 years ago
Posts
9
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
Gabe's Groups
why are people making this code soo spread out... I will shrink the script for you..:
Code Snippet
Plaintext
{
cost_points = true;
while(1)
{
players = get_players();

for(i=0;i<players.size;i++)
{
if((players[i].score >= 1000) && (cost_points == true))
{
iprintln("Taking points:" + target);
players[i] maps\_zombiemode_score::minus_to_player_score(target);
// insert perk giving code here
players[i] setperk("specialty_quickrevive");
    }
else
{
iprintln("Giving perks...");
// insert perk giving code here
players[i] setperk("specialty_quickrevive");
}
}
}
wait 1;
}


I have no idea why you are doing two if's if you only need 1 unless there is a specific reason why you are doing so?

Also i had no idea why you are defining a number when you are only using it once?, so i changed it..
Last Edit: April 13, 2014, 07:47:48 pm by Gabe
broken avatar :(
×
broken avatar :(
Relentless Mapper
Location: al
Date Registered: 21 August 2011
Last active: 3 weeks ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
Nuclear
My Groups
More
×
KDXDARK's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Nuclear
Nuclear
DARKLEGION's requested title
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
KDXDARK's Contact & Social Links
why are people making this code soo spread out... I will shrink the script for you..:
Code Snippet
Plaintext
{
cost_points = true;
while(1)
{
players = get_players();

for(i=0;i<players.size;i++)
{
if((players[i].score >= 1000) && (cost_points == true))
{
iprintln("Taking points:" + target);
players[i] maps\_zombiemode_score::minus_to_player_score(target);
// insert perk giving code here
players[i] setperk("specialty_quickrevive");
    }
else
{
iprintln("Giving perks...");
// insert perk giving code here
players[i] setperk("specialty_quickrevive");
}
}
}
wait 1;
}


I have no idea why you are doing two if's if you only need 1 unless there is a specific reason why you are doing so?

Also i had no idea why you are defining a number when you are only using it once?, so i changed it..
but i dont want take players points, i just wanna do when the player reach a score it get a perk :D
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,790
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
why are people making this code soo spread out... I will shrink the script for you..:
Code Snippet
Plaintext
{
cost_points = true;
while(1)
{
players = get_players();

for(i=0;i<players.size;i++)
{
if((players[i].score >= 1000) && (cost_points == true))
{
iprintln("Taking points:" + target);
players[i] maps\_zombiemode_score::minus_to_player_score(target);
// insert perk giving code here
players[i] setperk("specialty_quickrevive");
    }
else
{
iprintln("Giving perks...");
// insert perk giving code here
players[i] setperk("specialty_quickrevive");
}
}
}
wait 1;
}


I have no idea why you are doing two if's if you only need 1 unless there is a specific reason why you are doing so?

Also i had no idea why you are defining a number when you are only using it once?, so i changed it..

that code won't even load, lol.

 
Loading ...