Zombies Co Op Disabled Friendly Fire(free for all). & Randomly "Cured" Player

broken avatar :(
Created 164 days ago
by Phil168912
0 Members and 1 Guest are viewing this topic.
159 views
broken avatar :(
×
broken avatar :(
Location: englandlondon
Date Registered: 16 November 2020
Last active: 5 days ago
Posts
47
Respect
Forum Rank
Legless Crawler
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Phil168912's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Phil168912's Contact & Social LinksPhil168912Phil168912Phil GibsonPhil81334
Howdy.

This script will basically turn-off friendly fire.
So watch out for each others thrown grenades and spraying bullets.

 &&

A player will be selected at random who will have a "cure" so to speak. Zombies will ignore that player for X amount of time. This time can be adjust by yourself.
 ( this is ideally for those who want to have a little fun by avoiding zombies & your buddies. )
*** untested but should work ok, ill test tomorrow... or when i get an actual decent nights sleep.***

Credits:
TheRevenantSkull - for pointing out teams to me.
& of course:
JohnDoe
Numan
Dr. Dronken
 - for all their help along the way. :)

Simply add-
thread free_for_all_main();
under-
maps\_zombiemode::main();

Then add this to the bottom of your mapname gsc file.
// This handles friendly fire.
free_for_all_main()
{
    players = [];
    players = get_players();
    p1 = players[0];
    p2 = players[1];
    p3 = players[2];
    p4 = players[3];
   
    p1.team = "allies";
    p2.team = "tom";
    p3.team = "dick";
    p4.team = "harry";

// This handles which player gets temporarily "cured" for X amount of time.  It cycles throughout the whole game so don't worry, everyone will get a turn!

    // Duration that no one is cured.
    // 1-5mins. adjust as you wish.
    time = [];
    time[0] = 60;
    time[1] = 120;
    time[2] = 180;
    time[3] = 240;
    time[4] = 300;
   
    // How long a player is cured for.
    // 1-5mins. adjust as you wish.
    is_cured_time = [];
    is_cured_time[0] = 60;
    is_cured_time[1] = 120;
    is_cured_time[2] = 180;
    is_cured_time[3] = 240;
    is_cured_time[4] = 300;
   
    while(1)
    {
        wait(time[randomInt(time.size)]);
        player = randomInt(players.size);
        player.ignoreme = true; //means they wont attack you
        player.is_zombie = true; //means they stop following you
        player.team = "axis"; //axis is zombies
       
        wait(is_cured_time[randomInt(is_cured_time.size)]);
        player.ignoreme = false;
        player.is_zombie = false;
        if(player == p1)
            player.team = "allies";
        else if(player == p2)
            player.team = "tom";
        else if(player == p3)
            player.team = "dick";
        else if(player == p4)
            player.team = "harry";
    }
}
Build mod.
Have fun.
Last Edit: June 22, 2021, 05:13:41 pm by Phil168912

 

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
Loading ...