Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* should work for any sector that has a tag that is only used for lava in that level and has the udmf custom property for lava checking set to a positive number; you don't need to keep track of what lava sectors are tagged */
- Script 1 ENTER
- {
- int lava_check, player_sector, i;
- while(true)
- {
- lava_check = 0;
- player_sector = 0;
- i = 0;
- if(GetActorProperty(0, APROP_Waterlevel) >= 3) /* if submerged */
- {
- while(player_sector == 0) /* loop to check, with break if it finds it before maximum sector tag */
- {
- if(ThingCountNameSector("playerclassname", 0, i); /* set player class name to what you are actually using */
- {
- player_sector = i; /* if the above returns true, the player is in sector tagged with "i" value */
- }
- if( (i > 65536) && (!player_sector) ); /* stops before it causes a runaway script */
- {
- player_sector = -1; /* exits the loop without a sector tag being applied */
- }
- ++i;
- }
- if(player_sector) /* if player sector was successfully found */
- {
- /* check if the udmf custom sector property for lava is set to a positive value */
- /* note that you could use different values to do different things if you wanted */
- if(GetSectorUDMFInt(player_sector, "lava_property")) /* set "lava_property" to whatever you want */
- {
- /* do the give item stuff or whatever you want here */
- }
- }
- }
- Delay(1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement