JuAnY Posted September 12, 2015 Share Posted September 12, 2015 Hi, I need another help, this time with a simple resource that use slothbot. This generates 5 bots in a random position near the player to attack him with random skin/weapon, but sometimes one or two bots dont die and they keep jumping around me, I dont know if its a problem with my script or is a bug of slothbot. local skins = {102, 103, 104, 108, 109, 110, 114, 115, 116, 121, 122, 123, 173, 174, 175, 124, 105, 106, 107, 19, 21, 22, 28, 29, 67, 15, 20, 165, 73, 179, 287, 280, 282, 283, 284, 285, 286} local armas = {22, 24, 25, 27, 28, 32, 30, 31} local prtabla = {-2, -4, -6, -8, -10, -12, -14, -16, -18, -20, -22, -24, -26, -28, -30, -32, -34, -36, -38, -40, -42, -44, -46, -48, -50, -52, -54, -56, -58, -60, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60} function Spawnbot1 (bot) local x,y,z = getElementPosition (source) local rot=90 local interior=0 local dimension= 0 local team=false local mode= "hunting" local modesubject= source exports[ "slothBot" ]:spawnBot (x+prtabla[ math.random( 1,#prtabla)], y+prtabla[ math.random( 1,#prtabla)], z, rot, skins[ math.random( 1,#skins)], interior, dimension, team, armas[ math.random( 1,#armas)], mode, modesubject) exports[ "slothBot" ]:spawnBot (x+prtabla[ math.random( 1,#prtabla)], y+prtabla[ math.random( 1,#prtabla)], z, rot, skins[ math.random( 1,#skins)], interior, dimension, team, armas[ math.random( 1,#armas)], mode, modesubject) exports[ "slothBot" ]:spawnBot (x+prtabla[ math.random( 1,#prtabla)], y+prtabla[ math.random( 1,#prtabla)], z, rot, skins[ math.random( 1,#skins)], interior, dimension, team, armas[ math.random( 1,#armas)], mode, modesubject) exports[ "slothBot" ]:spawnBot (x+prtabla[ math.random( 1,#prtabla)], y+prtabla[ math.random( 1,#prtabla)], z, rot, skins[ math.random( 1,#skins)], interior, dimension, team, armas[ math.random( 1,#armas)], mode, modesubject) exports[ "slothBot" ]:spawnBot (x+prtabla[ math.random( 1,#prtabla)], y+prtabla[ math.random( 1,#prtabla)], z, rot, skins[ math.random( 1,#skins)], interior, dimension, team, armas[ math.random( 1,#armas)], mode, modesubject) outputChatBox("Mata a todos los enemigos!", root, 255, 0, 255, false ) end addCommandHandler("bot", Spawnbot1) Link to comment
KariiiM Posted September 12, 2015 Share Posted September 12, 2015 There's any error in the debugscript ? Link to comment
JuAnY Posted September 12, 2015 Author Share Posted September 12, 2015 No, the script runs well, the 5 bots spawn but that happens... Link to comment
KariiiM Posted September 12, 2015 Share Posted September 12, 2015 No, the script runs well, the 5 bots spawn but that happens... Your script look fine, add timer for each bot got killed check if it exist and destroy it Link to comment
JuAnY Posted September 15, 2015 Author Share Posted September 15, 2015 Im trying with timer but the error continues... When debugscript get: "ERROR: slothbot\sbclient.lua:115: Attempt to compare boolean wth number" Im going crazy, I cant find the solution Link to comment
KariiiM Posted September 15, 2015 Share Posted September 15, 2015 Im trying with timer but the error continues...When debugscript get: "ERROR: slothbot\sbclient.lua:115: Attempt to compare boolean wth number" Im going crazy, I cant find the solution Put the part where the error exist Link to comment
JuAnY Posted September 15, 2015 Author Share Posted September 15, 2015 I change the code a little bit, I did appear less bots and was fixed Link to comment
KariiiM Posted September 15, 2015 Share Posted September 15, 2015 I change the code a little bit, I did appear less bots and was fixed Great to hear that, also do what i told you in my 2nd post it, to check after killing the bot if he exist then destroy it to avoid bugs 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