Jump to content

OnMarkerHit won't work


monstergnom

Recommended Posts

Hey guys,

I created a marker to port me into a casino. This works well.

But now, I can't port myself out (with another Marker - in the casino ofc).

Here's the code. I just can port myself out of the casino with /leave

markerleave = createMarker( 2002.509765625,1016.2685546875,994.46875 )
function leaveCasino ( thePlayer )
setElementInterior ( thePlayer, 0, 2027.6220703125, 1007.2666015625, 10.8203125 )
end
addEventHandler ( "onMarkerHit", markerleave, leaveCasino )
addCommandHandler("leave", leaveCasino)

BTW: I see the Marker in the casino, but nothing happens if I walk into it.

Greets

Link to comment

you should check the type of element which hits your marker. If it is a player, then teleport him.

function leaveCasino ( thePlayer )
if getElementType( thePlayer ) == "player" then
setElementInterior ( thePlayer, 0, 2027.6220703125, 1007.2666015625, 10.8203125 )
end
end

Edited by Guest
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...