Best-Killer Posted December 14, 2016 Share Posted December 14, 2016 (edited) function onDmg(attacker, weapon, _, loss) if ( isElement ( attacker ) and weapon and attacker ~= source ) then if getElementData ( source, "KillArrest") =="true" then cancelEvent() end end end addEventHandler('onPlayerDamage',root,onDmg) 0 errors but still i can damage the player :v what is the problem guys Edited December 14, 2016 by Best-Killer Link to comment
ViRuZGamiing Posted December 14, 2016 Share Posted December 14, 2016 Wiki: Canceling this event has no effect. Cancel the client-side event onClientPlayerDamage instead. Link to comment
iPrestege Posted December 14, 2016 Share Posted December 14, 2016 Try with this ; addEventHandler ( 'onClientPlayerDamage',localPlayer, function ( aAttacker,aWeapon ) if ( aAttacker and aWeapon and aAttacker ~= source ) then if ( getElementData ( source,'KillArrest' ) == true ) then cancelEvent ( ) end end ) Link to comment
Deep thinker Posted December 14, 2016 Share Posted December 14, 2016 as IPrestege taught me before it's would be better to use the client side 1 hour ago, iPrestege said: Try with this ; addEventHandler ( 'onClientPlayerDamage',localPlayer, function ( aAttacker,aWeapon ) if ( aAttacker and aWeapon and aAttacker ~= source ) then if ( getElementData ( source,'KillArrest' ) == true ) then cancelEvent ( ) end end ) 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