Post: [Code/Tutorial] How to do bots only functions
07-14-2015, 04:38 PM #1
-Numb
You talkin to me?
(adsbygoogle = window.adsbygoogle || []).push({}); Hello NGU members

I am making this thread because I could not find this anywhere else on NGU or on the web itself.


The code:
    if(isDefined(player.pers["isBot"]) && player.pers["isBot"])


Example on how to use it to freeze bots only
    FreezeBots()
{
foreach (player in level.players)
{
if(isDefined(player.pers["isBot"]) && player.pers["isBot"])
{
player freezeControls(true);
}
}
}

Credits: Gentle

Hope I helped someone! Smile
Last edited by -Numb ; 07-15-2015 at 01:29 AM.

The following 6 users say thank you to -Numb for this useful post:

Gentleツ, HiddenHour, iiiCenTurY, ModyHacker, Rezqaazify

The following user groaned -Numb for this awful post:

John
07-14-2015, 04:41 PM #2
iiiCenTurY
Gym leader
Nice tut but what if i change the clantag of the bot?
07-14-2015, 04:42 PM #3
Im_YouViolateMe
NextGenUpdate Elite
Originally posted by Numb View Post
Hello NGU members

I am making this thread because I could not find this anywhere else on NGU or on the web itself.
I know the code is really easy, but I still get some requests on how I did this..


Put this anywhere
    isBot(player)
{
if(isSubStr(player.name, "[3arc]"))
return true;
else
return false;
}


Example on how to use it to freeze bots only
    FreezeBots()
{
foreach (player in level.players)
{
if(isBot(player)) //Here is how it uses the isBot function
{
player freezeControls(true);
}
}
}


Hope I helped someone! Smile


Or you could try doing:

    
if (isAi(player))
{
}


isAi and isPlayer are already predefined functions

The following 2 users say thank you to Im_YouViolateMe for this useful post:

-Numb, MCabCon
07-14-2015, 04:44 PM #4
This is already out my friend
07-14-2015, 04:45 PM #5
instead of defining bots why not use the code that bots already use?

    if(isDefined(player.pers["isBot"])&& player.pers["isBot"])

The following user thanked Gentleツ for this useful post:

-Numb
07-14-2015, 04:46 PM #6
-Numb
You talkin to me?
Originally posted by iiiCenTurY View Post
Nice tut but what if i change the clantag of the bot?


Never thought of that, lol. Just don't change their clantag Needa
07-14-2015, 04:48 PM #7
-Numb
You talkin to me?
Originally posted by Gentle
This is already out my friend


Where? :O I thought I had been looking everywhere

Originally posted by Gentle
instead of defining bots why not use the code that bots already use?

    if(isDefined(player.pers["isBot"])&& player.pers["isBot"])


I did not know about that, thanks!
07-14-2015, 04:52 PM #8
-Numb
You talkin to me?
Originally posted by YouViolateMe View Post
Or you could try doing:

    
if (isAi(player))
{
}


isAi and isPlayer are already predefined functions


Did not know about that.. Thanks, I may be updating the thread
07-14-2015, 06:46 PM #9
Whats ur skype? I want to talk to you about the match bonus
07-14-2015, 06:54 PM #10
-Numb
You talkin to me?
Originally posted by Gentle
Whats ur skype? I want to talk to you about the match bonus


oterbekk

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo