Jump to content

Object Invisible


NyiTz

Recommended Posts

Well, i create a automatic gates for ACL group. When i work on dimension 0 ( normal ) everything is fine but now i tried change an object to another dimension but the object stays invisible.

What i want is that my object stay visible. Help me please ^^

for i = 1, 40 do 
	Gate3 = createObject ( 5020, -2660.8000488281, 1424.8000488281, 921.20001220703, 0, 0, 270 )
setElementDimension( Gate3, i ) 


x,y,z = getElementPosition (Gate3)
Zona = createColCircle ( x,y, 3, 3 )

function Portao7(thePlayer)
	    for _, group in ipairs ({"Console"}) do
		if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group )) then 
			moveObject (Gate3, 3000, -2660.8000488281, 1424.8000488281, 923 )
		end
	end
end
addEventHandler ( "onColShapeHit", Zona, Portao5 )


function Portao8(thePlayer)
        for _, group in ipairs ({"Console"}) do
		if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group )) then 
			moveObject (Gate3, 3000, -2660.8000488281, 1424.8000488281, 921.20001220703 )
		end
	end
end
addEventHandler ( "onColShapeLeave", Zona, Portao6 )
end 

 

 

Link to comment
  • Moderators

If you use Globals, you will be overwriting the variables.

 

 

for i = 1, 40 do 
    local Gate3 = createObject ( 5020, -2660.8000488281, 1424.8000488281, 921.20001220703, 0, 0, 270 )
    setElementDimension( Gate3, i ) 


    local x,y,z = getElementPosition (Gate3)
    local Zona = createColCircle ( x,y, 3, 3 )

    local function Portao7(thePlayer)
    	    for _, group in ipairs ({"Console"}) do
    		if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group )) then 
    			moveObject (Gate3, 3000, -2660.8000488281, 1424.8000488281, 923 )
    		end
    	end
    end
    addEventHandler ( "onColShapeHit", Zona, Portao7 ) -- not> Portao5


    local function Portao8(thePlayer)
            for _, group in ipairs ({"Console"}) do
    		if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group )) then 
    			moveObject (Gate3, 3000, -2660.8000488281, 1424.8000488281, 921.20001220703 )
    		end
    	end
    end
    addEventHandler ( "onColShapeLeave", Zona, Portao8 ) -- not> Portao6
end 

 

Link to comment
On 07/03/2019 at 12:40, IIYAMA said:

If you use Globals, you will be overwriting the variables.

 

 


for i = 1, 40 do 
    local Gate3 = createObject ( 5020, -2660.8000488281, 1424.8000488281, 921.20001220703, 0, 0, 270 )
    setElementDimension( Gate3, i ) 


    local x,y,z = getElementPosition (Gate3)
    local Zona = createColCircle ( x,y, 3, 3 )

    local function Portao7(thePlayer)
    	    for _, group in ipairs ({"Console"}) do
    		if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group )) then 
    			moveObject (Gate3, 3000, -2660.8000488281, 1424.8000488281, 923 )
    		end
    	end
    end
    addEventHandler ( "onColShapeHit", Zona, Portao7 ) -- not> Portao5


    local function Portao8(thePlayer)
            for _, group in ipairs ({"Console"}) do
    		if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group )) then 
    			moveObject (Gate3, 3000, -2660.8000488281, 1424.8000488281, 921.20001220703 )
    		end
    	end
    end
    addEventHandler ( "onColShapeLeave", Zona, Portao8 ) -- not> Portao6
end 

 

Unfortunately didn't work 100%, now i can feel that have something there, the gates open too but the object stay invisible. ?

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