Modme Forums

[HELP] Map Crash with “Buyable powerups Scprit”

Game Modding | Call of Duty: Black Ops 3 | General Discussion


ModmeBot:

Thread By: crackc9
Hi all guys :3
I need help on my map
I have follow this tutorial to use "Buyable Powerups Scprit" https://ugx-mods.com/forum/index.php?topic=13388.0
Does not work for me, my map crash (black screen) with use this script.
You have solutions or ideas ?

Cordially, a potato player


ModmeBot:

Reply By: mathfag
If I assume right you have a black screen when you start your map.
Basically your problem is that you have a "connection interrupted" caused by a "while(1)" loop.
To fix this add a wait(0.05); to the script


function buyable_powerup()
{
	level.buyable_powerup_cost = 100; // Cost for powerup
	level.buyable_powerup_cooldown = 20; // Cooldown in seconds for buyable trigger
	while(1)
	{
		while(1)
		{
			buyable_powerup_trig = GetEnt("buyable_powerup_trig", "targetname");	
			buyable_powerup_trig SetHintString("Press and hold &&1 to spawn Powerup [Cost: " + level.buyable_powerup_cost + "]");
			buyable_powerup_trig SetCursorHint("HINT_NOICON");
			buyable_powerup_spawn = struct::get( "powerup_spawn", "targetname" );
			buyable_powerup_trig waittill("trigger", player);

			if(player.score >= level.buyable_powerup_cost)
			{
				player zm_score::minus_to_player_score(level.buyable_powerup_cost);

				break;
			}
wait(0.05); ///////////////HERE/////////
		}

		/*
			If you want a specific powerup, then uncomment the buyable_powerup_spawn below and delete or comment out the one above it.
			Available Powerups: double_points, free_perk, full_ammo, nuke, fire_sale, carpenter, insta_kill, shield_charge, bonfire_sale,
		*/

		buyable_powerup_spawn thread zm_powerups::special_powerup_drop(buyable_powerup_spawn.origin);
		//buyable_powerup_spawn thread zm_powerups::specific_powerup_drop("full_ammo", buyable_powerup_spawn.origin);

		buyable_powerup_trig SetHintString("Recharing...");

		wait(level.buyable_powerup_cooldown);
	}
}

If you have a while(1) loop without a break; return; or wait(); waittill();... it will crash


ModmeBot:

Reply By: Mindmirror

crackc9
Hi all guys :3 I need help on my map I have follow this tutorial to use "Buyable Powerups Scprit" ➩ https://ugx-mods.com/forum/index.php?topic=13388.0 Does not work for me, my map crash (black screen) with use this script. You have solutions or ideas ? Cordially, a potato player

Don't you understand?? This does NOT belong into the category "Public Assets"!


ModmeBot:

Reply By: Abnormal202

Mindmirror
crackc9 Hi all guys :3 I need help on my map I have follow this tutorial to use "Buyable Powerups Scprit" ➩ https://ugx-mods.com/forum/index.php?topic=13388.0 Does not work for me, my map crash (black screen) with use this script. You have solutions or ideas ? Cordially, a potato player Don't you understand?? This does NOT belong into the category "Public Assets"!

lol people don't seem to get it.