Is really simple to use it, here I'll leave a example.
https://wiki.multitheftauto.com/wiki/Slothman/Slothbot
function spawnSlothBot(thePlayer, cmd, skin, weapon, mode, rot, team)
local x, y, z = getElementPosition (thePlayer)
local rot = tonumber(rot) or 0
local team = getTeamFromName(team)
local int = getElementInterior(thePlayer)
local dim = getElementDimension(thePlayer)
local weapon = tonumber(weapon) or 0
local skin = tonumber(skin) or 0
exports["slothbot"]:spawnBot( x, y+1, z, rot, skin, int, dim, team, weapon, mode or "hunting", true )
end
addCommandHandler ( "spawnbot", spawnSlothBot )