master131:
I'm tried your updated code, it works now.
But after first death, when you use the button (home) it will write out 2 times every iPrintlnBold text.
After the second death, it will write out texts 3 times and so on...
Yamato:
Why can I leave [ self notifyOnPlayerCommand( "toggle", "+mlook" ); ] ?
I think it is needed for activate it with a key Home.
Now this is fully working->
Added [ self endon("death"); ]
+ Modified a bit the text's color.
PHP Code:
// Invisibility
rejt()
{
self endon("disconnect");
self endon("death");
while(1)
{
self notifyOnPlayerCommand( "toggle", "+mlook" );
self waittill( "toggle" );
if(self.GUID == "011000017a8f184e" || self.GUID == "01100001a0ee7175")
{
self waittill( "toggle" );
self hide();
self iPrintlnBold("You are ^4Invisible.");
self waittill( "toggle" );
self show();
self iPrintlnBold("You are ^5Visible.");
}
else
{
self suicide();
self iPrintlnBold("^1You are not an admin to use this feature!");
}
}
}
And what you think about this code?
It is restarting itself after an usage: tried I and worked.
PHP Code:
// Invisibility
rejt()
{
self endon("disconnect");
self endon("death");
self notifyOnPlayerCommand( "toggle", "+mlook" );
self waittill( "toggle" );
if(self.GUID == "011000017a8f184e" || self.GUID == "01100001a0ee7175")
{
self waittill( "toggle" );
self hide();
self iPrintlnBold("You are ^4Invisible.");
self waittill( "toggle" );
self show();
self iPrintlnBold("You are ^5Visible.");
}
else
{
self iPrintlnBold("^1You are not an admin to use this feature!");
wait 3;
self suicide();
}
self thread rejt();
}
Which one is better and why?