Jump to content

Exportar Função


Recommended Posts

Posted (edited)

Boa tarde, estou tentando exportar uma função para outro resource usando:

exports["portaomecanico"]:Portao1()
	<script src="Portao.lua" type="shared" />
	<export function="Portao1" type="shared" />
	<export function="Portao2" type="shared" />

O meu objetivo é que ao clicar nas chaves do inventário abra o portão, porém não está abrindo. Estou tentando só com a primeira função que é a que abre. Já tentei colocar o create e mover objeto diretamente na chave mas estava sempre a abrir e criar um novo portão ao usar a chave. Se me puderem ajudar, agradeço ❤️ 

   Frente = createObject ( 9625, 2325.1000976563, -1912.8399658203, 15.560000419617, 0, 0, 0 )

function Portao1(thePlayer)
	    for _, group in ipairs ({"Mecanico"}) do
		if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group )) then 
			moveObject (Frente, 2000, 2325.1000976563, -1912.8399658203, 21.290000915527 )
		end
	end
end

function Portao2(thePlayer)
	    for _, group in ipairs ({"Mecanico"}) do
		if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group )) then 
			moveObject (Frente, 2000, 2325.1000976563, -1912.8399658203, 15.560000419617 )
		end
	end
end

 

Edited by GodKraken
Posted

E como está o código que você chamou a função? Se for aquele primeiro está faltando o jogador no argumento 1.

Além disso, não tem porquê de exportar shared já que as funções ali são apenas do lado server.

Please do not PM me with scripting related question nor support, use the forums instead.

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