lobbyparkour.sk

Created by Jakkeren

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.

function startParkour(p: player):
	{parkour::%{_p}%} is not set:
		send "&aDu startede parkouren&l!" to {_p}
		set {time::%{_p}%} to 0
		set {parkour::%{_p}%} to true
		set slot 7 of {_p}'s inventory to barrier named "&c&lStop parkour"
		while {parkour::%{_p}%} is true:
			add 0.1 to {time::%{_p}%}
			send action bar "&a&l%{time::%{_p}%}%&a&ls" to {_p}
			wait 0.1 seconds

on right click:
	player's held item is barrier:
		stopParkour(player)
		execute player command "/spawn"

function stopParkour(p: player):
	execute {_p} command "/spawn"
	clear {parkour::%{_p}%}
	clear {time::%{_p}%}
	set slot 7 of {_p}'s inventory to air
	send "&cDu fejlede parkouren&l!" to {_p}
	wait 1 tick
	set {_msg} to random integer between 1 and 5
	{_msg} is 1:
		send action bar "&c&l!!! EPIC FAIL !!!" to {_p}
	{_msg} is 2:
		send action bar "&c&lBEDRE HELD NÆSTE GANG!" to {_p}
	{_msg} is 3:
		send action bar "&c&lAV!" to {_p}
	{_msg} is 4:
		send action bar "&c&lKLASK!" to {_p}
	{_msg} is 5:
		send action bar "&c&lSMAT!" to {_p}

function doneParkour(p: player, tid: number):
	load yaml "/plugins/YAML/parkour/%uuid of {_p}%.yml" as "/plugins/YAML/parkour/%uuid of {_p}%.yml"
	set slot 7 of {_p}'s inventory to air
	if {_tid} is less than 60:
		yaml value "highscore" from "/plugins/YAML/parkour/%uuid of {_p}%.yml" is not set:
			set yaml value "highscore" from "/plugins/YAML/parkour/%uuid of {_p}%.yml" to {_tid}
			send "&6&l%{_tid}%&6s &a- Ny highscore&l!" to {_p}
		yaml value "highscore" from "/plugins/YAML/parkour/%uuid of {_p}%.yml" is less than {_tid}:
			send "&cDu slog ikke din gamle rekord&l!" to {_p}
		yaml value "highscore" from "/plugins/YAML/parkour/%uuid of {_p}%.yml" is greater than {_tid}:
			set yaml value "highscore" from "/plugins/YAML/parkour/%uuid of {_p}%.yml" to {_tid}
			send "&6&l%{_tid}%&6s &a- Ny highscore&l!" to {_p}
		clear {parkour::%{_p}%}
		send action bar "&a&lGODT KLARET!" to {_p}
		broadcast "&a%{_p}% klarede parkouren på &6%{_tid}%&a sekunder&l!"
		save yaml "/plugins/YAML/parkour/%uuid of {_p}%.yml"
	else:
		send "&cDu klarede ikke parkouren på under et minut. Din highscore er ikke blevet gemt&l!" to {_p}
		clear {parkour::%{_p}%}

on stepping on pressure plate:
	if event-player is player:
		event-block is a stone pressure plate:
			startParkour(player)

on stepping on pressure plate:
	if event-player is player:
		event-block is a iron pressure plate:
			{parkour::%player%} is true:
				doneParkour(player, {time::%player%})

on any movement:
	{parkour::%player%} is set:
		block beneath player is dirt or grass or stone or coarse dirt or brown terracotta or farmland or water or lime wool:
			stopParkour(player)