[C2M]Bios Posted May 11, 2011 Share Posted May 11, 2011 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
Castillo Posted May 11, 2011 Share Posted May 11, 2011 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
[C2M]Bios Posted May 11, 2011 Author Share Posted May 11, 2011 i want to kill a player with 2 shots, therefore i have to deal him more than 50% of his health as damage i hope your script works... anyway thanks in advance ______________________________ Edit: thanks solidsnake, it works Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now