Jump to content

[REL] SlothBot an AI fighting Bot for MTA


Slothman

Recommended Posts

Posted

Btw, I've noticed one thing: if there are no players on your server and you start resource 'slothbot' and your bots-resource (to spawn some bots on the map) through a console, the bots won't be moving even if you will walk near them.

The trick to get rid of this is simple: restart resource if you are the first joined player.

addEventHandler( 'onPlayerJoin', root, function()
if #getElementsByType( 'player' ) == 1 then
restartResource( getResourceFromName( 'slothbot' ) );
end;
end);

Anybody had such problem ?

---

if someone could make a gui for freeroam

*facepalm*

  • Replies 148
  • Created
  • Last Reply

Top Posters In This Topic

Posted

yeah, thers possibly a problem with the way the bots resume activity when a player returns. ill look into it. restarting the resource is probably a bad idea, cause it could cause other trouble.

Posted

I noticed that when I use the exported function of creating a Bot, it creates me 3 bots, and I want only 1. This is a problem of your resource, of you did it like that? Thanks, Slothman.

Posted

It must be your script. the bot will only be created 1 time. but if you are the person who had the trouble with spawning bots using "onResourceStart", then you need to make sure you don't have it set to happen when EVERY resource starts.

Posted

You need to make a script which creates the slothbot.

The slothbot doesn't mean they spawn, but they're the source of these bots.

Use export functions to make it.

  • 1 month later...
Posted

very thank you about the resource.. BTW, we are the same indonesian people.. hehehe.. can i know contact of you, ym or fb?? so i can contact u if i have a problem.. pm me....

  • 3 weeks later...
Posted

I tested it, and it's pretty good :D it would be nice if someone could create a GUI, for spawning, team skins weapons etc. really hard i think, but i really suck at GUI and scripting :) Nice script!!

Posted

k i tried something with the example spawn script, this is the code:

It's about spawnbot1, it says bad argument @ Getelementinterior and dimension, string defined function, what am i doing wrong?? Sorry for asking, but i would really like bodyguards etc.

EDIT: it starts now, but doesnt set it in team GNR, new code:

  
  
function Spawnbot1 (source) 
local dimen = getElementDimension (source) 
local inter = getElementInterior (source) 
local x,y,z = getElementPosition (source) 
local rot= 90 
local skin=220 
local interior=inter 
local dimension=dimen 
local team=GNR 
local weapon=26 
local mode= "guarding" 
local modesubject=source 
call (getResourceFromName("slothbot"), "spawnBot", x, y+5, z, rot, skin-9, interior, dimension, team, weapon, mode, modesubject) 
call (getResourceFromName("slothbot"), "spawnBot", x, y+7, z, rot, skin-9, interior, dimension, team, weapon+2, mode, modesubject) 
end 
  
addCommandHandler("spawnbot", Spawnbot1) 
  
function Spawnbot2 (source) 
local x,y,z = getElementPosition (source) 
local rot= 90 
local skin=22 
local interior=inter 
local dimension=dimen 
local team=GNR 
local weapon=26 
local mode= "guarding" 
local modesubject=source 
call (getResourceFromName("slothbot"), "spawnBot", x, y+5, z, rot, skin, interior, dimension, team, weapon, mode, modesubject) 
call (getResourceFromName("slothbot"), "spawnBot", x, y+7, z, rot, skin, interior, dimension, team, weapon+2, mode, modesubject) 
end 
  
addCommandHandler("spawnbot2", Spawnbot2) 

Thanks for any help

btw yes i am team GNR i set it in admin panel

EDIT2: lolz sorry it works now, i should have looked it trough better before posting :(

EDIT3: 1 question, i would like to make it respawn after death, how to use onbotwasted, im kinda a noob :)

coul i do this: addEventHandler ( onBotWasted, Name bot, function ) will that work?

  • 2 months later...
Posted

I love it :) Is there any progress with it?

EDIT: Is your Zombies resource has better synchronization or AI? If it is, can you port it to SlothBot?

  • 1 month later...
Posted

Hey Slothman. I making some gamemode using your resource, and i have one problem.

I made paths in Map Editor, than i connected them together.

In gamemode, i spawn bots at this paths, but bots just staying on the one place, they only start move when some player running at them

  • 4 weeks later...
Posted

Hi this resource is great and i am a newbie in lua.

I want to give the bot m4

  
call (getResourceFromName("Slothbot"), "spawnBot", 2031.7695,1008.1705,10.5474+10, 10) 
call (getResourceFromName("Slothbot"), "setBotWeapon", [b]WHAT DO I HAVE TO PUT HERE[/b], 31) 
  

What do i have to put there?

Posted

That was confusing, the call returns the bot element.

bot = call (getResourceFromName("Slothbot"), "spawnBot", 2031.7695,1008.1705,10.5474+10, 10) 
call (getResourceFromName("Slothbot"), "setBotWeapon", bot, 31)  

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...