Welcome to SkriptTools.net!

SkriptTools is now part of the skUnity family! skUnity will keep SkriptTools running, updating and adding new features.


- You can now search scripts by author by doing "author:name". For example: "author:nfell2009"

- Login to SkriptTools using your skUnity account to save your favourite scripts and come back to them

Login

Script Viewer

View the code of the script directly in your browser without downloading anything.

Current File: RushFFA-DEFINITIVE-1.sk - Download / View on the skUnity Parser

#========
options:
#========

	#========
	#Misc
	#========
	
		#========
		#NE PAS MODIFIER
		current_version: DEFINITIVE-1
		#========

		#========
		#Cette option permet d'activer les mises à jour automatiques du skript (true = activer, false = désactiver)
		auto_update: true
		#========
		
		#========
		#Cette option permet d'activer les dégats de chute
		fall_damage: false
		#========
		
		#========
		#Cette option permet d'activer / désactiver le Bungeecord
		bungeecord: true
		#========
		
		#========
		#o-o-o-o-o OPTION ESSENTIELLE À CHANGER (SI BUNGEECORD = FALSE) o-o-o-o-o Changer le monde ou la partie a lieu
		map_game: votre_monde
		#========	
	
		#========
		#Cette option permet de changer le nom du GUI de sélection de kits
		name_gui: &dSélection de kit
		#========
		
		#========
		#Cette option permet de changer la taille du GUI (1 à 6)
		size_gui: 2
		#========
		
		#========
		#Cette option permet de changer l'item représentant les kits dans le gui
		item_gui: book
		#========
		
		#========
		#Cette option permet d'activer ou de désactiver la regénération des blocs posés tout en même temps sur la map de FFARush > true = oui / false = non
		regen_block: false
		#Si regen_block = true, cette option permet de sélectionner le temps avant que tous les blocks se régénèrent.
		cd: 30 seconds
		#========
		
		#========
		#Cette option permet de changer la permission de la commande /rushffa
		permission: rushffa.admin
		#========
		
		#========
		#Cette option permet de changer le format de permission des kits
		kit_permission_format: rushffa.kit.%{_kit}%
		#========
		
		#========
		#Cette option permet de activer la perte de nourriture (false) ou de la désactiver (true)
		no_food_loss: true
		#========
		
		#========
		#Items de sélection de kits
		item: a nether star
		#Nom de l'item de sélection de kits
		item_name: &dKits
		#Slot de l'item de sélection de kits
		item_slot: 4
		#========
	
	#========
	#Messages
	#========
	
		#========
		#Message lorsque un joueur rejoins la partie (Si bungeecord = false)
		join_game_msg: &dTu rejoins la partie !
		#========
		
		#========
		#Message quand on quitte la partie (Si bungeecord = false)
		quit_game_msg: &dTu quittes la partie !
		#========
	
		#========
		#Message d'erreur quand un kit n'existe pas
		erreur_kitnoexist: &cErreur, ce kit n'existe pas !
		#========
		
		#========
		#Message d'erreur quand un kit existe déjà
		erreur_kitalreadyexist: &cErreur, ce kit existe déjà !
		#========
		
		#========
		#Message d'erreur quand un kit n'existe pas
		erreur_insuffisantperms: &cErreur, vous n'avez pas la permission de faire ceci !
		#========
		
		#========
		#Préfixe du plugin (mettre un "&r" si vous ne voulez pas de préfixe)
		prefix: &r
		#========
		
		#========
		#Message quand on créé un kit
		add_kit_msg: &dTu as créé le kit %{_kit}% !
		#========
		
		#========
		#Message quand on supprime un kit
		remove_kit_msg: &dTu as supprimé le kit %{_kit}% ! 
		#========
		
		#========
		#Message quand on sauvegarde un kit
		save_kit: &dTu as sauvegardé le kit %{_kit}% !
		#========
		
		#========
		#Message quand on sauvegarde un kit
		receive_kit: &dTu as reçu le kit %{_kit}% !
		#========
		
		#========
		#Message quand les blocs sont regénérés (si regen_block = true)
		regen_block_message: &dLes blocs ont été régénérés.
		#========
		
		#========
		#Message quand un joueur fait la commande /rushffa join mais qu'il est déjà en jeu (si bungeecord = false)
		already_in_game_msg: &dTu es déjà en jeu !
		#========
		
		#========
		#Message quand un joueur fait la commande /rushffa leave et qu'il n'est pas en jeu (si bungeecord = false)
		not_in_game_msg: &dTu n'es pas en jeu !
		#========
		
		#========
		#Message lors de l'ajout d'un spawn
		add_spawn_msg: &dVotre position actuelle a été ajouté à la liste des points de spawns.
		#========
		
		#========
		#Message lors de la réinitialisation des spawns
		reset_spawn_msg: &dVous avez bien réinitialisé les points de spawns.
		#========
		
		#========
		#Message lors de la mort par un autre joueur (action bar)
		death_msg_1: &f%victim% &da été tué par &f%attacker%
		#========
		
		#========
		#Message lors de la mort par autre chose (action bar)
		death_msg_2: &f%victim% &dest mort
		#========
		
		#========
		#Message quand le spawn principal est défini
		main_spawn_msg: &dLe spawn principal a été défini à votre position actuelle.
		#========
	
	#========
	#Scoreboard 
	#========
	
		#{_p} veut dire joueur donc %player%
		
		#========
		#Permet de désactiver / activer le scoreboard pour les joueurs
		scoreboard: true
		#========
		
		#========
		#Permet de modifier le nom du scoreboard (si il est actif)
		scoreboard_name: &dRushFFA
		#========
		
		#========
		#Permet de modifier le format de l'une ligne
		scoreboard_1: &fKills: %{rf_kills::%{_p}%}% #de base le nombre de kills
		scoreboard_2: &fMorts: %{rf_deaths::%{_p}%}% #de base le nombre de morts
		scoreboard_3: &fRatio: %{_ratio}% #de base le ratio du joueur
		#========
	
#=========
#FUNCTIONS
#=========
function RFScoreboard(p: player): #Function pour actualiser le Scoreboard
	set {_ratio} to ({rf_kills::%{_p}%} / {rf_deaths::%{_p}%})
	wipe {_p}'s sidebar
	set name of sidebar of {_p} to "{@scoreboard_name}"
	set score "{@scoreboard_1}" in sidebar of {_p} to 15
	set score "{@scoreboard_2}" in sidebar of {_p} to 14
	set score "{@scoreboard_3}" in sidebar of {_p} to 13
	
function RFMapRegen(t: text): #Function pour regénérer les blocs posés
	loop {rf_blocks::*}:
		set block at loop-value to air
	clear {rf_blocks::*}
	if {@bungeecord} is false:
		loop all players:
			if {rf_playing::%loop-player%} is set:
				send "{@prefix}{@regen_block_message}" to loop-player
				stop
	broadcast "{@prefix}{@regen_block_message}"
			
			
function RFSaveKit(p: player, kit: text): #Function pour sauvegarder un kit du menu
	if {rf_kits::%{_kit}%} is true:
		set {rf_kit::%{_kit}%::inv} to {_p}'s serialized inventory
		set {rf_kit::%{_kit}%::helm} to {_p}'s helmet
		set {rf_kit::%{_kit}%::chest} to {_p}'s chestplate
		set {rf_kit::%{_kit}%::leg} to {_p}'s leggings
		set {rf_kit::%{_kit}%::boots} to {_p}'s boots
		send "{@prefix}{@save_kit}" to {_p}
	else:
		send "{@prefix}{@erreur_kitnoexist}" to {_p}
		
function RFGiveKit(p: player, kit: text): #Function pour donner le kit à un joueur
	if {rf_kits::%{_kit}%} is true:
		equip {_p} with {rf_kit::%{_kit}%::helm}
		equip {_p} with {rf_kit::%{_kit}%::chest}
		equip {_p} with {rf_kit::%{_kit}%::leg}
		equip {_p} with {rf_kit::%{_kit}%::boots}
		restore inventory of {_p} from {rf_kit::%{_kit}%::inv}
		send "{@prefix}{@receive_kit}" to {_p}
	else:
		send "{@prefix}{@erreur_kitnoexist}" to {_p}
		
function RFAddKit(p: player, kit: text): #Function pour ajouter un kit dans le menu
	if {rf_kits::%{_kit}%} is true:
		send "{@prefix}{@erreur_kitalreadyexist}" to {_p}
	else:
		send "{@prefix}{@add_kit_msg}" to {_p}
		set {rf_kits::%{_kit}%} to true
		RFSaveKit({_p}, {_kit})
				
function RFRemoveKit(p: player, kit: text): #Function pour supprimer un kit du menu
	if {rf_kits::%{_kit}%} is true:
		clear {rf_kits::%{_kit}%}
		clear {rf_kit::%{_kit}%::helm}
		clear {rf_kit::%{_kit}%::chest}
		clear {rf_kit::%{_kit}%::leg}
		clear {rf_kit::%{_kit}%::boots}
		clear {rf_kit::%{_kit}%::inv}
		send "{@prefix}{@remove_kit_msg}" to {_p}
	else:
		send "{@prefix}{@erreur_kitnoexist}" to {_p}
		
function RFGui(p: player): #Function pour ouvrir le menu des kits
	open virtual chest inventory with size {@size_gui} named "{@name_gui}" to {_p}
	wait 1 tick
	set {_s} to 0
	loop {rf_kits::*}:
		set {_k} to loop-index
		make a gui slot {_s} of {_p} with a {@item_gui} named coloured "%loop-index%" parsed as text to run:
			if {_p} has permission "{@kit_permission_format}":
				RFGiveKit({_p}, {_k})
				set {_sp} to a random element out of {rf_spawns::*}
				teleport {_p} to {_sp}
			else:
				send "{@prefix}{@erreur_insuffisantperms}"
		add 1 to {_s}

function RFPlay(p: player): #Function pour commencer a jouer
	if {@bungeecord} is false:
		set {rf_playing::%{_p}%} to location of {_p}
		set {rf_inv::%{_p}%::leg} to {_p}'s leggings
		set {rf_inv::%{_p}%::boots} to {_p}'s boots
		set {rf_inv::%{_p}%} to {_p}'s serialized inventory
		set {rf_inv::%{_p}%::helm} to {_p}'s helmet
		set {rf_inv::%{_p}%::chest} to {_p}'s chestplate
		send "{@prefix}{@join_game_msg}" to {_p}
	RFScoreboard({_p})
	teleport {_p} to {rf_spawn.main}
	make console execute command "/minecraft:clear %{_p}%"
	wait 1 tick
	set slot {@item_slot} of {_p} to {@item} named "{@item_name}" 

function RFUpdate(arg: text): #Function pour update le skript
	if {_arg} is "check":
		if text from "https://pastebin.com/raw/HWuz0LsP" is not "{@current_version}":
			if {@auto_update} is true:
				RFUpdate("update")
			else:
				set {rf_update} to true
				loop all players:
					if loop-player is op:
						send "{@prefix} &7Une &dmise à jour &7est disponible, faites &d/rushffa update &7pour la télécharger." to loop-player
	if {_arg} is "update":
		if text from "https://pastebin.com/raw/HWuz0LsP" is not "{@current_version}":
			set {_version} to text from "https://pastebin.com/raw/HWuz0LsP"
			download from "https://pastebin.com/raw/rxEcW7wD" to "plugins/Skript/scripts/RushFFA-%{_version}%.sk"
			delete file "plugins/Skript/scripts/%script's name%.sk"
			wait 0.5 second
			make console execute command "/sk reload all"
			clear {rf_update}

#=========
#Games Mechanics
#=========
on load:
	RFUpdate("check")
	wait 1 tick
	if {rf_update} is true:
		loop all players:
			if loop-player is op:
				send "{@prefix} &7Une &dmise à jour &7est disponible, faites &d/rushffa update &7pour la télécharger." to loop-player

on hunger meter change:
	if {@bungeecord} is true:
		if {@no_food_loss} is true:
			set player's food bar to 20
	else:
		if {rf_playing::%player%} is true:
			if {@no_food_loss} is true:
				set player's food bar to 20
	 
on damage:
	if {@bungeecord} is true:
		if damage cause is attack:
			set {rf_lasthit::%victim%} to attacker
		if damage cause is fire:
			cancel event
		if damage cause is burning:
			extinguish victim
			cancel event
		if damage cause is fall:
			if {@fall_damage} is false:
				cancel event
	else:
		if {rf_playing::%victim%} is set:
			if damage cause is attack:
				set {rf_lasthit::%victim%} to attacker
			if damage cause is fire:
				cancel event
			if damage cause is burning:
				extinguish victim
				cancel event
			if damage cause is fall:
				if {@fall_damage} is false:
					cancel event
			
		
every {@cd}:
	if {@regen_block} is true:
		RFMapRegen("Regen")
	else:
		stop
		
on place:
	if {@bungeecord} is true:
		if event-block is sandstone:
			remove 1 sandstone:2 from player's inventory
			give 1 sandstone:2 to player
		if {@regen_block} is true:
			if event-block is sandstone:2:
				add location of event-block to {rf_blocks::*}
		else:
			wait 20 seconds
			if event-block is sandstone:2:
				set event-block to air
	else:
		if player's world is "{@map_game}":
			if event-block is sandstone:
				remove 1 sandstone:2 from player's inventory
				give 1 sandstone:2 to player
			if {@regen_block} is true:
				if event-block is sandstone:2:
					add location of event-block to {rf_blocks::*}
			else:
				wait 20 seconds
				if event-block is sandstone:2:
					set event-block to air
		
on break:
	if {@bungeecord} is true:
		if event-block is sandstone:2 or tnt:
			stop
		else:
			cancel event
	else:
		if player's world is "{@map_game}":
			if event-block is sandstone:2 or tnt:
				stop
			else:
				cancel event
			
on death of player:
	clear drops
	if {rf_lasthit::%victim%} is set:
		give 4 tnt to attacker
		add 1 to {rf_lasthit::%victim%}
		RFScoreboard({rf_lasthit::%victim%})
		wait 1 tick 
		heal attacker
		loop all players:
			set action bar of loop-player to "{@death_msg_1}"
	else:
		loop all players:
			set action bar of loop-player to "{@death_msg_2}"
	add 1 to {rf_deaths::%victim%}
		
#=========
#Commande principale
#=========
command /rushffa [<text>] [<string>]:
	aliases: /rf, /ffarush, /fr
	permission: {@permission}
	permission message: {@prefix}{@erreur_insuffisantperms}
	trigger:
		if player has permission "{@permission}":
			if arg 1 is not set:
				send "&d- RushFFA -"
				send "&f/rushffa <spawn> <main / add / clear> &7: définir ou clear les spawns"
				send "&f/rushffa <definekit> <default, vip, vip+, youtuber, famous>"
				send "&f/rushffa <check>"
				send "&f/rushffa <update>"
			if arg 1 is set:
				if arg 1 is "spawn":
					if arg 2 is "add":
						add location of player to {rf_spawns::*}
						send "{@prefix}{@add_spawn_msg}"
					if arg 2 is "main":
						set {rf_spawn.main} to location of player
						send "{@prefix}{@main_spawn_msg}"
					if arg 2 is "clear":
						clear {rf_spawn.main}
						clear {rf_spawns::*}
						send "{@prefix}{@reset_spawn_msg}"
				if arg 1 is "addkit" or "add":
					if arg 2 is set:
						RFAddKit(player, "%arg-2%")
				if arg 1 is "removekit" or "deletekit" or "delete":
					if arg 2 is set:
						RFRemoveKit(player, "%arg-2%")
				if arg 1 is "inventory" or "inv":
					RFSaveKit(player, "%arg-2%")
				if arg 1 is "check":
					RFUpdate("check")
					wait 0.6 second
					if {rf_update} is not set:
						send "{@prefix}&dVous possédez la dernière version de RushFFA"
				if arg 1 is "update":
					RFUpdate("update")
					wait 0.6 second
					send "{@prefix}&dVous possédez la dernière version de RushFFA"
		if {@bungeecord} is false:
			if arg 1 is "join":
				if {rf_playing::%player%} is not set:
					RFPlay(player)
				else:
					send "{@already_in_game_msg}"
			if arg 1 is "leave" or "quit":
				if {rf_playing::%player%} is set:
					teleport player to {rf_playing::%player%}
					clear {rf_playing::%player%}
					wipe player's sidebar
					send "{@quit_game_msg}"
					wait 1 tick
					equip {_p} with {rf_inv::%player%::helm}
					equip {_p} with {rf_inv::%player%::chest}
					equip {_p} with {rf_inv::%player%::leg}
					equip {_p} with {rf_inv::%player%::boots}
					restore inventory of player from {rf_inv::%player%}
				else:
					send "{@not_in_game_msg}"
#=========
#Séléction de kit et jeu
#=========
on first join:
	if {rf_kills::%player%} is not set:
		set {rf_kills::%player%} to 0
	if {rf_deaths::%player%} is not set:
		set {rf_deaths::%player%} to 0
	if {@bungeecord} is true:
		RFPlay(player)
	
on join:
	if {rf_kills::%player%} is not set:
		set {rf_kills::%player%} to 0
	if {rf_deaths::%player%} is not set:
		set {rf_deaths::%player%} to 0
	if {@bungeecord} is true:
		RFPlay(player)
		if player is op:
			if {rf_update} is true:
				send "{@prefix}&7Une &dmise à jour &7est disponible, faites &d/rushffa update &7pour la télécharger."
	if {rf_playing::%player%} is set:
		teleport player to {rf_playing::%player%}
		clear {rf_playing::%player%}
	
on respawn:
	if {@bungeecord} is true:
		wait 2 ticks
		RFPlay(player)
	else if {rf_playing::%player%} is set:
		wait 2 ticks
		RFPlay(player)
	
on rightclick with {@item}:
	if name of tool of player is "{@item_name}":
		RFGui(player)