Jump to content

problem


Recommended Posts

ive got this script, but it doesnt work...

it increases the demage of the sniper rifle but in server its still at the same level

hope someone can help me

function killbysniper(attacker, attackerweapon, bodypart, loss) 
        if(attackerweapon == 34) then 
        setElementHealth(source, 33) 
        end 
        elseif(bodypart == 9) and(attackerweapon ==34) then 
        setElementHealth(source, 0)  
        end 
    end 
addEventHandler("onPlayerDamage", getRootElement(), killbysniper) 
  
  
  

Link to comment

Maybe you want to take off 33% of health with every shot + the normal sniper damage? because with your code it's setting it to 33%.

function killbysniper(attacker, attackerweapon, bodypart, loss) 
        if(attackerweapon == 34) then 
        setElementHealth(source, tonumber(getElementHealth(source))-33) 
end 
        if(bodypart == 9) and(attackerweapon ==34) then 
        setElementHealth(source, 0) 
        end 
    end 
addEventHandler("onPlayerDamage", getRootElement(), killbysniper) 

Try that.

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