Jump to content

[Boss Nemesis] Mta DayZ


DantesInferno

Recommended Posts

Quisiera saber si alguien me puede pasar el Boss para DayZ no tiene ue ser precisamente el Nemesis cualquier tipode boss para el DayZ, yo tengo un pero es que lo pongo y la sangre del dayz esta scripteada y el boss no me baja vida nesecito que me puedan pasar un Boss para MTa DayZ o me ayuden a configurar este por favor.

boss.lua

       local hillRadar = createRadarArea ( 2520.1318359375, -953.83752441406, 0, 0, 0, 0, 0, 0 ) 
            function Nemesisbymanawydan ( )   
                  nemesi = exports [ "slothBot" ]:spawnBot ( 1061.4794921875, 1317.03125, 25.36874961853, 90,  math.random ( 300, 303 ), 0, 0, Nemesis, 8, "hunting", true ) 
                  setElementModel ( nemesi, 310 ) 
                  local myBlip = (createBlipAttachedTo ( nemesi, 0 )) 
                  attachElements ( baz, nemesi, 0.2, 0.1, 0.5, 0, 90, 0 ) 
                  triggerClientEvent ( "nsound", root ) 
                 setTimer( 
                  function() 
                  exports.extra_health:setElementExtraHealth(nemesi, 500) 
                  end, 100, 100) 
             end 
            addEventHandler("onResourceStart", resourceRoot, Nemesisbymanawydan)   
           addEvent("onBotWasted", true) 
        addEventHandler("onBotWasted", getRootElement)   
  
function money (theKiller) 
if (source == nemesi) then 
givePlayerMoney(theKiller,math.random(2500)) 
outputChatBox ( getPlayerName ( theKiller ) .." #081DBFMato al MiniBOSS(Primer piso)!, Ha Ganado $2500 como Premio",getRootElement(), 255, 255, 255, true ) 
setTimer(Nemesisbymanawydan, 16000, 1) 
end 
end 
addEvent("onBotWasted", true) 
addEventHandler("onBotWasted", getRootElement(), money) 
      
function destroy () 
     if ( not isElement ( nemesi ) ) then 
     destroyElement(myBlip) 
     end 
end 
addEvent("onBotWasted", true) 
addEventHandler("onBotWasted", getRootElement(), destroy) 

bosss.lua

       local hillRadar = createRadarArea ( 2520.1318359375, -953.83752441406, 0, 0, 0, 0, 0, 255 ) 
            function Nemesisbymanawydan ( )   
                   nemesi = exports [ "slothBot" ]:spawnBot ( 1061.4794921875, 1317.03125, 25.36874961853, 90,  math.random ( 300, 303 ), 0, 0, Nemesis, 8, "hunting", true ) 
                  setElementModel ( nemesi, 310 ) 
                  local myBlip = (createBlipAttachedTo ( nemesi, 0 )) 
                  attachElements ( baz, nemesi, 0.2, 0.1, 0.5, 0, 90, 0 ) 
                  triggerClientEvent ( "nsound", root ) 
                 setTimer( 
                  function() 
                  exports.extra_health:setElementExtraHealth(nemesi, 500) 
                  end, 100, 100) 
             end 
            addEventHandler("onResourceStart", resourceRoot, Nemesisbymanawydan)   
           addEvent("onBotWasted", true) 
        addEventHandler("onBotWasted", getRootElement)   
  
function money (theKiller) 
if (source == nemesi) then 
givePlayerMoney(theKiller,math.random(2500)) 
outputChatBox ( getPlayerName ( theKiller ) .. "#081DBFMato al MiniBOSS(Primer piso)!, Ha Ganado $2500 como Premio",getRootElement(), 255, 255, 255, true ) 
setTimer(Nemesisbymanawydan, 16000, 1) 
end 
end 
addEvent("onBotWasted", true) 
addEventHandler("onBotWasted", getRootElement(), money) 
      
function destroy () 
     if ( not isElement ( nemesi ) ) then 
     destroyElement(myBlip) 
     end 
end 
addEvent("onBotWasted", true) 
addEventHandler("onBotWasted", getRootElement(), destroy) 

Extra_heath:

local validTypes = 
    { 
        [ "player" ] = false, 
        [ "ped" ] = true, 
        [ "vehicle" ] = true 
    } 
  
function getElementExtraHealth ( theElement ) 
    if ( not theElement or not isElement ( theElement ) ) then 
        return false, "Invalid element" 
    end 
  
    if ( not validTypes [ getElementType ( theElement ) ] ) then 
        return false, "Invalid element type" 
    end 
  
    return tonumber ( getElementData ( theElement, "xblood" ) ) 
end 
  
function setElementExtraHealth ( theElement, theHealth ) 
    if ( not theElement or not isElement ( theElement ) ) then 
        return false, "Invalid element" 
    end 
  
    if ( not validTypes [ getElementType ( theElement ) ] ) then 
        return false, "Invalid element type" 
    end 
  
    if ( not tonumber ( theHealth ) ) then 
        return false, "Invalid health value" 
    end 
  
    return setElementData ( theElement, "xblood", tonumber ( theHealth ) ) 
end 
  
function isElementWithExtraHealth ( theElement ) 
    local health, errorMsg = getElementExtraHealth ( theElement ) 
    if ( not health ) then 
        return false, errorMsg 
    end 
  
    return ( health > 10 ) 
end 
  
function setElementInvulnerable ( theElement, theState ) 
    if ( not theElement or not isElement ( theElement ) ) then 
        return false, "Invalid element" 
    end 
  
    if ( not validTypes [ getElementType ( theElement ) ] ) then 
        return false, "Invalid element type" 
    end 
  
    return setElementData ( theElement, "xblood", theState ) 
end 
  
function isElementInvulnerable ( theElement ) 
    if ( not theElement or not isElement ( theElement ) ) then 
        return false, "Invalid element" 
    end 
  
    if ( not validTypes [ getElementType ( theElement ) ] ) then 
        return false, "Invalid element type" 
    end 
  
    return getElementData ( theElement, "xblood" ) 
end 

2.

local validTypes = 
    { 
        [ "player" ] = false, 
        [ "ped" ] = true, 
        [ "vehicle" ] = true 
    } 
local oldHealth = getElementHealth ( localPlayer ) 
  
addEventHandler ( "onClientRender", root, 
    function ( ) 
        local currentHealth = getElementHealth ( localPlayer ) 
        if ( currentHealth < oldHealth ) then 
            if ( isElementInvulnerable ( localPlayer ) ) then 
                setElementHealth ( localPlayer, oldHealth ) 
            else 
                local health = getElementExtraHealth ( localPlayer ) 
                if ( health and health > 10 ) then 
                    local loss = ( oldHealth - currentHealth ) 
                    setElementExtraHealth ( localPlayer, ( health - loss ) ) 
                    setElementHealth ( localPlayer, oldHealth ) 
                end 
            end 
        end 
        oldHealth = currentHealth 
    end 
) 
  
addEventHandler ( "onClientPlayerStealthKill", root, 
    function ( target ) 
        if isElementInvulnerable ( target ) then 
            cancelEvent ( ) 
        end 
    end 
) 
  
addEventHandler ( "onClientPlayerDamage", localPlayer, 
    function ( _, _, _, loss ) 
        if isElementInvulnerable ( source ) then 
            cancelEvent ( ) 
        else 
            local health = getElementExtraHealth ( source ) 
            if ( health and health > 10 ) then 
                setElementExtraHealth ( source, ( health - loss ) ) 
                cancelEvent ( ) 
            end 
        end 
    end 
) 
  
addEventHandler ( "onClientPedDamage", root, 
    function ( _, _, _, loss ) 
        if isElementInvulnerable ( source ) then 
            cancelEvent ( ) 
        else 
            local health = getElementExtraHealth ( source ) 
            if ( health and health > 10 ) then 
                setElementExtraHealth ( source, ( health - loss ) ) 
                cancelEvent ( ) 
            end 
        end 
    end 
) 
  
addEventHandler ( "onClientVehicleDamage", root, 
    function ( _, _, loss ) 
        if ( not isVehicleDamageProof ( source ) ) then 
            local health = getElementExtraHealth ( source ) 
            if ( health and health > 10 ) then 
                setElementExtraHealth ( source, ( health - loss ) ) 
                cancelEvent ( ) 
            end 
        end 
    end 
) 
  
function getElementExtraHealth ( theElement ) 
    if ( not theElement or not isElement ( theElement ) ) then 
        return false, "Invalid element" 
    end 
  
    if ( not validTypes [ getElementType ( theElement ) ] ) then 
        return false, "Invalid element type" 
    end 
  
    return tonumber ( getElementData ( theElement, "xblood" ) ) 
end 
  
function setElementExtraHealth ( theElement, theHealth ) 
    if ( not theElement or not isElement ( theElement ) ) then 
        return false, "Invalid element" 
    end 
  
    if ( not validTypes [ getElementType ( theElement ) ] ) then 
        return false, "Invalid element type" 
    end 
  
    if ( not tonumber ( theHealth ) ) then 
        return false, "Invalid health value" 
    end 
  
    return setElementData ( theElement, "xblood", tonumber ( theHealth ) ) 
end 
  
function isElementWithExtraHealth ( theElement ) 
    local health, errorMsg = getElementExtraHealth ( theElement ) 
    if ( not health ) then 
        return false, errorMsg 
    end 
  
    return ( health > 10 ) 
end 
  
function setElementInvulnerable ( theElement, theState ) 
    if ( not theElement or not isElement ( theElement ) ) then 
        return false, "Invalid element" 
    end 
  
    if ( not validTypes [ getElementType ( theElement ) ] ) then 
        return false, "Invalid element type" 
    end 
  
    return setElementData ( theElement, "xblood", theState ) 
end 
  
function isElementInvulnerable ( theElement ) 
    if ( not theElement or not isElement ( theElement ) ) then 
        return false, "Invalid element" 
    end 
  
    if ( not validTypes [ getElementType ( theElement ) ] ) then 
        return false, "Invalid element type" 
    end 
  
    return getElementData ( theElement, "xblood" ) 
end 

Gracias por todo hayles dejo como son los codigos

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...