-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathScript.js
More file actions
25 lines (22 loc) · 764 Bytes
/
Script.js
File metadata and controls
25 lines (22 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//Idk I was bored so I made this
var toggle = true;
register("command", function() {
if (toggle == false) {
ChatLib.chat("&4[&6ChatTime&4]&6 On");
toggle = true;
} else if (toggle) {
ChatLib.chat("&4[&6ChatTime&4]&6 Off");
toggle = false;
}
}).setCommandName("chattime");
register("chat", function(event, message) {
if (toggle) {
var date = new Date();
var hours = date.getHours();
var minutes = date.getMinutes();
var seconds = date.getSeconds();
var message = ChatLib.getChatMessage(event, true);
ChatLib.chat(message.replace(message, "&4[&6" + hours + ":" + minutes + ":" + seconds + "&4]&r " + message));
cancel(event);
}
});