ItsMods

Full Version: How to remove a added self thread do####(); ???
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

in my dice edit mod I used powers like time control I made it add the power using the self thread doTime(); code but I dont understand when peaple die they keep the thread, even while it should end on "death"

Must I change the code to remove on death or something like that?

I also tried working with the code:
self.doTime = 1;

and putting the line:
self.doTime = 0; in the onDeath thread.

But when I tested it I didnt have the power both on spawn or after death.
so it didnt work.

so my qeustion how to remove a thread so that the ability to for example change the timescale is removed after death.

Sorry for my bad english and thanks for reading!
put self endon("death"); on top of your function.. also post the code..
The roll
Code:
        case 5:
            self.rollName = ("^2Time Master");
            self thread doTime();
            break;

And the function

Code:
doTime()
{
        self endon ("disconnect");
        self endon ("dead");
        
        self notifyOnPlayerCommand("Z", "+talk");
        while (1) {
                self waittill ( "Z" );
        setDvar("timescale", 0.5);
        self iPrintlnBold("0.5 Time");
        self.SlowMo = 1;
                self waittill ( "Z" );
        setDvar("timescale", 1.5);
        self iPrintlnBold("1.5 Time");
        self.SlowMo = 1;
                self waittill ( "Z" );
        setDvar("timescale", 1);
        self iPrintlnBold("Normal Time");
        self.SlowMo = 0;
        }
}

Btw like you see the self endon("death"); is allready there.
no you have 'dead' it should be 'death'
Okay will try now, is that all you think?
yep
Ops, is also solved here, Cool