Why not you make the gate auto open and close instead of bindkeys, as if some newbies joins server they may face problem to enter or exit mansion(just a suggestion)
it can be configured to be actioned just by the owner of the property. ;p
Hmm.
I have chnaged it now the function will work for any object and also i have created class for mansion gate.
player can add multiple gates in game and can only use one function.
By class I mean class{} with constructor and etc.
(so it would be easier to check gate's status, like gate.status that will return the status of the gate, obviously)Anyway, here comes another problem... the variable
open is a global one, so when a player will open/close any gate, it will be set for all instead of only to that gate.