skriptMC/chat.sk

63 lines
2.4 KiB
Text

on load:
ScriptList("add", script)
on unload:
ScriptList("remove", script)
on chat: # chat
cancel event
set {_player} to userOrNick(player)
broadcast "&8[%gamemode of player%&8]&r %{_player}%&r &8➡&r %colored message%" in all worlds
command nickname [<player>] [<text>]: # changement de pseudo
executable by: players
aliases: nick
description: Change ton nom ou celui d'un autre joueur. (max 15 charactères)
trigger:
set {_playerUUID} to uuid of player
set {_player} to player
set {_playerNAME} to player
if arg-1 is set:
set {_playerUUID} to uuid of arg-1
set {_player} to arg-1
if arg-2 is not set:
if {nick.%{_playerUUID}%} is set:
set {_deb} to "Le surnom de %{_playerNAME}%"
if player is {_player}:
set {_deb} to "Votre surnom"
send "%{_deb}% est : %{nick.%{_playerUUID}%}%"
else:
send "Tu n'as pas de surnom. Nom d'affichage : %{_playerNAME}%"
stop
if player is {_player}:
set {_playerNAME} to "vous"
else:
send "&aSurnom changé."
if arg-2 is "off":
delete {nick.%{_playerUUID}%}
send "&6Tu n'as plus de surnom. (changé par %player%&6)" to {_player}
else:
if length of arg-2 is greater than 15:
send "&4Ce surnom est trop long."
else:
set {nick.%{_playerUUID}%} to colored arg-2
send "&6Ton surnom est désormais &r%{nick.%{_playerUUID}%}%&6. (changé par %{_playerNAME}%&6)" to {_player}
command msg <player> <text>: # DM
executable by: players
aliases: whisper, w, tell, t
description: Envoie un message privé à un joueur.
trigger:
send "&8[Moi -> %arg-1%&8]&7 %colored arg-2%" to player
send "&8[%player%&8 -> Moi] &b%colored arg-2%" to arg-1
set {dmReply.%uuid of player%} to arg-1
set {dmReply.%uuid of arg-1%} to player
command reponse <text>: # réponse à un DM
executable by: players
aliases: rep, r
description: Envoie un réponse à un joueur.
trigger:
if {dmReply.%uuid of player%} is set:
execute player command "msg %{dmReply.%uuid of player%}% %arg-1%"
else:
send "&4Tu n'as personne a qui répondre."