O Ilusionista
Captain 100K
Invincibility Item
This code makes invincible (for a while) the player who picks up this item. While the effect is active, the player will blink.
Save this code as iteminv.c and save in your scripts folder
Them simply call it as didhitscript:
Note: add a "score" on the item header, or the engine will give a 1up to who gets this item.
This code makes invincible (for a while) the player who picks up this item. While the effect is active, the player will blink.
Save this code as iteminv.c and save in your scripts folder
Code:
void main(){
// Code to make invincible who picks up a certain item
// O Ilusionista - 2018.03.17
int Time = openborvariant("elapsed_time"); // get the elapsed time
void target = getlocalvar("damagetaker"); // get target entity (who picks the item)
changeentityproperty(target, "invincible", 1); // make the entity invincible
changeentityproperty(target, "invinctime", Time + 2000); // Set the invincible time to 2000 centiseconds
changeentityproperty(target,"blink",2); // make the entity to blink while invincible
}
Them simply call it as didhitscript:
didhitscript data/scripts/iteminv.c
Note: add a "score" on the item header, or the engine will give a 1up to who gets this item.