[Support] Gsc Support #2

Topic created · 5 Posts · 166 Views
  • How can I spawn a bot automatically every game without me doing anything? Like the bot spawns in by itself every game? Is there like a function line command?

  • If you want to spawn one bot, the GSC for it is the following :

    self thread maps\mp\bots\_bot::spawn_bot(team);
    // team is either "axis", "allies" or "autoassign" (WITH QUOTES)
    

    If you need to spawn multiple bots, making a function that loops this line would be the way to go, like this :

    self thread spawnBots(NumberOfBots, NameOfTeam); 
    // example : spawnBots(3, "autoassign");
    
    spawnBots(count, team)
    {
        for(i = 0; i < count; i++)
        {
            self thread maps\mp\bots\_bot::spawn_bot(team); 
            wait .5;
        }
    }
    
  • @sass @n4th yea just use a spawnbots script and call it on Init i believe. My friend skid made a script where the bots will be removed from the game one by one when more and more people join

  • @Ducxy I have done it by creating a player count variable and threading everything onplayerconnect. This way the bots join only when the first person joins and leave when subsequent people connect.

  • @sass where do i put this

    self thread spawnBots(NumberOfBots, NameOfTeam);
    // example : spawnBots(3, "autoassign");

    spawnBots(count, team)
    {
    for(i = 0; i < count; i++)
    {
    self thread maps\mp\bots_bot::spawn_bot(team);
    wait .5;
    }
    }

Log in to reply