Jump to content

More Health on bots


12p

Recommended Posts

Hi, men. I'm making a kind of "SA mistery" (Nemesis, in this case) and I need that all you help me.

I want to set the Nemesis health to 100.000. Is this possible? And how? Of course I used:

setElementHealth (nemesis, 100000)

But it doesn't work. And I don't want infinite health, like this:

function healing ()
setElementHealth (nemesis,100)
end
setTimer (healing,1,0)

Look, this is my code (I'm using slothbot, thanks sloth):

addEventHandler ("onResourceStart",getRootElement(),
function ()
nemesis = exports.slothbot:spawnBot(-1918.25,660.35,46.56,90,103,0,0,nil,36,"hunting")
end)

Any way to set Nemesis health to 100.000? I will wait an answer. Thanks beforehand.

Link to comment

Also, this:

setTimer (healing,1,0)

wouldn't work, because the minimal value for the time if 50ms, as stated here.

LOL, I didn't use that value (1), just used it as example.

What about this?

addEventHandler ("onResourceStart",getRootElement(),
function ()
nemesis = exports.slothbot:spawnBot(-1918.25,660.35,46.56,90,103,0,0,nil,36,"hunting")
setElementData (nemesis,"deaths",0)
end)
addEventHandler ("onPedWasted",getRootElement(),
function ()
local deaths = getElementData(source,"deaths")
if exports.slothbot:isPedBot (source) and getElementData (source,"deaths") < 5 then
setElementHealth (source, 100)
setElementData (source,"deaths",deaths+1)
end
end)

May it work?

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