Jump to content

Help with script


LeooN15

Recommended Posts

i´m trying to make the LSPD gate automatic to Admin acl group can anyone tell me what is wrong?

root = getRootElement () 
  
LSgate1 = createObject ( 969, 1584.9000244141, -1637.9000244141, 12.39999961853, 0, 0, 0) -- enter the ID of the object followed by the coordinates 
                                 -- note the rotx y and z may not be required so you just remove these. x y and z is where you would put your cordinates. 
  
  
function Open ( pla ) 
    if getElementType ( pla ) == "player" then 
        if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(pla)), aclGetGroup ( "Admin" ) ) then 
            moveObject (LSgate1, 2500, 1584.9000244141, -1637.9000244141, 15.99999961853)    -- here is where you enter the coordinatess of the new location of the object, 2200 = the speed of the movent. 
        end 
    end 
end   
addEventHandler ( "onColShapeHit", col, Open) 
  
function Close ( pla ) 
    if getElementType ( pla ) == "player" then 
        if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(pla)), aclGetGroup ( "Admin" ) ) then 
            moveObject (LSgate1, 2500,1584.9000244141, -1637.9000244141, 12.39999961853) -- here is where you copy the coordinates of the orginal location of the object, 2951 = the timer of movent. 
        end 
    end 
end 
addEventHandler ( "onColShapeLeave", col, Close ) 

Please help me

Link to comment

Ok, FINNALY I GOT IT:

LSgate1 = createObject ( 969, 1584.9000244141, -1637.9000244141, 12.39999961853, 0, 0, 0) 
col = createColRectangle(1584.8251953125,-1644.04296875,10,15) 
  
addEventHandler ( "onColShapeHit", col, 
function(hitElement) 
    if (getElementType (hitElement) == "player") then 
        if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(hitElement)), aclGetGroup ( "Admin" ) ) then 
            moveObject (LSgate1, 2500, 1584.9000244141, -1637.9000244141, 15.99999961853)    -- here is where you enter the coordinatess of the new location of the object, 2200 = the speed of the movent. 
        end 
    end 
end) 
  
 addEventHandler ( "onColShapeLeave", col,  
function(hitElement) 
    if (getElementType (hitElement) == "player") then 
        if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(hitElement)), aclGetGroup ( "Admin" ) ) then 
            moveObject (LSgate1, 2500,1584.9000244141, -1637.9000244141, 12.39999961853) -- here is where you copy the coordinates of the orginal location of the object, 2951 = the timer of movent. 
        end 
    end 
end) 

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