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
end
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.
end
end
addEventHandler("onPlayerMarkerHit",getRootElement(),markerAlert)
Before reply please try in local.