Jump to content

[HELP] Marker teleport to Interior/Dimension


Gromziy

Recommended Posts

hello, I have prepared a small script for you with explanations here, I hope I can help you. here I created 2 markers as entry/exit, one teleports to the inside and the other to the exit

server:

local entraceMarker = createMarker(-1605.32422, 711.13220, 12.86719, "cylinder", 2.0, 255, 0, 0, 255) -- marker to enter the interior (SFPD HQ)
local exitMarker = createMarker(246.37334, 107.73531, 1003.21875, "cylinder", 2.0, 255, 0, 0, 255) -- marker to exit interior (SFPD HQ)
setElementInterior(exitMarker, 10) -- make marker interior to 10 for visible

-- INSIDE
addEventHandler("onMarkerHit", entraceMarker, -- add event listener for entrace marker
    function(hitElement, matchingDimension)
       if(getElementType(hitElement) == "player") then -- if hit Element is Player?
          setElementInterior(hitElement, 10) -- make interior 10 for player
          setElementPosition(hitElement, 246.87018, 110.93930, 1003.21875) --if so teleport player
       end
    end
)
-- OUTSIDE
addEventHandler("onMarkerHit", exitMarker, -- add event listener for exit marker
    function(hitElement, matchingDimension)
       if(getElementType(hitElement) == "player") then -- if hit Element is Player?
          setElementInterior(hitElement, 0) -- make interior 0 for player
          setElementPosition(hitElement, -1604.80127, 713.89508, 13.20619) --if so teleport player
       end
    end
)
Edited by Burak5312
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...