Jump to content

help script gate


sumariello

Recommended Posts

Hello everyone, I created this script to a gate just do not work in the game as I do?

SFAirport1Gate54 = createObject (3115, -267.79998779297, 3050.6999511719, 103.59999847412, 0, 0, 1.99951171875)

function OpenGates(thePlayer)

local id = getElementModel (thePlayer )

moveObject (SFAirport1Gate54, 5000, -267.79998779297, 3050.6999511719, 118.09999847412)

end

addCommandHandler("carrisu", OpenGates)

function CloseGates(thePlayer)

local id = getElementModel (thePlayer )

moveObject (SFAirport1Gate54, 5000, -267.79998779297, 3050.6999511719, 103.59999847412)

end

addCommandHandler("carrigiu", CloseGates)

Link to comment

TRy this, but if it dosnt work, use "/debugscript 3" in game.

SFAirport1Gate54 = createObject (3115, -267.79998779297, 3050.6999511719, 103.59999847412, 0, 0, 2) 
  
addCommandHandler("carrisu", 
    function (thePlayer) 
        local id=getElementModel(thePlayer) 
        moveObject(SFAirport1Gate54,5000,-267.79998779297,3050.6999511719,118.09999847412) 
    end 
) 
  
addCommandHandler("carrigiu", 
    function (thePlayer) 
        local id=getElementModel(thePlayer) 
        moveObject(SFAirport1Gate54,5000,-267.79998779297,3050.6999511719,103.59999847412) 
    end 
) 
  

Link to comment

Where is your colshape? and like tete said. What is your purpose of getting the player's skin

  
function openGates(thePlayer) 
    moveObject(lsAirportGate1, 1000, -2864.300488281, 455.10000610352, 5.5999999046326) 
end 
addEventHandler("onColshapeHit", LSAirportCol, openGates) 
  
function closeGates(thePlayer) 
    moveObject(lsAitportGate1, 1000, -2863.300488281, 463.79998779297, 5.5999999046326, 5.5999999046326 
end 
addEventHandler("onColshapeLeave", LSAirportCol, closeGates) 
  
  

Try that.

Link to comment

I hope to help. see example

gate = createObject(980, 212.19999694824, 1875.3000488281, 12.39999961853)  
col = createColCuboid(205, 1870.3000488281, 9.39999961853, 14, 10,8)  
  
function hit(player) 
    if getElementType(player) == "player" then  
        moveObject(gate, 5900, 223.19999694824, 1875.3000488281, 12.39999961853) 
    end 
end 
  
addEventHandler("onColShapeHit", col, hit) 
  
function leave(player) 
    if getElementType(player) == "player" then 
        moveObject(gate, 5900, 212.19999694824, 1875.3000488281, 12.39999961853)  
    end 
end 
addEventHandler("onColShapeLeave", col, leave) 

Link to comment
  
function createTheGate () 
  
         SFAirport1Gate54 = createObject ( 3115, -267.79998779297, 3050.6999511719, 103.59999847412, 0, 0, 1.99951171875 ) 
  
      end 
  
      addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) 
  
  
  
  
  
 function OpenGates ( ) 
 moveObject ( SFAirport1Gate54, 5000, -267.79998779297, 3050.6999511719, 118.09999847412 ) 
 end 
 addCommandHandler("carrisu",OpenGates) 
  
  
 function CloseGates () 
 moveObject ( SFAirport1Gate54, 5000, -267.79998779297, 3050.6999511719, 103.59999847412 ) 
 end 
 addCommandHandler("carrigiu",CloseGates) 

Link to comment

try this:

local SFAirport1Gate54 = createObject ( 3115, -267.79998779297, 3050.6999511719, 103.59999847412, 0, 0, 1.99951171875 ) 
  
addCommandHandler("open",function() 
    moveObject ( SFAirport1Gate54, 5000, -267.79998779297, 3050.6999511719, 118.09999847412 ) 
end) 
addCommandHandler("close",function() 
    moveObject ( SFAirport1Gate54, 5000, -267.79998779297, 3050.6999511719, 103.59999847412 ) 
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...