Jump to content

[ Solved Lock This Topic ]


iPrestege

Recommended Posts

Hello Guys,

What's the problem with this function "setElementHealth" the problem is if i have 10 health and i do this :

CountSlap = 0 
addCommandHandler("slap", 
    function ( plr ) 
        if  CountSlap then   
        setElementHealth ( plr, getElementHealth(plr) - 90 ); 
    CountSlap = CountSlap -90 
        outputChatBox("True") 
            else 
          outputChatBox("False") 
    end 
end 
) 

i get +90 bug or? what's the fuck ?

Edited by Guest
Link to comment

Not sure :

CountSlap = 0 
  
addCommandHandler("slap", 
    function ( plr ) 
        if  CountSlap == 0 then   
            setElementHealth ( plr, getElementHealth(plr) - 90 ); 
            CountSlap = CountSlap - 90 
            outputChatBox("True"); 
        else 
            outputChatBox("False"); 
        end 
    end 
) 

Link to comment

This?

  
addCommandHandler("slap", 
    function ( plr ) 
        if  getElementHealth(plr) =< 50  then   
        setElementHealth ( plr, getElementHealth(plr) - 90 ); 
        outputChatBox("True") 
            else 
          outputChatBox("False") 
    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...