Mr.unpredictable. Posted May 4, 2015 Share Posted May 4, 2015 function damage(attacker, weapon, loss, x, y, z, tyre) if (weapon == 21 and getElementModel(source) == 432 then setElementHealth(source,getElementHealth(source) - 250) cancelEvent() end end addEventHandler("onClientVehicleDamage", root, damage) try this Raino will take 25% heath when you fire with projectile id 21 Link to comment
-Doc- Posted May 5, 2015 Author Share Posted May 5, 2015 function damage(attacker, weapon, loss, x, y, z, tyre) if (weapon == 21 and getElementModel(source) == 432 then setElementHealth(source,getElementHealth(source) - 250) cancelEvent() end end addEventHandler("onClientVehicleDamage", root, damage) try this Raino will take 25% heath when you fire with projectile id 21 forum and i used it+not workingits from Link to comment
Mr.unpredictable. Posted May 5, 2015 Share Posted May 5, 2015 sorry there was a missing ")" in the script and it should work, i posted this same example long back and it worked for him. function damage(attacker, weapon, loss, x, y, z, tyre) if (weapon == 21 and getElementModel(source) == 432) then setElementHealth(source,getElementHealth(source) - 250) cancelEvent() end end addEventHandler("onClientVehicleDamage", root, damage) to find rthe actual id of the weapon try this outputDebugString("Test: weaponid: " .. tostring(weapon)) or alternatively you can use the id 51 (It's the explostion id) same issue viewtopic.php?f=91&t=86150&start=15#p780074 Link to comment
Mr.unpredictable. Posted May 7, 2015 Share Posted May 7, 2015 not working Kidding? It works fine for me and everyone else Post the code which you are using Link to comment
-Doc- Posted May 7, 2015 Author Share Posted May 7, 2015 not working Kidding? It works fine for me and everyone else Post the code which you are using im not kidding and its server or client function damage(attacker, weapon, loss, x, y, z, tyre) if (weapon == 21 and getElementModel(source) == 432) then setElementHealth(source,getElementHealth(source) - 250) --outputDebugString("Test: weaponid: " .. tostring(weapon)) cancelEvent() end end addEventHandler("onClientVehicleDamage", root, damage) Link to comment
Mr.unpredictable. Posted May 7, 2015 Share Posted May 7, 2015 not working Kidding? It works fine for me and everyone else Post the code which you are using im not kidding and its server or client function damage(attacker, weapon, loss, x, y, z, tyre) if (weapon == 21 and getElementModel(source) == 432) then setElementHealth(source,getElementHealth(source) - 250) --outputDebugString("Test: weaponid: " .. tostring(weapon)) cancelEvent() end end addEventHandler("onClientVehicleDamage", root, damage) It's client Link to comment
-Doc- Posted May 7, 2015 Author Share Posted May 7, 2015 and im using client and not working Link to comment
Mr.unpredictable. Posted May 7, 2015 Share Posted May 7, 2015 Change the weapon id to 51 and it will only do 25% damage you need to shoot raino 4 times to destroy. Link to comment
Mr.unpredictable. Posted May 7, 2015 Share Posted May 7, 2015 im using tank projectile 21 51 is explosion id it will also effect, if 21 isn't working you can use 51 alternatively Link to comment
Bean666 Posted May 10, 2015 Share Posted May 10, 2015 i tried to change the weapon id which is 31(m4) , and changed the damage to -1000, and the rhino gets a 1 hit by m4 and it works , but if i use 51 or 21, doesnt work , nothing happens. Link to comment
Mr.unpredictable. Posted May 10, 2015 Share Posted May 10, 2015 i tried to change the weapon id which is 31(m4) , and changed the damage to -1000, and the rhino gets a 1 hit by m4 and it works , but if i use 51 or 21, doesnt work , nothing happens. 51 is explosion Id Just try to explode something near the vehicle. 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