Sharingan Posted July 23, 2011 Posted July 23, 2011 I have a question, how do I increase the damage of weapons? If I do this, Is it right?: funcion WeaponDamage(attacker, weapon, bodypart, loss) if(weapon == 30 or weapon == 31) then setElementHealth(source, getElementHealth(source)-(loss*2)) end end addEventHandler("onPlayerDamage",getRootElement(),WeaponDamage) In this case I want to duplicate the damage of M4 and AK-47. Ingame Nick: CrowClaws
Castillo Posted July 23, 2011 Posted July 23, 2011 (edited) Try this (client side) function WeaponDamage(attacker, weapon, bodypart, loss) if(weapon == 30 or weapon == 31) then cancelEvent() setElementHealth(source, getElementHealth(source)-(loss*2)) end end addEventHandler("onClientPlayerDamage",getRootElement(),WeaponDamage) Edited July 23, 2011 by Guest San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Kenix Posted July 23, 2011 Posted July 23, 2011 function WeaponDamage(attacker, weapon, bodypart, loss) if(weapon == 30 or weapon == 31) then cancelEvent() setElementHealth(source, getElementHealth(source)-(loss*2)) end end addEventHandler("onClientPlayerDamage",getRootElement(),WeaponDamage) http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
SDK Posted July 23, 2011 Posted July 23, 2011 That is the same thing Kenix... Nope, check 'function' Learn Lua - Learn to script - GUI scripting Scripter tools - Find/fix errors yourself(!) Don't pm me for scripting help, keep it for the Scripting subforum!
Sharingan Posted July 23, 2011 Author Posted July 23, 2011 OK, Thank you everyone. Ingame Nick: CrowClaws
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