IIIIlllllIII Posted November 28, 2011 Posted November 28, 2011 hi guys i want to know how to make anti weapon on the same player not anti attacker weapon for example i want make anti weapon 16 and 39 how i make it on the same player note not anti weapon for attacker.
Jaysds1 Posted November 28, 2011 Posted November 28, 2011 Do you mean, if the player shoot, they get damaged instead of the element that they're shooting at?
IIIIlllllIII Posted November 28, 2011 Author Posted November 28, 2011 Do you mean, if the player shoot, they get damaged instead of the element that they're shooting at? no
Cadu12 Posted November 28, 2011 Posted November 28, 2011 Do you mean, if player dont let it change other weapon ?
IIIIlllllIII Posted November 28, 2011 Author Posted November 28, 2011 i mean i have shop panel and i want when i buy Grenade or Satchel Charges i want not be killed with my Satchel Charges and greande do you understand me i want make anti grenade and Satchel Charges when the player buy Satchel Charges they cant be killed
MetaGamer Posted November 28, 2011 Posted November 28, 2011 I think he mean't that the explosion will not kill himself but others.
IIIIlllllIII Posted November 28, 2011 Author Posted November 28, 2011 I think he mean't that the explosion will not kill himself but others. yes that is true i mean that
BinSlayer1 Posted November 28, 2011 Posted November 28, 2011 function stopGrenadeDamage ( attacker, weapon, bodypart ) if ( weapon == 0 ) and ( attacker == getLocalPlayer() ) then --CHANGE THIS TO THE ID OF GRENADE LAUNCHER w/e cancelEvent() --cancel the event end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopGrenadeDamage )
12p Posted November 28, 2011 Posted November 28, 2011 BinSlayer1, you weren't very clear with that code. He could not understand and make the code useless. function stopGrenadeDamage ( attacker, weapon, bodypart ) if weapon == 0 and attacker == getLocalPlayer() then --If the weapon is grenade and you are receiving damage from yourself cancelEvent ( ) --cancel the damage end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopGrenadeDamage ) In "weapon == 0", change 0 to the ID of the grenade (search here, in ID, NOT MODEL ID)
IIIIlllllIII Posted November 28, 2011 Author Posted November 28, 2011 BinSlayer1, you weren't very clear with that code. He could not understand and make the code useless. function stopGrenadeDamage ( attacker, weapon, bodypart ) if weapon == 0 and attacker == getLocalPlayer() then --If the weapon is grenade and you are receiving damage from yourself cancelEvent ( ) --cancel the damage end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopGrenadeDamage ) In "weapon == 0", change 0 to the ID of the grenade (search here, in ID, NOT MODEL ID) thank you very much and thanks to BinSlayer1
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