Jump to content

help nemesis


Recommended Posts

as I can make

10 appear nemesis

and not only one

function BossNemesis ( thePlayer ) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
    local x, y, z = getElementPosition ( thePlayer ) 
    nemesi4 = exports [ "slothBot" ]:spawnBot ( x+1,y+1,z+0.5, 90, math.random ( 300, 303 ), 0, 0, Nemesis, 38, "hunting", true ) 
  
    exports.extra_health:setElementExtraHealth ( nemesi4, 150 ) 
    setElementModel ( nemesi4, 107 ) 
end 
end 
addCommandHandler ( "nemesis",BossNemesis ) 
  
addEvent("onBotWasted",true) 
addEventHandler("onBotWasted",getRootElement(),  
function (killer) 
if (source == nemesi4) then 
givePlayerMoney(killer,math.random(1000,1000)) 
killerName = getPlayerName(killer) 
weapon = getPedWeapon(killer) 
wr, wg, wb = getPlayerNametagColor(killer) 
exports.killmessages:outputMessage ( {killerName,{"padding",width=3},{"icon",id=weapon or 0},{"padding",width=3},{"color",r=141,g=7,b=220},"Nemesis"},getRootElement(),wr,wg,wb ) 
exports.exp_system:addPlayerEXP ( killer, math.random(1, 200)) 
end 
end) 
  
  

Link to comment

Try this:

  
local nemesisBots = {} 
function BossNemesis ( thePlayer ) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
        for i=1, 10 do 
            local x, y, z = getElementPosition ( thePlayer ) 
            nemesisBots[i] = exports [ "slothBot" ]:spawnBot ( x+i,y+i,z+(i/2), 90, math.random ( 300, 303 ), 0, 0, Nemesis, 38, "hunting", true ) 
            exports.extra_health:setElementExtraHealth ( nemesisBots[i], 150 ) 
            setElementModel ( nemesisBots[i], 107 ) 
        end 
    end 
end 
addCommandHandler ( "nemesis",BossNemesis ) 
  
addEvent("onBotWasted",true) 
addEventHandler("onBotWasted",getRootElement(), 
function (killer) 
    for i, nemesis in ipairs(nemesisBots) do 
        if (source == nemesis) then 
            givePlayerMoney(killer,math.random(1000,1000)) 
            local killerName = getPlayerName(killer) 
            local weapon = getPedWeapon(killer) 
            local wr, wg, wb = getPlayerNametagColor(killer) 
            exports.killmessages:outputMessage ( {killerName,{"padding",width=3},{"icon",id=weapon or 0},{"padding",width=3},{"color",r=141,g=7,b=220},"Nemesis"},getRootElement(),wr,wg,wb ) 
            exports.exp_system:addPlayerEXP ( killer, math.random(1, 200)) 
            break 
        end 
    end 
end) 
  

Link to comment

just create team

local Nemesis = createTeam("Nemesis",250,0,0) 
  
local nemesisBots = {} 
function BossNemesis ( thePlayer ) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
        for i=1, 10 do 
            local x, y, z = getElementPosition ( thePlayer ) 
            nemesisBots[i] = exports [ "slothBot" ]:spawnBot ( x+i,y+i,z+(i/2), 90, math.random ( 300, 303 ), 0, 0, Nemesis, 38, "hunting", true ) 
            exports.extra_health:setElementExtraHealth ( nemesisBots[i], 150 ) 
            setElementModel ( nemesisBots[i], 107 ) 
        end 
    end 
end 
addCommandHandler ( "nemesis",BossNemesis ) 
  
addEvent("onBotWasted",true) 
addEventHandler("onBotWasted",getRootElement(), 
function (killer) 
    for i, nemesis in ipairs(nemesisBots) do 
        if (source == nemesis) then 
            givePlayerMoney(killer,math.random(1000,1000)) 
            local killerName = getPlayerName(killer) 
            local weapon = getPedWeapon(killer) 
            local wr, wg, wb = getPlayerNametagColor(killer) 
            exports.killmessages:outputMessage ( {killerName,{"padding",width=3},{"icon",id=weapon or 0},{"padding",width=3},{"color",r=141,g=7,b=220},"Nemesis"},getRootElement(),wr,wg,wb ) 
            exports.exp_system:addPlayerEXP ( killer, math.random(1, 200)) 
            break 
        end 
    end 
end) 

Link to comment

try

change

addEventHandler("onPedWasted",getRootElement(), 
function (_,killer) 
    for i, nemesis in ipairs(nemesisBots) do 
        if (source == nemesis) then 
            givePlayerMoney(killer,math.random(1000,1000)) 
            local killerName = getPlayerName(killer) 
            local weapon = getPedWeapon(killer) 
            local wr, wg, wb = getPlayerNametagColor(killer) 
            exports.killmessages:outputMessage ( {killerName,{"padding",width=3},{"icon",id=weapon or 0},{"padding",width=3},{"color",r=141,g=7,b=220},"Nemesis"},getRootElement(),wr,wg,wb ) 
            exports.exp_system:addPlayerEXP ( killer, math.random(1, 200)) 
            break 
        end 
    end 
end) 

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