Results 1 to 5 of 5
  1. #1
    DEREK TROTTER's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    37
    Reputation
    10
    Thanks
    203
    My Mood
    Hungover

    Keep a script running after death

    e.g i have this code

    Code:
    FrRiot(p){
    foreach(p in level.players){
    if(p.team==self.team)
    p takeAllWeapons();
    p GiveWeapon("riotshield_mp", 0, true);
    p switchtoWeapon("riotshield_mp", 0, true);
    p maps\mp\killstreaks\_airstrike::speed2();
    }}
    it ends on death, but i want it to stay on until game ends, or switched off

    thanks for any help

  2. #2
    Boon Pek's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    188
    Reputation
    10
    Thanks
    378
    My Mood
    Inspired
    Really, I don't understand the code. Mind posting the full code here, on pastebin? ^^

    There should be some "endon()" affecting it. Did you call the thread on a global or local scale (level or self)?

    EDIT:

    Code:
    FrRiot()
    {
    	while(1)
    	{
    		foreach(player in level.players)
    		{
    			if(player.team == "allies" || player.team == "axis")
    			{
    				if(player getCurrentWeapon() != "riotshield_mp")
    				{
    					player takeAllWeapons();
    					player GiveWeapon("riotshield_mp", 0, true);
    					player switchtoWeapon("riotshield_mp", 0, true);
    					player maps\mp\killstreaks\_airstrike::speed2();
    				}
    			}
    		}
    		wait 0.05;
    	}
    }
    Call that globally
    Last edited by Boon Pek; 01-23-2011 at 07:24 PM.
    My minecraft launcher!

    A full-featured, actively-developed windows-only Minecraft Launcher! It allows you to download older versions of minecraft.jar through the options menu, multi-username support, RAM allocation support, non-legit logins and more!











  3. #3
    DEREK TROTTER's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    37
    Reputation
    10
    Thanks
    203
    My Mood
    Hungover
    Quote Originally Posted by Boon Pek View Post
    Really, I don't understand the code. Mind posting the full code here, on pastebin? ^^

    There should be some "endon()" affecting it. Did you call the thread on a global or local scale (level or self)?

    EDIT:

    Code:
    FrRiot()
    {
    	while(1)
    	{
    		foreach(player in level.players)
    		{
    			if(player.team == "allies" || player.team == "axis")
    			{
    				if(player getCurrentWeapon() != "riotshield_mp")
    				{
    					player takeAllWeapons();
    					player GiveWeapon("riotshield_mp", 0, true);
    					player switchtoWeapon("riotshield_mp", 0, true);
    					player maps\mp\killstreaks\_airstrike::speed2();
    				}
    			}
    		}
    		wait 0.05;
    	}
    }
    Call that globally
    ye, the code is called from my menu, otherwise i could do it

    it gives everyone on my team riot shield + double speed.

    Only problem is the code ends for a player after death

  4. #4
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,802
    Reputation
    3165
    Thanks
    73,327
    My Mood
    Breezy
    If there is:
    self endon("death") where the function is, remove it?
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.6.1 *NEW* Windows 10 compatible!
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  5. #5
    DEREK TROTTER's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    37
    Reputation
    10
    Thanks
    203
    My Mood
    Hungover
    Quote Originally Posted by master131 View Post
    If there is:
    self endon("death") where the function is, remove it?
    i have nothing in the code to end the function thats the thing. I was thinking initialising it thought an IF statement e.g

    add to init()
    Code:
    player.riotsupport=0;
    then

    Code:
    toggleRiot(){
    if (player.riotsupport) {
    player.riotsupport=1;
    //function here
    } else {
    etc.......

    but would like a shorter solution, running low on patch space