Code:
command /friends [<text>] [<player>]:
permission: acai.friendscmd
trigger:
if arg-1 is "add":
if arg-2 is set:
add arg-2 to {friendslist::%player%}
else:
if arg-1 is "remove":
if arg-2 is set:
remove arg-2 from {friendslist::%player%}
else:
if arg-1 is "chat":
if {fchat.%player%} is 0:
set {fchat.%player%} to 1
else:
if {fchat.%player%} is 1:
set {fchat.%player%} to 0
on chat:
if {fchat.%player%} is 1:
cancel event
loop all players:
if {friendslist::%loop-player%} contains %player%:
if {fchat.%loop-player%} is 1:
send "&1&lFRIEND-CHAT &f&l> &r%player% - %message%" to loop-player
Hello, I am currently making a chat system, where it will send a player's chat message to their friends if they have {fchat.%player%} enabled, and their friends have it on too. The only resource I could find for this was over a year old, and it was a spigot thread.
Any help on redirecting a player's message to their friends contained on their friends list? Thank you!
Would there be a way
[doublepost=1607104102,1607093437][/doublepost]Never mind, have fixed with this code:
Code:
command /friends [<text>] [<player>]:
permission: acai.friendscmd
trigger:
if arg-1 is "add":
if arg-2 is set:
add arg-2 to {friendslist::%player%}
else:
if arg-1 is "remove":
if arg-2 is set:
remove arg-2 from {friendslist::%player%}
else:
if arg-1 is "chat":
if {fchat.%player%} is 0:
set {fchat.%player%} to 1
else:
if {fchat.%player%} is 1:
set {fchat.%player%} to 0
on chat:
if {fchat.%player%} is 1:
cancel event
loop all players:
if {friendslist::%loop-player%} contains player:
if {fchat.%loop-player%} is 1:
send "&1&lFRIEND-CHAT &f&l> &r%player% - %message%" to loop-player