Jump to content

help ^^


donis123

Recommended Posts

Hi, i have a script with moving gate but it not working, and i cant find the problem ;/

  local Gate = createObject ( 980, 1245.5, -767.40002441406, 93.800003051758, 0, 0, 0 ) 
local gateMarker = createMarker ( 1245.5999755859, -767.09997558594, 90.5, "cylinder", 10, 452, 152, 253, 523 ); 
local state = 0; 
  
addEventHandler("onMarkerHit", gateMarker, 
    function ( hitElement ) 
        local accName = getAccountName ( getPlayerAccount ( hitElement ) ) -- get his account name 
        if isObjectInACLGroup ("User."..accName, aclGetGroup ( "Admin" ) ) then 
            if ( state == 0 ) then 
                moveObject ( Gate, 2500, 1245.5, -767.40002441406, 88.199996948242 ); 
                state = 1; 
            end 
        else 
            outputchatBox ( "You're not allowed to enter this area.", hitElement ); 
        end 
    end 
); 
  
addEventHandler("onMarkerLeave", gateMarker, 
    function ( hitElement ) 
        local accName = getAccountName ( getPlayerAccount ( hitElement ) ) -- get his account name 
        if isObjectInACLGroup ("User."..accName, aclGetGroup ( "Admin" ) ) then 
            if ( state == 1 ) then 
                moveObject ( Gate, 2500, 1245.5, -767.40002441406, 93.900001525879 ); 
                state = 0; 
            end 
        else 
            outputchatBox ( "You're not allowed to enter this area.", hitElement ); 
        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...