Jump to content

onMarkerHit / onPlayerMarkerHit


Recommended Posts

I used the examples in the wiki but the player is not recognized. What happens?

Examples from the wiki.

onMarkerHit :

local myMarker = createMarker(-2596.625, 579.358, 15.626, 'cylinder', 2.0, 255, 0, 0, 150) -- create myMarker 
function MarkerHit( hitElement, matchingDimension ) -- define MarkerHit function for the handler 
    local elementType = getElementType( hitElement ) -- get the hit element's type 
    outputChatBox( elementType.." inside myMarker", getRootElement(), 255, 255, 0 ) -- attach the element's type with the text, and output it 
addEventHandler( "onMarkerHit", myMarker, MarkerHit ) -- attach onMarkerHit event to MarkerHit function 

onPlayerMarkerHit :

function markerAlert(markerHit,matchingDimension) 
    if (matchingDimension) then -- Make sure the player is in the same dimension as the marker (so they're actually going into it). 
        outputChatBox("You have just entered a marker.",source,255,255,0) -- Output that they are. 

Before reply please try in local.

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