KitPvp.sk

Created by novastosha

Just so you know, we don't know the file format for every file. If it's just a bunch of random characters, it's probably a .zip or .jar.

# Customizable NEW! Kit Previewing (Enable/Disable)
# Customizable NEW! Custom Kits (Enable/Disable)
# Customizable NEW! Custom Abilities (Enable/Disable)
# Customizable NEW! Signs (Enable/Disable)
# Customizable NEW! Scoreboard (Enable/Disable)
# Customizable NEW! Leveling System (Enable/Disable)
# Customizable NEW! Per World Support (Enable/Disable)
# Customizable NEW! PlaceholderAPI Support (Enable/Disable)
# Customizable Kit Abilities (Enable/Disable)
# Customizable Player Tracker (Enable/Disable)
# Customizable Soups (Enable/Disable)
# Customizable Animated Death Title (Enable/Disable)
# Customizable Kit GUI (Enable/Disable)
# Customizable Death Messages (Enable/Disable)
# Customizable Arrow Hit Health Message (Enable/Disable)
# Customizable Hit Sound (Enable/Disable)
# Customizable Join Kit Item (Enable/Disable)
# Customizable Join Leave Item (Enable/Disable)
# Customizable Arrow Return (Enable/Disable)
# Customizable Regainable Soups (Enable/Disable)
# Customizable Skip Death Screen (Enable/Disable)
# Customizable Kill Commands (Enable/Disable)
# Customizable Death Commands (Enable/Disable)
# Customizable Respawn Commands (Enable/Disable)
# Customizable Level Up Commands (Enable/Disable)
# Customizable Messages (Enable/Disable)
# Customizable Death Message (Enable/Disable)
# Customizable Death Sound (Enable/Disable)
#ArmorStand
options:
	main: "plugins/KitPVP/config.yml"
on load:
	if file {@main} exists:
		stop
	else:
		create file {@main}
		set skutil yml value "KitPVP.Settings.Prefix" from file {@main} to "&eKitPVP&8&l>>&r"
		set skutil yml value "KitPVP.Settings.ArrowMessage" from file {@main} to true
		set skutil yml value "KitPVP.Settings.TitleScoreBoard" from file {@main} to "&e&lKITPVP"
		wf "##DON'T CHANGE THE VERSION THIS WILL CAUSE MANY BUGS" to {@main}
		set skutil yml value "Config.version" from file {@main} to 3.5
		set skutil yml value "Config.check-for-updates" from file {@main} to true
		set skutil yml value "Config.download-updates" from file {@main} to true
		set skutil yml value "Config.path" from file {@main} to "plugins/Skript/scripts/prisoncore.sk"
		set skutil yml value "Maps.Drop" from file {@main} to false
		set skutil yml value "Map.Rain" from file {@main} to false
		set skutil yml value "Maps.Hunger" from file {@main} to false
		set skutil yml value "Maps.BlockBreak" from file {@main} to false
		set skutil yml value "Maps.ItemDamage" from file {@main} to false
function KP_SendMessage(p: player, type: text, message: text):
	set {_prefix} to skutil yml value "KitPVP.Settings.Prefix" from file {@main}
	if {_type} == "correct":
		send "%{_prefix}% &7%{_message}%" to {_p}
	if {_type} == "error":
		send "%{_prefix}% &8%{_message}%" to {_p}
command kitpvp [<text>] [<text>] [<text>] [<text>] [<player>]:
	aliases: kp
	trigger:
		if arg 1 is "createmap" or "create":
			if player has permission "KitPVP.Maps.Create":
				if {KP::Maps::%arg 2%} is not set:
					KP_SendMessage(player, "correct", "The map %arg 2% has been created!")
					set {KP::Maps::%arg 2%} to arg 2
					set {KP::Maps::%world of player%} to arg 2
					set {KP::Maps::World::%arg 2%} to world of player
					set {KP::Maps::WorldOf::%world of player%} to world of player
				else:
					KP_SendMessage(player, "error", "This map exists")
		if arg 1 is "setspawn":
			if player has permission "KitPVP.Maps.SetSpawn":
				if {KP::Maps::%arg 2%} is set:
					set {_loc} to location of player
					KP_SendMessage(player, "correct", "Spawn of map %arg 2% has been set to: World: %world of player%, X: %x coord of {_loc}%, Y: %y coord of {_loc}%, Z: %z coord of {_loc}%")
					set {KP::Maps::%arg 2%::Spawn} to {_loc}
				else:
					KP_SendMessage(player, "error", "This map does not exist")
		if arg 1 is "help":
			if player has permission "KitPVP.ViewHelp":
				set {_prefix} to player's prefix


				set player's display name to "&6[MVP++] %player%"
				send "&7-------------&aKitPvP Commands&7---------------"
				send "&a/kitpvp createmap <map name>"
				send "&a/kitpvp setspawn <map name>"
				send "&a/kitpvp setrain <true/false>"
				send "&a/kitpvp sethunger <true/false>"
				send "&a/kitpvp setitemDrop <true/false>"
				send "&a/kitpvp setItemDamage <true/false>"
				send "&a/kitpvp setBlockBreak <true/false>"
				send "&7-----------------------------------------------"
on damage:
	projectile exists
	projectile is a arrow
	victim is a player
	attacker is a player
	wait 8 tick
	if skutil yml value "KitPVP.Settings.ArrowMessage" from file {@main} is true:
		if {KP::Maps::WorldOf::%world of attacker%} is set:
			KP_SendMessage(attacker, "correct", "%victim%'s Health: &c%health of victim%&l❤")
			# spawn 1 armor stand at location of victim
			# set {KP::ArmorStandVictim::%victim%} to last spawned armor stand
			# SET {_PREFIX} to skutil yml value "KitPVP.Settings.Prefix" from file {@main}
			# add "{CustomNameVisible:1,NoGravity:1b,Small:1,Invisible:1,Invulnerable:1,NoBasePlate:1,DisabledSlots:2039583,CustomName:""%{_PREFIX}% &7%victim%'s Health: &c%health of victim%&l❤""}" to nbt of {KP::ArmorStandVictim::%victim%}
			# wait a second
			# kill {KP::ArmorStandVictim::%victim%}
on weather change:
	if {KP::Maps::WorldOf::%event-world%} is set:
		if skutil yml value "Maps.Rain" from file {@main} is false:
			cancel event
every 3 seconds:	
	loop all players:
		if {KP::Maps::WorldOf::%world of loop-player%} is set:
			UpdateScoreBoard(loop-player)

function UpdateScoreBoard(player: player):
	wipe {_player}'s sidebar
	set {_uuid} to {_player}'s UUID
	set {_name} to skutil yml value "KitPVP.Settings.TitleScoreBoard" from file {@main}
	set name of sidebar of {_player} to "%{_name}%"
	set score " " in sidebar of {_player} to 6
	set score "&7Your name: &a%display name of {_player}%" in sidebar of {_player} to 5
	set score "  " in sidebar of {_player} to 4
	set score "&7Level: &a%{KP::Player::%{_uuid}%::Level}%" in sidebar of {_player} to 3
	set score "   " in sidebar of {_player} to 2
	set score "&amc.cyasnetwork.net" in sidebar of {_player} to 1
on join:
	set {_uuid} to player's UUID
	if {KP::Player::%{_uuid}%::Level} is not set:
		set {KP::Player::%{_uuid}%::Level} to 1
		KP_showLevelUpText(player)
function KP_levelUp(p: player, level: number):
	set {_uuid} to {_p}'s UUID
	if {KP::Player::%{_uuid}%::Level} is not set:
		set {KP::Player::%{_uuid}%::Level} to 1
		KP_showLevelUpText({_p})
	else:
		set {_uuid} to {_p}'s UUID
		set {KP::Player::%{_uuid}%::Level} to {_level}
		KP_showLevelUpText({_p})
function KP_showLevelUpText(p: player):
	set {_uuid} to {_p}'s UUID
	send {_p} title "&6&lLEVEL UP!" with subtitle "&aYour level is now: &2%{KP::Player::%{_uuid}%::Level}%" for 4 seconds
function KP_PartyInvite(sender: player, tosend: player):