Jump to content

SLOTHBOT setTEAM


bosslorenz

Recommended Posts

teamLV = getTeamFromName ("Las Venturas Mafia") 
function bot1() 
    bots1 = exports.slothbot:spawnBot (2494.6000976563, 1587, 10.7, 0, 108, 0, 0, teamLV, 31,  
  
"guarding", true ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement(), bot1 ) 

why does the bot still shoots at me even when Im on team "Las Venturas Mafia"? I have created a team [Las Venturas Mafia] on another lua script. Is there a problem here on my script. Maybe the bots1 is not on teamLV yet?

Link to comment

Based on your code, you're retrieving the team as soon as the script starts, the team will probably not have been created by then.

If the team is created in the same resource then, move the getTeamFromName line to onResourceStart. If not, you might want to delay the bot creation till the team is created.

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