Javier Posted December 20, 2012 Share Posted December 20, 2012 La idea es crear un marker y cuando entra un jugador , darle 100 de vida. local marca = createMarker ( 1200, 4521, 10, "checkpoint", 5.1, 200, 0, 0, 100, getRootElement() ) function check () for _, v in ipairs ( getElementsByType 'player' ) do if ( isElementWithinMarker ( v, marca ) then setElementHealth ( v, 100 ) local health = getElementHealth(getLocalPlayer()) outputChatBox ("Tu Vida ahora es: " ..health) end end end addEventHandler("onMarkerHit", marca, check) Gracias. Link to comment
Castillo Posted December 20, 2012 Share Posted December 20, 2012 local marca = createMarker ( 1200, 4521, 10, "checkpoint", 5.1, 200, 0, 0, 100, getRootElement() ) function check ( hitPlayer ) if ( getElementType ( hitPlayer ) == "player" ) then setElementHealth ( hitPlayer, 100 ) local health = getElementHealth ( hitPlayer ) outputChatBox ( "Tu Vida ahora es: ".. health, hitPlayer ) end end addEventHandler ( "onMarkerHit", marca, check ) Link to comment
Recommended Posts