Jump to content

[HELP] Gate Script


Recommended Posts

At This Part:

            if ( getElementData ( leftElement, "gang" ) == "FBI_" ) then 

I want the gate to open for player whos in the gang "FBI_" and "SAPD"

local myGate1 = createObject ( 8378, 2575.009765625, -2111.7705078125, 1.4876279830933, 0, 0, 0 ) 
local marker = createMarker( 2582.3000488281, -2111.6000976563, -5.5, "cylinder", 15, 255, 255, 255, 0) 
  
addEventHandler ( "onMarkerHit", marker, 
    function ( hitElement ) 
        if ( getElementType ( hitElement ) == "player" ) then 
            if ( getElementData ( hitElement, "gang") == "FBI_" ) then 
                moveObject ( myGate1, 2500, 2575, -2111.8000488281, -9.3999996185303 ) 
            end 
        end 
    end 
) 
  
addEventHandler ( "onMarkerLeave", marker, 
    function ( leftElement ) 
        if ( getElementType ( leftElement ) == "player" ) then 
            if ( getElementData ( leftElement, "gang" ) == "FBI_" ) then 
                moveObject ( myGate1, 2500, 2575.009765625, -2111.7705078125, 1.4876279830933 ) 
            end 
        end 
    end 
) 

Link to comment

Not really sure what is whats wrong with it, but i added "SAPD" to it, if thats what you wanted...

  
local myGate1 = createObject ( 8378, 2575.009765625, -2111.7705078125, 1.4876279830933, 0, 0, 0 ) 
local marker = createMarker( 2582.3000488281, -2111.6000976563, -5.5, "cylinder", 15, 255, 255, 255, 0) 
  
addEventHandler ( "onMarkerHit", marker, 
    function ( hitElement ) 
        if ( getElementType ( hitElement ) == "player" ) then 
            if ( getElementData ( hitElement, "gang") == "FBI_" )or (( getElementData ( hitElement, "gang") == "SAPD" )) then 
                moveObject ( myGate1, 2500, 2575, -2111.8000488281, -9.3999996185303 ) 
            end 
        end 
    end 
) 
  
addEventHandler ( "onMarkerLeave", marker, 
    function ( leftElement ) 
        if ( getElementType ( leftElement ) == "player" ) then 
            if ( getElementData ( leftElement, "gang" ) == "FBI_" ) or (getElementData(leftElement,'gang')=="SAPD") then 
                moveObject ( myGate1, 2500, 2575.009765625, -2111.7705078125, 1.4876279830933 ) 
            end 
        end 
    end 
) 
  

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