Jump to content

I need armor regeneration when standing script, please :)


Yazir

Recommended Posts

Ill give an example:

setTimer( 
    function () 
        setElementHealth ( localPlayer, ( getElementHealth ( localPlayer ) + 0.05 ) ) 
    end,100,0) 
  

This is healthregeneration, i need armor now. Please...

Link to comment

Please, help me these didn't worked well:

setTimer( 
    function () 
        setPlayerArmor ( localPlayer, ( getPedArmor ( localPlayer ) + 10 ) ) 
    end,100,0) 
  

setTimer( 
    function () 
        setPedArmor ( localPlayer, ( getPedArmor ( localPlayer ) + 10 ) ) 
    end,100,0) 
  

Link to comment
function regenArmor() 
    for _,player in ipairs(getElementsByType("player")) do 
        local arm = getPedArmor(player); 
        if arm < 100 then 
            local nuarm = arm + 10; 
            if nuarm > 100 then nuarm = 100; end 
            setPedArmor(player,nuarm) 
        end 
    end 
end 
setTimer(regenArmor,5000,0); 

There you go, now fuck off and learn properly so you don't have to waste our time and your own time in future.

Edit: Please bare in mind that this is a server script.

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