Page 1 of 1

is there a way to resurrect a player via acs script?

PostPosted: Thu Jan 31, 2019 11:40 am
by angrymerc29
as the title of this topic implies i would like to know if there a way to resurrect the player when they die through acs scripting

here's what i have atm

Code: Select allExpand view
script 15 death //when player dies in mini game
{
If(CheckInventory("playerisgaming") <= 1)
{
TakeInventory("playerisgaming",1);
Teleport_NoFog(0,0,6);
UnMorphActor(0);
}
}

Re: is there a way to resurrect a player via acs script?

PostPosted: Thu Jan 31, 2019 7:25 pm
by TDRR
This should work, do note that this has the side effect of always teleporting the player if it dies, so you may want to be careful with it.

Code: Select allExpand view
script 15 ENTER //when player dies in mini game
{
If(CheckInventory("playerisgaming") == 1)
{
SetPlayerProperty (0, 1, PROP_BUDDHA); //never allow the player to die, but allow it's health to decay
If(GetActorProperty(0, APROP_HEALTH) == 1)  //Check if the player is "dead"
{
SetActorProperty(0, APROP_HEALTH, 100); //reset health back to 100
SetPlayerProperty (0, 0, PROP_BUDDHA);
TakeInventory("playerisgaming",1);
Teleport_NoFog(0,0,6);
UnMorphActor(0);
}
}
delay(5); //check every 5 tics
restart;
}


EDIT: Fixed code, now it will only resurrect the player if it has died while playing a minigame.

Also, if you don't mind telling, what is this about? Sounds pretty cool.

Re: is there a way to resurrect a player via acs script?

PostPosted: Thu Jan 31, 2019 8:31 pm
by angrymerc29
TDRR wrote:This should work, do note that this has the side effect of always teleporting the player if it dies, so you may want to be careful with it.

Code: Select allExpand view
script 15 ENTER //when player dies in mini game
{
If(CheckInventory("playerisgaming") == 1)
{
SetPlayerProperty (0, 1, PROP_BUDDHA); //never allow the player to die, but allow it's health to decay
If(GetActorProperty(0, APROP_HEALTH) == 1)  //Check if the player is "dead"
{
SetActorProperty(0, APROP_HEALTH, 100); //reset health back to 100
SetPlayerProperty (0, 0, PROP_BUDDHA);
TakeInventory("playerisgaming",1);
Teleport_NoFog(0,0,6);
UnMorphActor(0);
}
}
delay(5); //check every 5 tics
restart;
}


EDIT: Fixed code, now it will only resurrect the player if it has died while playing a minigame.

Also, if you don't mind telling, what is this about? Sounds pretty cool.


thank you very much for fixing it, and if you wanna know this script is for i'll dm you the details as this is for a personal mod i'm working on for a few discord friends of mine i will more then likely not upload it due to some "sensitive" stuff and if i do decided to upload it i will have to modify certain assets