first;
- you become invisible
- when invisible you can't die ! (you get hurt but your health then isn't 100 or 0 but (depending on how much you get hurt)-999....a bit like godmode)
- after you become visible again you still can't die.
second;
- you become invisible
- when invisible you can't die !
- when you don't get hurt while invisible and you become visible again you can die and everything is back to normal.
this is the code;
Code: Select all
invisible() //only call this thread
//dont call any other threads, this one handles everything
{
thread waitforconnect();
thread monitortrig();
}
waitforconnect()
{
for(;;)
{
level waittill("connecting",player);
player thread waitforspawn();
}
}
waitforspawn()
{
self endon("disconnect");
self.isInv=false;
for(;;)
{
self waittill("spawned");
self.isInv=false;
}
}
monitortrig()
{
trigger=getent("invisible","targetname");
fx = loadfx ("fx/dust/morpheus_spawnarmorinvis.efx");
invissound = getent("invisible_sound","targetname");
for(;;)
{
trigger waittill("trigger",user);
if(!user.isInv)
{
user.isInv=true;
user iprintln("^2 You have invisibility");
user thread makeinvisible(45);
user playsound("invisibility");
wait 120;
invissound playsound("spawnsound");
playfx (fx, (-100,-996,224));
}
}
}
makeinvisible(time)
{
self endon("disconnect");
self endon("killed_player");
self endon("spawned");
self detachall();
self setmodel("");
wait time;
self.isInv=false;
if(!isdefined(self.pers["savedmodel"]))
maps\mp\gametypes\_teams::model();
else
maps\mp\_utility::loadModel(self.pers["savedmodel"]);
self iprintln("^2 Invisibility has worn off");
I also turned off the armor script iznogod made but to no avail.
Maybe awe is f*cking things up but I turned it off on the morpheus map.