So I just modified that code to make it work the way I want it
I compiled it, got the LUAC file, what next?
gate = createObject ( 980, -805.59997558594, 2379.6000976563, 155, 0, 0, 318) -- Gate.
function Open ( pla ) -- the function
if getElementType ( pla ) == "player" then -- if he is a player.
if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(pla)), aclGetGroup ( "legend" ) ) then -- it is only for admins.
moveObject (gate, 2500, -805.59997558594, 2379.6000976563, 148) -- It will move the gate.
end -- Closing functions and all...
end
end
addEventHandler ( "onColShapeHit", col, Open) -- Adding a event handler.
addCommandHandler ( "open",Open) -- Adding the command.
function Close ( pla ) -- Function
if getElementType ( pla ) == "player" then -- as i said for checking if its a player.
if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(pla)), aclGetGroup ( "legend" ) ) then -- for admins only./
moveObject (gate, 2500,-805.59997558594, 2379.6000976563, 155) -- close the gate.
end
end
end
addEventHandler ( "onColShapeLeave", col, Close )
addCommandHandler ("close", Close)