Jump to content

detect health player


BorderLine

Recommended Posts

Hi everyone

I have a problem :S i dont know what is the problem.

this is the code

  
local puerta = createObject (10828,1697.235,-738.492,60.004,0,0,170) 
local exit = createMarker (1697.96,-738.53,60.21, 'cylinder', 30, 0, 0, 255, 0) 
  
addEventHandler ("onMarkerHit",exit, 
function (hitPlayer) 
 local playerHealth = getElementHealth ( getLocalPlayer() ) 
 if playerHealth < 99 then 
 outputChatBox ("Infeccion no detectada. Acceso Concedido",hitPlayer) 
  moveObject (puerta,1500,1697.235,-738.492,75.004) 
  
else 
 outputChatBox ("Infeccion detectada. Acceso Denegado!",hitPlayer) 
  
 end 
end) 
  

Dont open the door

And debugscript 3 show this error

exitrc_s.lua:6:attepmt to call global 'getLocalPlayer' (a nill value)

I dont know how fix it.

Im searching in mta wiki but i found nothing.

Thanks very much :)

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...