Jump to content

O que há de errado?


Recommended Posts

Boa noite, bom o portão não está abrindo, segue abaixo...

objeto = createObject ( 980, 2001.9000244141, -1445.0999755859, 15.300000190735, 0, 0,314 )
x,y,z = getElementPosition (objeto)
Zona = createColCircle ( x,y, 6, 6 )
--portao aberto--
function Funcion (thePlayer)
	local nomeAcc = getAccountName (getPlayerAccount (thePlayer))
	if isObejectInACLGroup ("user."..nomeAcc, aclGetGroup("VAGOS")) then
moveObject ( objeto, 2300, 2001.9000244141, -1445.0999755859, 9.1000003814697)
        else
end
end
addEventHandler ( "onColShapeHit", Zona, Funcion )
--portao fechado--
function Funcion2 (thePlayer)
	local nomeAcc2 = getAccountName (getPlayerAccount (thePlayer))
	if isObejectInACLGroup ("user."..nomeAcc2, aclGetGroup("VAGOS")) then
moveObject ( objeto, 2300, 2001.9000244141, -1445.0999755859, 15.300000190735)
       else
end
end
addEventHandler ( "onColShapeLeave", Zona, Funcion2 )

O que está faltando, ou errado?

Link to comment
local x,y,z = 2001.9000244141, -1445.0999755859, 15.300000190735
local gate = createObject ( 980, x,y,z, 0, 0,314 )
local col = createColSphere(x,y,z,3)

--portao aberto--
function openGate (thePlayer)
	local nomeAcc = getAccountName (getPlayerAccount (thePlayer))
	if isObjectInACLGroup ("user."..nomeAcc, aclGetGroup("VAGOS")) then
		moveObject ( gate, 2300, 2001.9000244141, -1445.0999755859, 9.1000003814697)
	else
		outputChatBox("Você não é membro dos 'VAGOS'!!")
	end
end
addEventHandler ( "onColShapeHit", col, openGate )

--portao fechado--
function closeGate (thePlayer)
	local nomeAcc = getAccountName (getPlayerAccount (thePlayer))
	if isObjectInACLGroup ("user."..nomeAcc, aclGetGroup("VAGOS")) then
		moveObject ( gate, 2300, 2001.9000244141, -1445.0999755859, 15.300000190735)
	--else
		--cancelEvent()
	end
end
addEventHandler ( "onColShapeLeave", col, closeGate )

 

Link to comment
  • Moderators
16 hours ago, #Gubiani said:

O que está faltando, ou errado?

Pelo que vejo no código, você escreveu isObejectInACLGroup - um erro que você mesmo poderia ter percebido usando /debugscript 3.

De resto, você pode ver a diferença com o código do @Pedro861

Use a seguinte condição dentro de onColShapeHit/Leave também:

if getElementType(thePlayer) == "player" then

 

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