Keep a script running after death

Posts 15 of 5 · Page 1 of 1
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
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
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
If there is:
self endon("death") where the function is, remove it?
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
Posts 15 of 5 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Need help?