There are two rules for that:
- 1)I can spawn a new weapon only if the player has grabbed the one spawned in the sector.
2)After obtaining a weapon the player must wait at least 30 seconds before I spawn another one.
Here's the code:
Code: Select all
//Weapons Spawn
global int 1:pickup1;//variable used for spawning
script 3 enter {
if(pickup1==0){
int weapon = Random(27,33);//choose weapon to spawn
Thing_Spawn(1,weapon,0,1);//spawn item
pickup1=1;
}
}
//If the player leaves the sector I wait N seconds before spawing
script 4 (void){
delay(35*30);//30 seconds, where 35 tics=1 seconds
pickup1=0;
}
