I'm trying to make a command to toggle PMs, but it simply doesn't seem to work. Here's my code:
code_language.skript:
command /msg [<offlineplayer>] [<text>]:
aliases: /m, /tell, /t, /w, /message, /pm
trigger:
if arg-1 is offline:
send "&c%arg-1% is not online"
stop trigger
if arg-1 is not set:
send "&cPlease specify a player"
stop trigger
if arg-2 is not set:
send "&cPlease specify a message"
stop trigger
else:
set {chat.private.reply.%player%} to arg-1
set {chat.private.reply.%arg-1%} to player
send "&7(To %arg-1%&7) %arg 2%" to player
send "&7(From %player%&7) %arg 2%" to arg-1
if {messages.%player%} is true:
send "&c%arg 1% has disabled private messages" to player
stop trigger
if {messages.%player%} is false:
set {chat.private.reply.%player%} to arg-1
set {chat.private.reply.%arg-1%} to player
send "&7(To %arg-1%&7) %arg 2%" to player
send "&7(From %player%&7) %arg 2%" to arg-1
command /r [<text>]:
aliases: /reply
trigger:
if {chat.private.reply.%player%} is not set:
send "&cYou have not messaged a player recently"
stop trigger
else:
if arg-1 is not set:
send "&cPlease specify a message"
stop trigger
if {chat.private.reply.%player%} is offline:
send "&c%{chat.private.reply.%player%}% recently went offline"
stop trigger
else:
send "&7(To %{chat.private.reply.%player%}%&7) %arg-1%" to player
send "&7(From %player%&7) %arg-1%" to {chat.private.reply.%player%}
command /togglepm [<text>]:
aliases: /tpm
trigger:
if arg-1 is set:
send "&cUsage: /tpm"
stop trigger
else:
if {messages.%player%} is not set:
set {messages.%player%} to false
if {messages.%player%} is false:
set {messages.%player%} to true
send "&cYou have disabled private messages" to player
stop
if {messages.%player%} is true:
set {messages.%player%} to false
send "&aYou have enabled private messages" to player
stop