Does any one know how to make a Chat talk delay timer, for like public talking so people cant spam? like a 3 second timer or 2 second timer.. Heres what i been thinking somethen like.
For Player.java
Code:
public int chatDelay = 0;
And then for process()
Code:
if (chatDelay > 0) {
chatDelay--;
Then in PublicChat.java
Code:
if(p.chatDelay == 2){
p.frames.sendMessage(p, "Please wait "+chatDelay+" seconds before speaking again.");
} else {
p.chatTextEffects = p.stream.readUnsignedWord();
int numChars = p.stream.readUnsignedByte();
p.chatText = Misc.decryptPlayerChat(p.stream, numChars);
for (String s : Engine.Censor.censored) {
if (p.chatText.contains(s)) {
int length = s.length();
String replace = "";
for(int i = 0; i < length; i++) {
replace += "*";
}
p.chatText = p.chatText.replaceAll(s, replace);
}
}
p.chatTextUpdateReq = true;
p.updateReq = true;
}
}
Somethen like that, im 100% that code i wrote up will not work lmao.. but thats like a example. Ty!