The first step to making it better is to lose that terrible styling.
PHP Code:
function onCreated() {
setTimer(0.05);
this.on = 0;
}
//#CLIENTSIDE
functon onPlayerEnters() {
if (this.on == 1) {
if (player.guild != "Judge" || player.guild != "Preformer") {
player.chat = "...";
}
}
setTimer(0.05);
}
function onPlayerChats() {
if (player.guild == "Judge") {
if (player.chat == ":muteon") {
this.on = 1;
player.chat = "Level-Mute Enabled";
}
elseif(player.chat == ":muteoff") {
this.on = 0;
player.chat = "Level-Mute Disabled"
}
}
if (this.on == 1) {
if (player.guild != "Judge" || player.guild != "Preformer") {
if (player.chat != "...") {
player.chat = "...";
}
}
}
setTimer(0.05);
}
function onTimeout() {
if (this.on == 1) {
if (player.guild != "Judge" || player.guild != "Preformer") {
player.chat = "...";
}
}
setTimer(0.05);
}
You misspelled function in "onPlayerEnters". In addition, there's no need for a timeout anywhere. You also misspelled "Performer" twice.
You can't have the toggle bit on clientside, as then it only applies for the specific player.
PHP Code:
function onPlayerChats() { // player chats
if (player.guild == "Judge") { // can control the level
if (player.chat == ":muteon") {
this.muteOn = true;
player.chat = "Mute On";
} else if (player.chat == ":muteoff") {
this.muteOn = false;
player.chat = "Mute Off";
}
} else if (this.muteOn && player.guild != "Performer") {
// it's on and player is not a judge or performer
player.chat = "...";
}
}
function onPlayerEnters() {
this.onPlayerChats(); // call this in case people enter with chat
}
Does that make sense? All taken care of serverside, with events.