Jump to content

i need code * revive health * kill


Recommended Posts

function increaseHP (_, enemy) 
    if (enemy) then 
        setElementHealth (enemy, getElementHealth (enemy) + 10) 
        outputChatBox ("Your HP has been increased because you killed "..getPlayerName (source).."#ffffff.", enemy, 255, 255, 255, true) 
    end 
end 
addEventHandler ("onPlayerWasted", getRootElement(), increaseHP) 

Link to comment
function increaseHP (_, enemy) 
    if (enemy) then 
        setElementHealth (enemy, getElementHealth (enemy) + 10) 
        outputChatBox ("Your HP has been increased because you killed "..getPlayerName (source).."#ffffff.", enemy, 255, 255, 255, true) 
    end 
end 
addEventHandler ("onPlayerWasted", getRootElement(), increaseHP) 

not work :(

Link to comment

Try this.

function increaseHP ( _, attacker, _, _ ) 
    if attacker and attacker ~= source then 
        local actualHealth = getElementHealth ( attacker ) 
        outputChatBox ("Your HP has been increased because you killed "..getPlayerName (source).."#ffffff.", attacker, 255, 255, 255, true)      
        setElementHealth ( attacker, tonumber ( actualHealth ) + 10 ) 
    end  
end 
addEventHandler ("onPlayerWasted", getRootElement(), increaseHP) 

Link to comment
Try this.
function increaseHP ( _, attacker, _, _ ) 
    if attacker and attacker ~= source then 
        local actualHealth = getElementHealth ( attacker ) 
        outputChatBox ("Your HP has been increased because you killed "..getPlayerName (source).."#ffffff.", attacker, 255, 255, 255, true)      
        setElementHealth ( attacker, tonumber ( actualHealth ) + 10 ) 
    end  
end 
addEventHandler ("onPlayerWasted", getRootElement(), increaseHP) 

thank you it's working 100/100 thanks

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