Jump to content

BadArgument at @addeventhandler


Recommended Posts

I have got pretty simple script. But my debugscript 3 is giving me error at my addeventhandler.

here is my script:

  
function Blood(loss,attacker,weapon,bodypart) 
local rootElement = getRootElement() 
local x, y, z = getElementPosition(source) 
local slapvalue = 5 
local timervalue = 10000 
local healthamount = 30 
   if loss > healthamount then 
      fxAddBlood ( x, y, z-2, 0.00000, 0.00000, 0.00000, 1, 1 ) 
      --setElementHealth ( targetPlayer, getElementHealth(targetPlayer) - slapvalue ) 
   end 
end 
addEventHandler ("OnClientPlayerDamage",rootElement,Blood) 
  

Link to comment

try

function Blood(loss,attacker,weapon,bodypart) 
local x, y, z = getElementPosition(source) 
local slapvalue = 5 
local timervalue = 10000 
local healthamount = 30 
   if loss > healthamount then 
      fxAddBlood ( x, y, z-2, 0.00000, 0.00000, 0.00000, 1, 1 ) 
      --setElementHealth ( targetPlayer, getElementHealth(targetPlayer) - slapvalue ) 
   end 
end 
addEventHandler ("onClientPlayerDamage",root,Blood) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...