function armor::onTrigger(%armor, %player, %slot, %value)
{
%client = %player.client;
if(%slot == 0 && %client.isGhost == 1 && %client.cooldown < $Sim::Time)
{
%client.cooldown = $Sim::Time + 1;
initContainerRadiusSearch(%player.getPosition(),5,$Typemasks::CorpseObjectType);
%hasFoundIdealCorpse = 0;
while(%corpse = containerSearchNext())
{
talk("Alamo");
%hasFoundCorpse++;
if(%client == %corpse.client)
{
%client.chatMessage("\c3You can't use your own corpse to revive!");
}
else if(%hasFoundIdealCorpse == 0)
{
%hasFoundIdealCorpse++;
%client.chatMessage("\c3A corpse has been detected! You are being reborn...");
%client.isGhost = 0;
%client.player.schedule(33, delete);
%client.createPlayer(%corpse.getTransform());
%corpse.delete();
}
}
if(%hasFoundCorpse == 0)
{
%client.chatMessage("\c3You have tried to ressurect yourself, but there are no corpses in the area.");
}
}
parent::onTrigger(%armor, %player, %slot, %value);
}
It's fixed, with a HUGE thanks to Alphadin.