Jump to content

General Scripting Help


Nitride

Recommended Posts

For the backgate thing:

local theMarker = createMarker ( -1250.1999511719, 463.89999389648, 9.60000014697,  "cylinder", 10, 0, 0, 255, 0 ) 
subwaygate = createObject (-1250.1999511719, 463.89999389648, 9.60000014697, 0, 0, 0 ) 
-- Make Marker and Gate 
  
function openGate ( hitElement ) 
if (getElementType(hitElement) == "player" ) then 
moveObject ( subwaygate , 1500, -1701.7937011719, 689.03674316406, 24.037502288818, 0, 0, 0 ) -- Changed 'gate' to 'subwaygate' 
end 
end 
addEventHandler( "onMarkerHit", theMarker, openGate ) 
-- Open Gate 
  
function closeGate ( leftElement ) 
if (getElementType(leftElement) == "player" ) then 
moveObject ( subwaygate, 1500, -1250.1999511719, 463.89999389648, 9.60000014697, 0, 0, 0 ) 
  
end 
end 
addEventHandler( "onMarkerLeave", theMarker, closeGate ) 
-- Close Gate 

And front gate:

  
  
local theMarker = createMarker ( -1530.3000488281, 482.20001220703, 9.6999998092651, "cylinder", 0, 0, 255, 0) 
subwaygate = createObject ( subwaygate, -1530.3000488281, 482.20001220703, 9.6999998092651, 0, 0, 255, 0 ) -- Changed 'gate' to 'subwaygate' 
-- Define Marker and Gate 
  
function openGate ( hitElement ) 
if (getElementType(hitElement) == "player" ) then 
moveObject ( subwaygate, -1530.3000488281, 482.20001220703, 9.6999998092651, 0, 0, 0, 0 ) 
end 
if (getElementType(hitElement) == "vehicle" ) then 
moveObject ( subwaygate, -1530.3000488281, 482.20001220703, 9.6999998092651, 0, 0, 0, 0 ) 
end 
addEventHandler( "onMarkerHit", theMarker, openGate ) 
-- Open Gate 
  
function closeGate ( leftElement ) 
if (getElementType(leftElement) == "player" ) then 
moveObject ( subwaygate, -1530.3000488281, 482.20001220703, 9.6999998092651, 0, 0, 0, 0 ) 
end 
end 
addEventHandler( "onMarkerLeave", theMarker, closeGate ) 
-- Close Gate 
  

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