Best-Killer Posted December 14, 2016 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
ViRuZGamiing Posted December 14, 2016 Posted December 14, 2016 Wiki: Canceling this event has no effect. Cancel the client-side event onClientPlayerDamage instead. "If debugging is the process of removing software bugs, then programming must be the process of putting them in."
iPrestege Posted December 14, 2016 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 )
Deep thinker Posted December 14, 2016 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 ) ☠ℙℝ☯M∀✗☠ Video Editor --- Images and pictures Editor. Trial LUA Scripter. Scripting Skills ↧ 26%
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