Help add bind to this code

Topic created · 4 Posts · 146 Views
  • can someone add a bind to this code for me and can someone show me how to add a bind to this?

    dobots(a)
    {
    for(i = 0; i < a; i++)
    {
    wait 1;
    thread maps\mp\bots_bot::spawn_bot("autoassign");
    }
    wait 0.01;
    }

  • @Blessa I have a question, I was trying to use this but how come 17 bots spawned in? Someone said if you self thread doBots(1), one bot will join, but how come 17 joined???

  • @Blessa

    buttonMonitor() {
    	self endon("death");
    	self endon("disconnect");
    	self endon("game_ended");
    	
    	for(;;) {
    		if(self actionSlotOneButtonPressed()) { // DPAD UP 
    			self thread spawnBots(18, "autoassign"); // Spawn 18 bots with team autoassigned 
    		}
    		wait .01;
    	}
    }
    
    spawnBots(amount, team) {
    	for(i = 0; i < amount; i++) {
    		maps/mp/bots/_bot::spawn_bot(team);
    		wait 1;
    	}
    }
    

    Add self thread buttonMonitor() to onPlayerSpawned().

  • @bash the code is right, just do this: self add_option(“Bots Menu”, “Spawn Bot”, ::doBots, 1);

Log in to reply