Jump to content

question about slothbot


Chaos

Recommended Posts

Team = createTeam('Test',255,0,0) 
  
function boss ( ) 
       nemesi = exports [ "slothBot" ]:spawnBot ( 1193.314453125, -2038.7626953125, 69.0, 90,  1, 0, 0, Nemesis, 38,         "hunting", true ) 
       nemesi1 = exports [ "slothBot" ]:spawnBot ( 1174.3984375, -2045.65234375, 69.0, 90,  1, 0, 0, Nemesis, 38,         "hunting", true ) 
       nemesi2 = exports [ "slothBot" ]:spawnBot ( 1155.3125, -2021.0068359375, 69.0, 90,  1, 0, 0, Nemesis, 38,         "hunting", true ) 
       nemesi3 = exports [ "slothBot" ]:spawnBot ( 1137.0380859375, -2037.9990234375, 69.0, 90,  1, 0, 0, Nemesis, 38,         "hunting", true ) 
        
setBotTeam ( nemesi ,Team  ) 
setBotTeam ( nemesi1,Team  ) 
setBotTeam ( nemesi2 ,Team  ) 
setBotTeam ( nemesi3 ,Team  ) 
 end 
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), boss ) 
  
  

is that correct ?

Link to comment
Team = createTeam('Test',255,0,0) 
  
function boss ( ) 
       nemesi = exports [ "slothBot" ]:spawnBot ( 1193.314453125, -2038.7626953125, 69.0, 90,  1, 0, 0, Nemesis, 38,         "hunting", true ) 
       nemesi1 = exports [ "slothBot" ]:spawnBot ( 1174.3984375, -2045.65234375, 69.0, 90,  1, 0, 0, Nemesis, 38,         "hunting", true ) 
       nemesi2 = exports [ "slothBot" ]:spawnBot ( 1155.3125, -2021.0068359375, 69.0, 90,  1, 0, 0, Nemesis, 38,         "hunting", true ) 
       nemesi3 = exports [ "slothBot" ]:spawnBot ( 1137.0380859375, -2037.9990234375, 69.0, 90,  1, 0, 0, Nemesis, 38,         "hunting", true ) 
        
       exports [ "slothBot" ]:setBotTeam ( nemesi ,Team  ) 
       exports [ "slothBot" ]:setBotTeam ( nemesi1,Team  ) 
       exports [ "slothBot" ]:setBotTeam ( nemesi2 ,Team  ) 
       exports [ "slothBot" ]:setBotTeam ( nemesi3 ,Team  ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), boss ) 

Link to comment
  • Moderators

by the way, read the syntax clearly.

element spawnBot ( float x, float y, float z, int rotation = 0, [ int skinID = 0, int interior = 0, int dimension = 0, team theTeam = nil, int weapon = 0, string theMode = "hunting", element theModesubject = nil ] )

You don't have to use an extra export.

Link to comment

EDIT

function boss ( ) 
       local Team = createTeam("Nemsis",255,0,0) 
       local nemesi = exports ["slothBot"]:spawnBot (1193.3, -2038.8, 69, 90, 1, 0, 0, Team, 38, "hunting", "following") 
       local nemesi1 = exports ["slothBot"]:spawnBot (1174.6, -2045.7, 69, 90, 1, 0, 0, Team, 38, "hunting", "following") 
       local nemesi2 = exports ["slothBot"]:spawnBot (1155.3, -2021, 69.0, 90, 1, 0, 0, Team, 38, "hunting", "following") 
       local nemesi3 = exports ["slothBot"]:spawnBot (1137, -2038, 69, 90, 1, 0, 0, Team, 38, "hunting", "following") 
end 
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), boss ) 

Link to comment
function boss ( ) 
    local Team = createTeam ( "Nemsis", 255, 0, 0 ) 
    local nemesi = exports ["slothBot"]:spawnBot (1193.3, -2038.8, 69, 90, 1, 0, 0, Team, 38, "hunting", "following") 
    local nemesi1 = exports ["slothBot"]:spawnBot (1174.6, -2045.7, 69, 90, 1, 0, 0, Team, 38, "hunting", "following") 
    local nemesi2 = exports ["slothBot"]:spawnBot (1155.3, -2021, 69.0, 90, 1, 0, 0, Team, 38, "hunting", "following") 
    local nemesi3 = exports ["slothBot"]:spawnBot (1137, -2038, 69, 90, 1, 0, 0, Team, 38, "hunting", "following") 
    local botTeam = exports [ "slothbot" ]:getBotTeam ( nemesi ) 
    if ( botTeam ) then 
        outputChatBox ( "nemesi bot is on the team Nemsis" ) 
    else 
        outputChatBox ( "nemesi bot is not in a team." ) 
    end 
end 
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), boss ) 

Try that and see what it outputs to the chatbox when you start the resource.

P.S: Bots won't show up on the scoreboard ( TAB ).

Link to comment
function boss ( ) 
    createTeam ( "Nemsis", 255, 0, 0 ) 
    local Team = getTeamFromName ( "Nemsis" ) 
    local nemesi = exports [ "slothbot" ]:spawnBot (1193.3, -2038.8, 69, 90, 1, 0, 0, Team, 38, "hunting", "following" ) 
    local nemesi1 = exports [ "slothbot" ]:spawnBot (1174.6, -2045.7, 69, 90, 1, 0, 0, Team, 38, "hunting", "following" ) 
    local nemesi2 = exports [ "slothbot" ]:spawnBot (1155.3, -2021, 69.0, 90, 1, 0, 0, Team, 38, "hunting", "following" ) 
    local nemesi3 = exports [ "slothbot" ]:spawnBot (1137, -2038, 69, 90, 1, 0, 0, Team, 38, "hunting", "following" ) 
    local botTeam = exports [ "slothbot" ]:getBotTeam ( nemesi ) 
    if ( botTeam ) then 
        outputChatBox ( "nemesi bot is on the team Nemsis" ) 
    else 
        outputChatBox ( "nemesi bot is not in a team." ) 
    end 
end 
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), boss ) 

Try that.

Link to comment
function boss ( ) 
    local Team = createTeam ( "Nemsis", 255, 0, 0 ) 
    local nemesi = exports [ "slothbot" ]:spawnBot ( 1193.3, -2038.8, 69, 90, 1, 0, 0, Team, 38, "hunting", "following" ) 
    local nemesi1 = exports [ "slothbot" ]:spawnBot ( 1174.6, -2045.7, 69, 90, 1, 0, 0, Team, 38, "hunting", "following" ) 
    local nemesi2 = exports [ "slothbot" ]:spawnBot ( 1155.3, -2021, 69.0, 90, 1, 0, 0, Team, 38, "hunting", "following" ) 
    local nemesi3 = exports [ "slothbot" ]:spawnBot ( 1137, -2038, 69, 90, 1, 0, 0, Team, 38, "hunting", "following" ) 
    setTimer ( 
        function ( b, b1, b2, b3 ) 
            local Team = getTeamFromName ( "Nemsis" ) 
            exports [ "slothbot" ]:setBotTeam ( b, Team ) 
            exports [ "slothbot" ]:setBotTeam ( b1, Team ) 
            exports [ "slothbot" ]:setBotTeam ( b2, Team ) 
            exports [ "slothbot" ]:setBotTeam ( b3, Team ) 
            local botTeam = exports [ "slothbot" ]:getBotTeam ( b ) 
            if ( botTeam ) then 
                outputChatBox ( "nemesi bot is on the team Nemsis" ) 
            else 
                outputChatBox ( "nemesi bot is not in a team." ) 
            end 
        end 
        ,1000, 1, nemesi, nemesi1, nemesi2, nemesi3 
    ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), boss ) 

Link to comment

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...