skriptMC/main.sk
2021-06-28 02:45:00 +02:00

472 lines
19 KiB
Text

options:
serverName: "Serveur d'Anri"
errorMessage: "&4Tu n'as pas la permission d'utiliser cette commande."
function sendToOperators(player: player, message: text):
loop all players:
if loop-player is a op:
if loop-player is not {_player}:
send {_message} to loop-player
command skr [<text>]: # recharge ce skript
executable by: players, console
description: Reload de skripts.
trigger:
if arg-1 is set:
execute player command "sk reload %arg-1%"
else if arg-1 isn't set:
execute player command "sk reload main" # sk reload all pour tout reload
command broadcast [<text>]: # annonce
executable by: players, console
aliases: bc
description: Fais une annonce à tout le monde. (30s de cooldown)
cooldown: 30 seconds
cooldown message: &4Tu dois attendre &l%remaining time% &4pour refaire cette commande !
trigger:
if player is op:
if arg-1 is set:
broadcast "&a&lBREAKING NEWS &7» &6%colored text-arg%"
send all players title "&a&lBREAKING NEWS" with subtitle "&6%colored text-arg%" for 5 seconds
else:
send "&4Vous n'avez pas spécifier de texte."
else:
cancel command cooldown
send {@errorMessage}
command skull [<offline player>]: # récupère la tête d'un joueur
executable by: players
aliases: head, tete
description: Te drop une tête d'un joueur.
trigger:
if player is op:
set {_player} to player
if arg-1 is set:
set {_player} to arg-1
give {_player}'s skull to player
send "&7Vous avez reçu la tête de : &6%{_player}%"
else:
send {@errorMessage}
command clearchat: # supprime l'historique du tchat
executable by: players, console
aliases: cc
description: Efface l'historique du chat dans ton monde. (1mn de cooldown)
cooldown: 1 minute
cooldown message: &4Tu dois attendre &l%remaining time% &4pour refaire cette commande !
trigger:
if player is op:
loop 98 times:
broadcast " " in world of player
broadcast "&cLe Chat a été clear par &e%player%&c." in world of player
broadcast " " in world of player
else:
cancel command cooldown
send {@errorMessage}
command forceexecute <player> <text>: # force un joueur à éxécuter une commande
executable by: players, console
aliases: fe
description: Force une personne à executer une commande.
trigger:
if player is op:
execute arg-1 command arg-2
else:
send {@errorMessage}
on weather change to rain or thunder: # soleil pour toujours
cancel event
command sethome [<text>]: # défni un home
executable by: players
description: Défini un point de téléportation.
trigger:
if arg-1 isn't set:
set {_name} to "maison"
else:
set {_name} to arg-1
if {home.%player's uuid%.%{_name}%} is set:
if arg-1 isn't set:
set {_name} to ""
else:
set {_name} to "%{_name}% "
send "&4Cette maison existe déjà, &8/delhome %{_name}%&4pour la supprimer."
else:
remove {_name} from {home.%player's uuid%::*}
add {_name} to {home.%player's uuid%::*}
set {home.%player's uuid%.%{_name}%} to player's location
send "Ta maison ""&a%{_name}%&r"" est maintenant définie aux coordonnées &7%player's location%&r !"
command delhome [<text>]: # supprime un home
executable by: players
description: Supprime un point de téléportation.
trigger:
if arg-1 isn't set:
set {_name} to "maison"
else:
set {_name} to arg-1
if {home.%player's uuid%.%{_name}%} is set:
remove {_name} from {home.%player's uuid%::*}
clear {home.%player's uuid%.%{_name}%}
send "Maison ""&a%{_name}%&r"" supprimée."
else:
send "&4Cette maison n'existe pas."
make player execute command "listhome"
command home [<text>]: # téléportation vers home
executable by: players
description: Te téléportes vers un point de téléportation.
trigger:
if arg-1 isn't set:
set {_name} to "maison"
else:
set {_name} to arg-1
if {home.%player's uuid%.%{_name}%} is set:
send "&aTéléportation vers &9%{_name}% &a!"
teleport player to {home.%player's uuid%.%{_name}%}
else:
send "&4Le home ""&c%{_name}%"" &4n'existe pas."
make player execute command "listhome"
on tab complete for "home" and "delhome": # autocompletion des homes
if {home.%player's uuid%::*} is set:
set tab completions for position 1 to the first element of {home.%player's uuid%::*}
loop {home.%player's uuid%::*}:
add loop-value to tab completions
command listhome: # liste tes homes
executable by: players
description: Liste des tes points de téléportations.
trigger:
if {home.%player's uuid%::*} isn't set:
send "&4Vous n'avez pas de maisons."
else:
set {_maisons} to "%{home.%player's uuid%::*}%"
replace all "and" with "&7et&3" in {_maisons}
replace all "," with "&7,&3" in {_maisons}
send "&aListe des tes maisons : &3%{_maisons}%&7."
command rename <text>: # renomme un item
executable by: players
description: Renomme l'item que tu as dans ta main.
trigger:
if player is op:
if player's tool is air:
send "&4Tu dois avoir un item dans la main pour le renommer."
else:
set {_name} to colored text-arg
replace all "&" with "§" in {_name}
send "&eL'item &r%player's tool%&e est renommé en ""&r%{_name}%&e""."
set the name of the player's tool to "§r%{_name}%"
else:
send {@errorMessage}
command afk: # annonce d'afk
executable by: players
description: Annonce que tu vas afk.
trigger:
broadcast "&a%player's name%&c est désormais afk !" in world of player
command gmc [<player>]: # met un joueur en créatif
executable by: players
description: Change le mode de jeu d'un joueur en créatif.
trigger:
if player is op:
set {_player} to player
if arg-1 is set:
set {_player} to arg-1
if gamemode of {_player} is creative:
send "&4Ce joueur est déjà en créatif."
stop
set gamemode of {_player} to creative
send "%player% a changé ton mode de jeu en créatif." to {_player}
sendToOperators({_player}, "&7&o%player%&7&o a changé le mode de jeu de %{_player}%&7&o en créatif.")
else:
send {@errorMessage}
command gms [<player>]: # met un joueur en spectateur
executable by: players
description: Change ton mode de jeu d'un joueur en spectateur
trigger:
if player is op:
set {_player} to player
if arg-1 is set:
set {_player} to arg-1
if gamemode of {_player} is spectator:
send "&4Ce joueur est déjà en spectateur."
stop
set gamemode of {_player} to spectator
send "%player% a changé ton mode de jeu en spectateur." to {_player}
sendToOperators({_player}, "&7&o%player%&7&o a changé le mode de jeu de %{_player}%&7&o en spectateur.")
else:
send {@errorMessage}
command top: # téléporte un joueur tout en haut
executable by: players
description: Te téléporte sur le bloc le plus haut.
trigger:
if player is op:
teleport player to location of highest block at location
else:
send {@errorMessage}
on first join: # premiere fois que le joueur rejoins le serveur
set join message to "&aC'est la première fois que l'on te vois &r%player%, &abienvenue !"
on join: # joueur rejoins le serveur
set join message to "%player% &aa rejoint le serveur !"
set {playerIP.%ip of player%} to player
on quit:
set quit message to "%player% &ca quitté le serveur !" # joueur quitte le serveur
delete {dmReply.%uuid of player%} # suppression de la réponse
command killall: # tue toutes les entités
executable by: players
description: Tue toutes les entités du monde sauf joueur, porte-armure, flèche, tableau, cadre, bateau, villageois et entité avec un nom.
trigger:
if player is op:
set {_count} to 0
loop twice:
loop all entities:
if loop-entity is player:
continue
if loop-entity is armor stand:
continue
if loop-entity is arrows:
continue
if loop-entity is painting:
continue
if loop-entity is item frame:
continue
if loop-entity is boat:
continue
if loop-entity is villager:
continue
if loop-entity's name is set:
continue
kill loop-entity
add 1 to {_count}
send "Tu as tué %{_count}% entités."
sendToOperators(player, "&7%player%&7 as tué %{_count}%&7 entités.")
else:
send {@errorMessage}
command feed [<player>]: # remplie barre de nourriture
executable by: players
description: Remplie la barre de nourriture d'un joueur.
trigger:
if player is op:
set {_player} to player
set {_playerNAME} to player
if arg-1 is set:
set {_player} to arg-1
if player is {_player}:
set {_playerNAME} to "toi-même"
else:
send "Tu as nourris %{_player}%."
feed {_player}
send "Tu as été nourris. (par %{_playerNAME}%)" to {_player}
else:
send {@errorMessage}
on chat: # chat
cancel event
if {nick.%uuid of player%} is set:
set {_player} to {nick.%uuid of player%}
else:
set {_player} to player's name
broadcast "<%{_player}%&r> %colored message%" in world of player
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:
if player is op:
set {_playerUUID} to uuid of player
set {_player} to player
set {_playerNAME} to player
if player-arg is set:
set {_playerUUID} to uuid of player-arg
set {_player} to player-arg
if player is {_player}:
set {_playerNAME} to "vous"
if text-arg is "off":
delete {nick.%{_playerUUID}%}
send "&6Tu n'as plus de surnom. (changé par %player%&6)" to {_player}
else:
if length of text-arg is greater than 15:
send "&4Ce surnom est trop long."
else:
set {nick.%{_playerUUID}%} to colored text-arg
send "&6Ton surnom est désormais &r%{nick.%{_playerUUID}%}%&6. (changé par %{_playerNAME}%&6)" to {_player}
else:
send {@errorMessage}
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 text-arg%" to player
send "&8[%player%&8 -> Moi] &b%colored text-arg%" 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."
on server list ping: # motd
if {playerIP.%ip%} is set:
set motd to "&e&k||| &cSalut &a%{playerIP.%ip%}%&c, reconnecte-toi ! &e&k|||"
else:
set {_serverName} to {@serverName}
set motd to "&e&k||| &c%{_serverName}% &e&k|||"
set max players count to (number of all players + 1)
if max players count > {_playerCount}:
set max players count to (number of all players + 1)
every 1 second in "world":
loop all players:
if {blockNear.%uuid of loop-player%} is true: # affiche le block proche de toi
loop all blocks in radius 3 of loop-player:
if loop-block is target block of loop-player:
set action bar of loop-player to "&a%target block of loop-player%"
set {_serverName} to {@serverName}
set tab header to "&a%{_serverName}%" and footer to "&e%number of all players% joueurs connectés\n&9%ping of loop-player% ms de latence" for loop-player
command quelbloc: # commande pour activer ou désactiver l'affiche du bloc proche de toi
executable by: players
description: T'affiches le bloc en face de toi. (switch off/on)
trigger:
if {blockNear.%uuid of player%} is set:
delete {blockNear.%uuid of player%}
send "&cTu ne verras désormais plus le nom du bloc proche de toi."
else:
set {blockNear.%uuid of player%} to true
send "&aTu verras désormais le nom du bloc proche de toi."
command deacoudre: # dé à coudre
executable by: players
description: Lance une partie de dé à coudre.
trigger:
if player is op:
if {thimble} is true:
delete {thimble}
teleport player to location at 101.5, 83, -314 in world "world"
execute player command "fill 103 57 -313 99 57 -305 water"
broadcast "&cPartie de dé à coudre terminée."
set gamemode of all players to creative
else:
set {thimble} to true
broadcast "&aDémarrage de la partie de dé à coudre !"
loop all players:
teleport loop-player to location at 101.5, 83, -314 in world "world"
set gamemode of loop-player to adventure
feed loop-player
heal loop-player
cure loop-player
else:
send {@errorMessage}
every 0.5 second in "world": # dé à coudre
if {thimble} is not true:
stop
loop all players:
set action bar of loop-player to "&dEn partie de &lDé à coudre&r&d."
if block at loop-player is water:
set {_xLocationBlock1} to difference between X-location of block at loop-player and 103.5
set {_xLocationBlock2} to difference between X-location of block at loop-player and 99.5
set {_zLocationBlock1} to difference between Z-location of block at loop-player and -312.5
set {_zLocationBlock2} to difference between Z-location of block at loop-player and -304.5
set {_yLocationBlock} to difference between Y-location of block at loop-player and 57.5
if {_xLocationBlock1} and {_xLocationBlock2} and {_zLocationBlock1} and {_zLocationBlock2} <= 0:
continue
if {_xLocationBlock1} and {_xLocationBlock2} >= 4:
continue
if {_yLocationBlock} != 0:
continue
if {_zLocationBlock1} and {_zLocationBlock2} >= 8:
continue
set block at loop-player to wool
teleport loop-player to location at 101.5, 83, -314 in world "world"
feed loop-player
heal loop-player
command casque:
executable by: players
aliases: hat
description: Équipe l'objet dans ta main principale sur ta tête.
trigger:
if player is op:
if helmet of player is not air:
set {_item} to helmet of player
if tool of player is air:
if {_item} is set:
send "&cItem retiré !"
else:
send "&4Tu n'as rien dans tes mains."
stop
set helmet of player to tool of player
remove tool of player from inventory of player
add {_item} to inventory of player
if helmet of player is not air:
send "&aItem équippé !"
else:
send {@errorMessage}
command clear [<player>]:
executable by: players
description: Clear l'inventaire d'un joueur mais pas l'équipement.
trigger:
if player is op:
set {_player} to player
set {_arg1} to arg-1
if player is arg-1:
delete {_arg1}
if arg-1 is set:
set {_player} to arg-1
set {_helmet} to helmet of {_player}
set {_chestplate} to chestplate of {_player}
set {_leggings} to leggings of {_player}
set {_boots} to boots of {_player}
clear {_player}'s inventory
set helmet of {_player} to {_helmet}
set chestplate of {_player} to {_chestplate}
set leggings of {_player} to {_leggings}
set boots of {_player} to {_boots}
if {_arg1} is set:
send "&aTu as clear l'inventaire de %arg-1%&a."
send "&aTon inventaire a été clear par %player%&a." to arg-1
else:
send "&aTu as clear ton inventaire."
else:
send {@errorMessage}
command clearall [<player>]:
executable by: players
description: Clear tout l'inventaire d'un joueur.
trigger:
if player is op:
set {_player} to player
set {_arg1} to arg-1
if player is arg-1:
delete {_arg1}
if arg-1 is set:
set {_player} to arg-1
clear {_player}'s inventory
if {_arg1} is set:
send "&aTu as clear l'inventaire de %arg-1%&a."
send "&aTon inventaire a été clear par %player%&a." to arg-1
else:
send "&aTu as clear ton inventaire."
else:
send {@errorMessage}