Jump to content

Esto esta bien?


Javier

Recommended Posts

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
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
  • Recently Browsing   0 members

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