I am placing this script on a door.. This door has many functions as in allowing everyone to pass, allowing certain accounts or disallowing all accounts.
For some reason the /allowall and /disallowall commands will not work, they do not work after said, can someone help me with this script,
Thanks

,
Joker
NPC Code:
const ALLOWALL = 0;
const ALLOWLIST = 1;
function onCreated(){
this.allowed = {"ACCT1","ACCT2","ACCT3"};
this.admins = {"ACCT1","ACCT2"};
this.cur_mode = ALLOWLIST;
show();
}
function onPlayerTouchsMe(){
if(this.cur_mode == ALLOWALL || (this.cur_mode == ALLOWLIST && player.account in this.allowed))
{
hide();
sleep(2);
show();
}
}
function onPlayerChats(){
if(player.account in this.admins)
{
if(player.chat == "/allowall")
this.mode = ALLOWALL;
else if (player.chat == "/disallowall")
this.mode = ALLOWLIST;
else if(player.chat.starts("/allow"))
{
temp.act = player.chat.substring(7);
this.allowed.add(temp.act);
player.chat = temp.act SPC "is now allowed through!";
}
}
}