Jump to content

Slothbot problem


Snow-Man

Recommended Posts

hello, i have started working on safeareas script by using slothbot for protection but bots attacks me whatever happens even if i cancel that 

addEvent("onPlayerHitSafeZone", true)
addEventHandler("onPlayerHitSafeZone", root, 
	function()
		if getElementType(source) == "player" then
			for i, v in ipairs(getElementsByType( "ped" ) ) do
				if getElementData(v, "slothbot") then 
					createBlipAttachedTo( v, 21)
					if (getElementData(v, "BotTeam") == getTeamName(getPlayerTeam(source))) then
						setElementData(v, "attacking", false)
						setElementData(v, "target", false)
						iprint("friendly mode")
					else
						setElementData(v, "attacking", true)
						setElementData(v, "target", source)
						iprint("unfriendly mode..")
					end
				end
			end
		end
	end
)

if that code isnt right, whats the solution to give bots order to hit or cancel attack

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