BorderLine Posted December 19, 2011 Share Posted December 19, 2011 Hi everyone I have a problem 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
Al3grab Posted December 19, 2011 Share Posted December 19, 2011 * line 7 local playerHealth = getElementHealth ( getLocalPlayer() ) should be local playerHealth = getElementHealth ( hitPlayer ) Link to comment
BorderLine Posted December 19, 2011 Author Share Posted December 19, 2011 edit: thanks man. work, but i changed to client side and change onClientHitMarker thx 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