Jump to content

[help] interior teleport inside/outside


Raizel

Recommended Posts

so i made this script that teleports u inside an interior when u enter a marker but it doesnt teleport u for some reason..

 

server

local e1 = createMarker(2105.47534, -1806.58765, 12.55469, "cylinder", 1.0, 255, 255, 255, 50) 
local e = createMarker(362.98032, -75.25889, 1000.50781, "cylinder", 1.0, 255, 255, 255, 50)
setElementInterior(e, 10) 

-- INSIDE
addEventHandler("onMarkerHit", e1, 
    function(hitElement, matchingDimension)
       if(getElementType(hitElement) == "player") then
          setElementInterior(hitElement, 10) 
          setElementPosition(hitElement, 365.33194, -73.90823, 1001.50781) 
       end
    end
)
-- OUTSIDE
addEventHandler("onMarkerHit", e,
    function(hitElement, matchingDimension)
       if(getElementType(hitElement) == "player") then 
          setElementInterior(hitElement, 0) 
          setElementPosition(hitElement, 2100.90894, -1806.63440, 13.55469) 
       end
    end
)

 

Link to comment

for some reason collision is not detected because the marker is small set the size of the marker to 1.5 to fix this issue

or if you want to keep the marker small, create a colshape and reference the collision to the colshape

local e1 = createMarker(2105.47534, -1806.58765, 12.55469, "cylinder", 1.5, 255, 255, 255, 50) 
local e = createMarker(362.98032, -75.25889, 1000.50781, "cylinder", 1.5, 255, 255, 255, 50)
setElementInterior(e, 10) 

-- INSIDE
addEventHandler("onMarkerHit", e1, 
    function(hitElement, matchingDimension)
       if(getElementType(hitElement) == "player") then
          setElementInterior(hitElement, 10) 
          setElementPosition(hitElement, 365.33194, -73.90823, 1001.50781) 
       end
    end
)
-- OUTSIDE
addEventHandler("onMarkerHit", e,
    function(hitElement, matchingDimension)
       if(getElementType(hitElement) == "player") then 
          setElementInterior(hitElement, 0) 
          setElementPosition(hitElement, 2100.90894, -1806.63440, 13.55469) 
       end
    end
)

 

Edited by Burak5312
  • Thanks 1
Link to comment
25 minutes ago, Burak5312 said:

for some reason collision is not detected because the marker is small set the size of the marker to 1.5 to fix this issue

or if you want to keep the marker small, create a colshape and reference the collision to the colshape

local e1 = createMarker(2105.47534, -1806.58765, 12.55469, "cylinder", 1.5, 255, 255, 255, 50) 
local e = createMarker(362.98032, -75.25889, 1000.50781, "cylinder", 1.5, 255, 255, 255, 50)
setElementInterior(e, 10) 

-- INSIDE
addEventHandler("onMarkerHit", e1, 
    function(hitElement, matchingDimension)
       if(getElementType(hitElement) == "player") then
          setElementInterior(hitElement, 10) 
          setElementPosition(hitElement, 365.33194, -73.90823, 1001.50781) 
       end
    end
)
-- OUTSIDE
addEventHandler("onMarkerHit", e,
    function(hitElement, matchingDimension)
       if(getElementType(hitElement) == "player") then 
          setElementInterior(hitElement, 0) 
          setElementPosition(hitElement, 2100.90894, -1806.63440, 13.55469) 
       end
    end
)

 

ahh thank u sm :happy4:

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