Niick Posted December 12, 2019 Share Posted December 12, 2019 Boa Tarde, Achei um Script perdido na internte de portão automatico, porem eu queria colocar ele pra abrir somente para uma determinada ACL, não pra todo mundo. ========================================================================================================================== objeto = createObject ( 980, 1497.4000244141, -698.5, 96.5, 0, 0, 0 ) x,y,z = getElementPosition (objeto) Zona = createColCircle ( x,y, 6, 6 ) --portao aberto-- function Funcion () moveObject ( objeto, 500, 1497.4000244141, -698.5, 20.300000190735 ) end addEventHandler ( "onColShapeHit", Zona, Funcion ) --portao fechado-- function Funcion2 () moveObject ( objeto, 500, 1497.4000244141,-698.5, 96.5 ) end addEventHandler ( "onColShapeLeave", Zona, Funcion2 ) Link to comment
beast99 Posted December 12, 2019 Share Posted December 12, 2019 Tente assim, para isso você precisa de um IsObjectInACLGroup. objeto = createObject ( 980, 1497.4000244141, -698.5, 96.5, 0, 0, 0 ) x,y,z = getElementPosition (objeto) Zona = createColCircle ( x,y, 6, 6 ) --portao aberto-- function Funcion () for _, group in ipairs ({"Grupo que você deseja"}) do if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group )) then moveObject ( objeto, 500, 1497.4000244141, -698.5, 20.300000190735 ) end end end addEventHandler ( "onColShapeHit", Zona, Funcion ) --portao fechado-- function Funcion2 () for _, group in ipairs ({"Grupo que você deseja"}) do if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group )) then moveObject ( objeto, 500, 1497.4000244141,-698.5, 96.5 ) end end end addEventHandler ( "onColShapeLeave", Zona, Funcion2 ) Se te ajudei dá um Thanks! 1 Link to comment
Niick Posted December 12, 2019 Author Share Posted December 12, 2019 Boa noite, Eu testei não funciono Link to comment
Jonas^ Posted December 12, 2019 Share Posted December 12, 2019 (edited) local objeto = createObject (980, 1497.400, -698.5, 96.5, 0, 0, 0) local x, y, z = getElementPosition (objeto) local Zona = createColCircle (x, y, 6, 6) function Function (thePlayer, matchingDimension) if getElementType (thePlayer) == "player" then -- Se o elemento que colidiu no col for um player, então: if (isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (thePlayer)), aclGetGroup("Admin"))) then -- Se o jogador estiver na acl "Admin" por exemplo, então: moveObject (objeto, 500, 1497.400, -698.5, 20.300) outputChatBox ("@Portão aberto!", thePlayer) end end end addEventHandler ("onColShapeHit", Zona, Function) function Function2 (thePlayer, matchingDimension) if getElementType (thePlayer) == "player" then -- Se o elemento que saiu do col for um player, então: if (isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (thePlayer)), aclGetGroup("Admin"))) then -- Se o jogador estiver na acl "Admin" por exemplo, então: moveObject (objeto, 500, 1497.400, -698.5, 96) outputChatBox ("@Portão fechado!", thePlayer) end end end addEventHandler ("onColShapeLeave", Zona, Function2) @Niick Edited December 12, 2019 by Jonas^ Correção! 1 Link to comment
Niick Posted December 12, 2019 Author Share Posted December 12, 2019 Muito Obrigadooo!!! Eu te amo tanto 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