devildead622 Posted February 13, 2013 Share Posted February 13, 2013 I wonder how do I make a command to set the position of a player? Link to comment
Vision Posted February 13, 2013 Share Posted February 13, 2013 addCommandHandler setElementPosition Link to comment
devildead622 Posted February 13, 2013 Author Share Posted February 13, 2013 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
Castillo Posted February 13, 2013 Share Posted February 13, 2013 Yes, it should work. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now