Guest User

Untitled

a guest
Nov 19th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | None | 0 0
  1. opendoor1 = createObject(1967, -2035.0999755859, 1645.0999755859, 233, 0, 0, 270)
  2. markerdoor = createMarker( -2037, 1644.6999511719, 231.80000305176, "corona", 6.0,0,0,0,0 )
  3.  
  4. function MarkerHit( hitElement, matchingDimension )
  5.     if getElementType(hitElement) ~= "player" then return end -- checking who came in marker is player
  6.      moveObject(opendoor1,300,-2032.8000488281,1645.0999755859,233) -- here is x,y,z the door moves
  7. end
  8. addEventHandler( "onMarkerHit", markerdoor, MarkerHit )
  9.  
  10. function markerLeave( leaveElement, matchingDimension )
  11.         for _, p in ipairs(getElementsByType('player')) do
  12.                 if isElementWithinMarker(p, markerdoor ) then
  13.                  return
  14.                 end
  15.         end
  16.  moveObject(opendoor1,300,-2035.0999755859, 1645.0999755859, 233)
  17. end
  18. addEventHandler( "onMarkerLeave", markerdoor, markerLeave )
Add Comment
Please, Sign In to add comment