Jump to content

My gate doesn't work


ViRuZGamiing

Recommended Posts

Hi,

here's the code;

insideDoor = createObject(10150, 239.6, 117.6, 1004.3, 0, 0, 0) 
setElementInterior(insideDoor, 10) 
nottrue = false 
  
addCommandHandler("door", 
function () 
    local police = getPlayerTeam(thePlayer) 
    if ( police == "Police" ) then 
        if (nottrue == false) then 
            moveObject( insideDoor, 2000, 239.6, 117.6, 1004.3, 0, 0, 0 ) 
            nottrue = true 
        elseif (nottrue == true) then 
            moveObject( insideDoor, 2000, 239.6, 117.6, 1006.8, 0, 0, 0 ) 
            nottrue = false 
        else 
        outputChatBox("Access Denied, employees only!", thePlayer, 255, 100, 0) 
        end 
    end 
end) 

Bad Agument @ getPlayerTeam

Link to comment

No Errors, No debugs anymore;

insideDoor = createObject(10150, 239.6, 117.6, 1004.3, 0, 0, 0) 
setElementInterior(insideDoor, 10) 
nottrue = false 
  
addCommandHandler("door", 
function (thePlayer) 
    local police = getPlayerTeam(thePlayer) 
    if ( police == "Police" ) then 
        if (nottrue == false) then 
            moveObject( insideDoor, 2000, 239.6, 117.6, 1006.8, 0, 0, 0 ) 
            nottrue = true 
        elseif (nottrue == true) then 
            moveObject( insideDoor, 2000, 239.6, 117.6, 1004.3, 0, 0, 0 ) 
            nottrue = false 
        else 
            outputChatBox("Access Denied, employees only!", thePlayer, 255, 100, 0) 
        end 
    end 
end) 

No output when not in Police Team and doesn't move when in team

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