Spoiler: script 1
Spoiler: script 2
Moderator: GZDoom Developers
Spoiler: script 1
Spoiler: script 2
Code: Select all
script 255 (void)
{
If(i == 0) {
GiveInventory("HealthBonus", 5);
Print(s: "You got a snack!");
i++;
}
else If(i == 1) {
GiveInventory("HealthBonus", 5);
Print(s: "You got another snack!");
i++;
}
else If(i == 2) {
GiveInventory("HealthBonus", 5);
Print(s: "You got another snack!");
i++;
}
else If(i >= 3) {
Print(s: "They ran out!");
}
}
Code: Select all
#include "zcommon.acs"
int i=0;
script 255 (void){
if(i<3){
GiveInventory("HealthBonus",5);
if(i==0){Print(s:"You got a snack!");}
else{Print(s:"You got another snack!");}
i++;
}else{Print(s:"They ran out!");}
}