DRW Posted April 10, 2015 Share Posted April 10, 2015 Hello. I've tried to create a server-sided marker linked to a function that spawns a slothbot bot, it appears and shoots when he sees me. For now all works perfectly, but the problem is that when the bot sees me, another bot appears in the same place he is at, and another, and another... After all, bots don't even get damage when they get shot. What did I do wrong and how can I solve both problems? Server Marker2a = createMarker (-2065, -118, 52,"cylinder",80,100,255,150,0) function botenemy1 ()enemy1a = exports [ "slothBot" ]:spawnBot(-2068,-144,35,0,2,0,0,enemies,22,"guarding") end addEventHandler ("onMarkerHit", Marker2a, botenemy1) Link to comment
Ryancit2 Posted April 10, 2015 Share Posted April 10, 2015 You mean multiple bots are being spawned? That would only happen if you hit marker multiple times, is it happening even when you hit marker only once? In that case, provide rest of the code so that we can detect where else this bug might be, maybe in a loop or something. Link to comment
rain_gloom Posted April 10, 2015 Share Posted April 10, 2015 Probably the bot is entering the marker. You should definitely check the element entering inside the function. Try logging everything you work with (the bots created and the element entering the marker) You should see what is entering this way. Link to comment
DRW Posted April 10, 2015 Author Share Posted April 10, 2015 You mean multiple bots are being spawned? That would only happen if you hit marker multiple times, is it happening even when you hit marker only once? In that case, provide rest of the code so that we can detect where else this bug might be, maybe in a loop or something. Oh I forgot other map elements can count as hitelements, thanks! Link to comment
Ryancit2 Posted April 10, 2015 Share Posted April 10, 2015 You mean multiple bots are being spawned? That would only happen if you hit marker multiple times, is it happening even when you hit marker only once? In that case, provide rest of the code so that we can detect where else this bug might be, maybe in a loop or something. Oh I forgot other map elements can count as hitelements, thanks! My pleasure, and like rain_gloom said, you can also add a check to see whether the hitelement is a player or some other element. Link to comment
DRW Posted April 10, 2015 Author Share Posted April 10, 2015 Thanks but I still have a problem, when I shoot them they dont get damaged Link to comment
Ryancit2 Posted April 11, 2015 Share Posted April 11, 2015 Is the bot being shot by same teammate? 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