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
);