What I want:
I have a chat skript that I'd like augmented. What I want is for players to be able to use a command to hide everyone else's chat from them, save for if the message contains "@TheirName". This on it's own isn't hard, but I ran into issues as my chat is json. So if anyone knows how to make my skript chat-toggle-friendly, I'd greatly appreciate it! I'm too angry at it to work on it for a bit, lol.
The current chattoggle command:
My current chat code(without any of the measures I tried to get it to toggle):
When I'd like it by: Whenever
I have a chat skript that I'd like augmented. What I want is for players to be able to use a command to hide everyone else's chat from them, save for if the message contains "@TheirName". This on it's own isn't hard, but I ran into issues as my chat is json. So if anyone knows how to make my skript chat-toggle-friendly, I'd greatly appreciate it! I'm too angry at it to work on it for a bit, lol.
The current chattoggle command:
code_language.skript:
command /chattoggle:
trigger:
if {hidechat::%player%} is true:
set {hidechat::%player%} to false
send "&e&l[&b&l✔&e&l] &r&7Player chat now visible."
else:
set {hidechat::%player%} to true
send "&e&l[&b&l✔&e&l] &r&7Player chat hidden. You can still be mentioned wih ""@""."
My current chat code(without any of the measures I tried to get it to toggle):
code_language.skript:
on chat:
set {_chatcooldown} to difference between {chatcooldown.last::%player%} and now
if {_chatcooldown} is less than 30 seconds:
if {chatmessage::%player%} is equal to "%message%":
send "&e&l[&d&l✖&e&l] &r&7That's the same as your last message. Wait 30 seconds to chat the same thing."
cancel event
stop
loop all players:
remove loop-player from chat recipients
if player has permission "owner":
json("@a","&b&o%player's display name% &7❖||cmd:/owner||ttp:&b&lOwner %new line%&b%player%|| &7%message%")
stop
else if player has permission "srguardian":
json("@a","&b%player's display name% &7●||cmd:/action %player%||ttp:&bSrGuardian %new line%&b%player%|| &7%message%")
stop
else if player has permission "guardian":
json("@a","&b%player's display name% ||cmd:/action %player%||ttp:&bGuardian %new line%&b%player%||&7● &7%message%")
stop
else if player has permission "ancient":
json("@a","&d⚜&9%player's display name%&d⚜ ||cmd:/action %player%||ttp:&5Ancient %new line%&5%player%||&7● &7%message%")
stop
else if player has permission "youtuber":
json("@a","&c[&f►&c]&3%player's display name% ||cmd:/action %player%||ttp:&cYoutuber %new line%&7%player%||&7● &7%message%")
stop
else if player has permission "wanderer":
json("@a","&3%player's display name% ||cmd:/action %player%||ttp:&3Wanderer %new line%&3%player%||&7● &7%message%")
stop
else if player has permission "newcomer":
json("@a","&7%player's display name% ||cmd:/action %player%||ttp:&7Newcomer %new line%&7%player%||&7● &7%message%")
stop
else if player has permission "dreamer":
json("@a","&e☆&9%player's display name%&e☆ ||cmd:/action %player%||ttp: &9Dreamer %new line%&9%player%||&7● &7%message%")
stop
set {chatmessage::%player%} to the message
set {chatcooldown.last::%player%} to now