SkillZNT Posted January 13, 2020 Share Posted January 13, 2020 Eu tive um problema que não consegui resolver Bom eu estou tendo problemas com um script de portão automatico pois não consigo por os dois portoes do script antigo que eu usava de testes com senha no outro Se alguem poder dar um help nesses dois portao na hora que ligo ele desaparece não sei como eu ligo as cords estão tudo certinho o outro script com senha o portao apareçe ja nessa não apareçe o portão apenas com 1 portão que estã aparecendo Se alguem me ajudar com isso fico feliz e muito grato A algum tempo aprendi algumas coisas aqui script que estou usando temporariamente com os dois portao function createTheGate () myGate1 = createObject ( 3607, -523.7001953125, -504.400390625, 30.60000038147, 0, 0, 0 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) function openMyGate ( ) moveObject ( myGate1, 1000, -500.20001220703, -504.60000610352, 30.60000038147 ) end addCommandHandler("cvtest1",openMyGate) function movingMyGateBack () moveObject ( myGate1, 1000, -523.7001953125, -504.400390625, 30.60000038147 ) end addCommandHandler("cvtest2",movingMyGateBack) -------------------------------------------------------------------- Segundo portao test function createTheGate () myGate2 = createObject ( 16773, -488.89999389648, -562.90002441406, 28.39999961853, 0, 0, 0 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) function openMyGate ( ) moveObject ( myGate2, 1000, -488.89999389648, -562.90002441406, 20.39999961853 ) end addCommandHandler("cvtest10",openMyGate) function movingMyGateBack () moveObject ( myGate2, 1000, -488.89999389648, -562.90002441406, 28.39999961853 ) end addCommandHandler("cvteste11",movingMyGateBack) Script de testes que eu estava tentando usar o portão automatico objeto = createObject ( 3607, -523.7001953125, -504.400390625, 30.60000038147, 0, 0, 90 ) x,y,z = getElementPosition (objeto) Zona = createColCircle ( x,y, 6, 6 ) function abrir (player) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "CV" ) ) then moveObject ( objeto, 2000, -523.7001953125, -504.400390625, 9 ) outputChatBox("", player, 255, 0, 0, true) outputChatBox ( "", player, 0, 255, 0, true ) outputChatBox("", player, 255, 0, 0, true) else end end addEventHandler ( "onColShapeHit", Zona, abrir ) function fechar (player) moveObject ( objeto, 2000, -523.7001953125, -504.400390625, 15, 0, 0, 0 ) outputChatBox("", player, 255, 0, 0, true) outputChatBox("", player, 255, 0, 0, true) outputChatBox("", player, 255, 0, 0, true) end addEventHandler ( "onColShapeLeave", Zona, fechar ) Link to comment
Angelo Pereira Posted January 13, 2020 Share Posted January 13, 2020 (edited) local x,y,z = -523.7001953125, -504.400390625, 30.60000038147 local objeto = createObject ( 3607, x,y,z,0,0,90 ) local zona = createColCircle ( x, y, 6 ) function abrir (player) local account = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..account, aclGetGroup ( "CV" ) ) then moveObject ( objeto, 2000, -523.7001953125, -504.400390625, 9 ) end end addEventHandler ( "onColShapeHit", zona, abrir ) function fechar (player) moveObject ( objeto, 2000, x,y,z ) end addEventHandler ( "onColShapeLeave", zona, fechar ) Teste lá, apenas o que estava errado era "createColCircle(x,y, 6, 6)" Edited January 13, 2020 by Angelo Pereira 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