bosslorenz Posted March 12, 2015 Share Posted March 12, 2015 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
3B00DG4MER Posted March 12, 2015 Share Posted March 12, 2015 Maybe you're not on that team Link to comment
JR10 Posted March 12, 2015 Share Posted March 12, 2015 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
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