Chaos Posted August 27, 2013 Share Posted August 27, 2013 hi there when i create 4 bots and set them mode hunting they will kill each others i don't want to kill each others is that possible?? Link to comment
Moderators IIYAMA Posted August 27, 2013 Moderators Share Posted August 27, 2013 set them in the same team. Link to comment
Chaos Posted August 27, 2013 Author Share Posted August 27, 2013 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
Moderators IIYAMA Posted August 27, 2013 Moderators Share Posted August 27, 2013 setBotTeam don't have to be exported? Link to comment
WASSIm. Posted August 27, 2013 Share Posted August 27, 2013 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
Chaos Posted August 27, 2013 Author Share Posted August 27, 2013 i tired that but it's not worked Link to comment
Moderators IIYAMA Posted August 27, 2013 Moderators Share Posted August 27, 2013 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
Chaos Posted August 27, 2013 Author Share Posted August 27, 2013 they don't get in team Link to comment
Moderators IIYAMA Posted August 27, 2013 Moderators Share Posted August 27, 2013 getBotTeamreturns the Team the bot is on, false if no team Syntax string getBotTeam ( element theBot) Maybe you should check that. Link to comment
WASSIm. Posted August 27, 2013 Share Posted August 27, 2013 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
Chaos Posted August 27, 2013 Author Share Posted August 27, 2013 they still don't get in team Link to comment
Moderators IIYAMA Posted August 27, 2013 Moderators Share Posted August 27, 2013 Why don't you check that with the function I gave you !!!!! Link to comment
Chaos Posted August 27, 2013 Author Share Posted August 27, 2013 what is the point of that function ? i don't know how to use it Link to comment
Castillo Posted August 27, 2013 Share Posted August 27, 2013 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
Chaos Posted August 28, 2013 Author Share Posted August 28, 2013 it's said nemesi bot is not in a team. Link to comment
Castillo Posted August 28, 2013 Share Posted August 28, 2013 So, that means that the bot is not being set to that team. Link to comment
Castillo Posted August 28, 2013 Share Posted August 28, 2013 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
Chaos Posted August 28, 2013 Author Share Posted August 28, 2013 nemesi bot is not in a team. Link to comment
Castillo Posted August 28, 2013 Share Posted August 28, 2013 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
Chaos Posted August 28, 2013 Author Share Posted August 28, 2013 debug said unexpected symbol near "," Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now