I think Grief means something like the following:
PHP Code:
//MADE BY IMASK
//REVISED BY NOOF*
//#CLIENTSIDE //TIP ALWAYS CHECK THIS TO MAKE SURE IT IS SPELLED CORRECTLY!!
function onCreated() {
this.image = "door.png";
this.open = false; //make sure this starts false when the script runs
}
function onPlayerChats() {
if (player.chat == "/open" && clientr.staff == 1) {
this.open = true;
onCheck();
} else if (player.chat == "/close" && clientr.staff == 1) {
this.open = false;
onCheck();
}
}
function onCheck() {
if (this.open == true) {
this.image.show();
} else if (this.open == false) {
this.image.hide();
}
}
Check out the booleans (the = true and = false), and practice them they are important in the future.
Also as Grief mentioned the
PHP Code:
if(..) {
} else if(...) {
}
Is always your friend, reason being it looks cleaner and what can go wrong using less amount of code?
Hope this helps and Good luck your doing great!