Jump to content

Command of teleport


devildead622

Recommended Posts

Thanks,

can check if my code is complete?

function createTheGate () 
    myGate1 = createObject ( 971, 301.79998779297, -1566.9000244141, 29.5, 0, 1, 289.75 ) 
    myGate2 = createObject ( 971, 356.5, -1464.5999755859, 28.89999961853, 0, 359.5, 74 ) 
end 
  
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) 
  
function teleport ( player ) 
    if string.find( getPlayerName( player ) , "[OuT]", 1, true ) then 
        setElementPosition ( player, 307, -1520, 25 ) 
    end 
end 
addCommandHandler("baseout",teleport) 
  
function openMyGate ( player ) 
    if string.find( getPlayerName( player ) , "[OuT]", 1, true ) then 
        moveObject ( myGate1, 2500, 301.79998779297, -1566.9000244141, 24.5) 
        moveObject ( myGate2, 2500, 356.5, -1464.5999755859, 24.5) 
        setTimer(movingMyGateBack,5000,1,player) 
    end 
end 
addCommandHandler("open",openMyGate) 
  
  
function movingMyGateBack ( player ) 
    if string.find( getPlayerName( player ) , "[OuT]", 1, true ) then 
        moveObject ( myGate1, 2500, 482.89999389648, 2884.8000488281, 14.10000038147 ) 
    end 
end 
addCommandHandler("close",movingMyGateBack) 

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