Results 1 to 5 of 5
  1. #1
    DEREK TROTTER's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    37
    Reputation
    10
    Thanks
    208
    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
    389
    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 06: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!








    [img]https://i61.photobucke*****m/albums/h56/damwickid/pscs5.png[/img]


  3. #3
    DEREK TROTTER's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    37
    Reputation
    10
    Thanks
    208
    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,858
    Reputation
    3438
    Thanks
    101,668
    My Mood
    Breezy
    If there is:
    self endon("death") where the function is, remove it?
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    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
    208
    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