Crimsondeath
Active member
Hi again, I don't know where to put this topic (Ask and Answer or Scripting), but is there a script to give lifes to the player?
I know there is a "lifescore {int}" in the OpenBOR Manual, but when I give points to the player by script, for example: changeplayerproperty(0, "score", P1Score+5000);
The "lifescore" method didn't give any life to the player even if the required score was reach (only give life when the player kills an enemy or get an score item).
So I'm using this life score script on "score#.c" :
But It gives a life to the player when the score is over 200,000 points (and the player get a life each time he kills an enemy when the stage starts) not each 200,000 points and has the same problem with the "changeplayerproperty(0, "score", P1Score+50000)" function on bonus stages
.
Thanks in advance
I know there is a "lifescore {int}" in the OpenBOR Manual, but when I give points to the player by script, for example: changeplayerproperty(0, "score", P1Score+5000);
The "lifescore" method didn't give any life to the player even if the required score was reach (only give life when the player kills an enemy or get an score item).
So I'm using this life score script on "score#.c" :
C#:
void lifeScore(int player)
{
void self = getplayerproperty(player, "entity");
int score = getplayerproperty(player, "score");
int lifeScore = 200000;
int add = 1;
if(getindexedvar("next1up"+player) == NULL()){
setindexedvar("next1up"+player, lifeScore);
}
if(self != NULL()){
while(score >= getindexedvar("next1up"+player)){
int lives = getplayerproperty(player, "lives");
playsample(openborconstant("SAMPLE_1UP"), 0, openborvariant("effectvol"), openborvariant("effectvol"), 100, 0);
changeplayerproperty(player, "lives", lives+add);
setindexedvar("next1up"+player, getindexedvar("next1up"+player)+lifeScore);
}
}
}
But It gives a life to the player when the score is over 200,000 points (and the player get a life each time he kills an enemy when the stage starts) not each 200,000 points and has the same problem with the "changeplayerproperty(0, "score", P1Score+50000)" function on bonus stages
Thanks in advance