The Pit (ÇUKUR yani KitPvP gibi bir şey usta skript yazanlar içeri)

hexideee

Ağaç Yumruklayıcı
En iyi cevaplar
0
Arkadaşlar Hypixelde The Pit (ÇUKUR) adlı yeni bir oyun prototip aşamasında ve benim çok hoşuma gitti ve burada bazı sistemler gördüm size biraz anlatıcam öncelikle level olayı var. ilk leveller için az XP gerekiyor yüksek leveller için daha fazla XP gerekiyor XP ise adam öldürdüğümüzde geliyor benim yardım istediğim konu ise adam öldürdükçe XP + Gold geliyor bu gold ile köylü üzerinden alışveriş yapabiliyoruz burada elbette 1 kaç plugin kullanılmış ama eminimki skriptde vardır aralarında. Neyse bu goldlar ile kalıcı olarak her doğduğumuzda yetenek alabiliyoruz bu yetenekler adam öldürdüğümüzde elimize 1 adet goldenhead geliyor buna sağ tıkladıgımızda direk healt regen veriyor kısa bir süre ve 3 sarı kalp veriyor (emiş gücü) bu sadece 1 yetenekti mesela yay ile adama tutturdugumuzda bize 3 ok daha veriyor buda bir yetenekti ve bunlar hep gold ile alınabiliyor mesela vampir diye bir yetenek var adama vurdugumuzda 0.5 kalp geliyor yay ile vurdugumuzda 1.5 kalp geliyor. bir başka yetenek 12 blok yakınımızda olan en az 3 oyuncu için -%24 hasar azaltması veriliyor. yada gold ile alınabilen gine lav kovası ile başlıyoruz oyuna ve lav kovasını koyabiliyoruz belli yerlere. bide oyunda yerlere altın parçası düşüyor onun ustune geldiğimizde bize 2 gold veriyor. her adam öldürdüğümüzde 1 altın elme eğer goldenheads yeteneğini aldıysak altınkafa geliyor. ayrıca bazen adamlardan demir zırh, demir pantalon, demir ayakkabı şeyler düşüyor. Arkadaşlar bunları nasıl yapmışlar skript ile yaptılarsa kodyalabilirmisiniz. Teşekkürler
 

ReaLTaiizor

Kızıltaş Madencisi
En iyi cevaplar
0
onların skriptle yapmış olduğunu pek zannetmiyorum. büyük ihtimalle pluginle yapmışlardır. fakat çok küçük bir olasılık olsa da skript kullanmış olabilirler. söylediğin çoğu şey skriptle yapılabilir. ama dediklerinin hepsini birden bedavaya kodlayan olmaz. parça parça yapanlar olabilir. onlarda ne kadar düzgün çalışır bilemem :)
 

Korigato99

Zombi Katili
En iyi cevaplar
0
Dediklerinin neredeyse aynısı ama sadece kalıcı özellik yok bir serverde var . Özelden yazarsan atarım ..
 

OmerSRN

CraftMC Network
En iyi cevaplar
0
Ücretsiz yapacaklarını hiç sanmıyorum. Yapılabilir fakat ücretsiz yapmazlar.
 

KilllerDragons

Kızıltaş Madencisi
En iyi cevaplar
0
Skript Yazamıyorum Konu Açarsanız Skript İle Uğraşan Arkadaşlar Size Yardımcı Olabilir
 

Mr_Obliviate

Play.BlokDunyasi.Net
En iyi cevaplar
18
Evet benimde maaşlı javacılarım olsa bende skriptle yapardım. Benim PvP sunucusu için hazırladığım sistemlerden biri bu kadar hoşunuza gittiyse Suncumuz tutacak.
 

cezapro35

Zombi Katili
En iyi cevaplar
0
Bu skript zor değil ki ?
[automerge]1525186477[/automerge]
30 dakikada yapılabilir bir skript
 

cezapro35

Zombi Katili
En iyi cevaplar
0
Bugün işim olmazsa biraz yaparım.
[automerge]1525247453[/automerge]
Okul da yaptım birazını yaptım.
Adam öldürünce xp ve altın geliyor.
Xp başlangıç da 0 ile başlanıyor ve 5 olunca level atlıyor
Her zaman level atladığında bu 5 yerine hep 5 artar
Level 1 ken 5 XP İstiyor
Level 2 ken 10 Xp İstiyor devam ediyor böyle hep
-/gold (Oyuncu) : Oyuncu girmezsen senin goldunu gösterir. - Oyuncu girersen oyuncunun goldunu gösterir.
Adam öldürdüğünde mesaj olarak ayarladım eve gidince ginede 0 dan değiştirerek yaparım.
Adam öldürdüğünde çalışması: Oyuncu adlı oyuncuyu öldürdüğün için (XP/XPMax)
Adam öldürdüğünde örn: Mainmup adlı oyuncuyu öldürdüğün için (1/5)
Kodu denemedim.
Hata var ise burada söyle.
Yoksa da söyle


Java:
Variables:
    {level.%player%} = 1
    {XP.%player%} = 0
    {XP_Max.%player%} = 5
    {Gold.%player%} = 0

on death:
    atacker is a player
    victim is a player
    add 1 to {XP.%attacker%}
    add 1 to {Gold.%attacker%}
    send "&a%victim% &7adlı oyuncuyu öldürdüğün için (&e%{XP.%attacker%}%&7/&c%{XP_Max.%attacker%}%)" to attacker
    if {XP.%attacker%} is greater than or equal to {XP_Max.%attacker%}:
    send "&aLevel atladın." to attacker
    add 1 to {level.%attacker%}
    add 5 to {XP_Max.%attacker%}
    set {XP.%attacker%} to 0

command /gold [<Player>]:
    trigger:   
        arg 1 isn't set:
            send "&7Senin Goldun: &e%{Gold.%player%}%" to player
        arg 1 is set:
            send "&a%arg-1% &7Adlı Oyuncunun Goldu: &e%{Gold.%player%}%" to player
 
Son düzenleme:

PloriXe

Yeni Doğmuş
En iyi cevaplar
0
ThePit Skript (by PloriXe)

options:
config-loc: plugins/ThePIT/config.yml
messages-loc: plugins/ThePIT/messages.yml
sb-loc: plugins/ThePIT/scoreboard.yml
titles-loc: plugins/ThePIT/titles.yml


on script load:
set {_&} to "&"
if yaml value "chat-enable" from file "{@config-loc}" is not set:
set yaml value "chat-enable" from file "{@config-loc}" to "true"
if yaml value "use-vault" from file "{@config-loc}" is not set:
set yaml value "use-vault" from file "{@config-loc}" to false
if yaml value "chat-format" from file "{@config-loc}" is not set:
set yaml value "chat-format" from file "{@config-loc}" to "%{_&}%7[%{_&}%e{level}%{_&}%7] {player} %{_&}%8%{_&}%l- %{_&}%7{message}"
if yaml value "NAME-FORMAT" from file "{@config-loc}" is not set:
set yaml value "NAME-FORMAT" from file "{@config-loc}" to "%{_&}%7[%{_&}%e{level}%{_&}%7] %{_&}%7"
if yaml value "SHOP-ID" from file "{@config-loc}" is not set:
set yaml value "SHOP-ID" from file "{@config-loc}" to 0
if yaml value "UPGRADE-ID" from file "{@config-loc}" is not set:
set yaml value "UPGRADE-ID" from file "{@config-loc}" to 1
if yaml value "USE-PRESSURE-PLATE" from file "{@config-loc}" is not set:
set yaml value "USE-PRESSURE-PLATE" from file "{@config-loc}" to "true"
if yaml value "LEVE-UP-SOUND" from file "{@config-loc}" is not set:
set yaml value "LEVE-UP-SOUND" from file "{@config-loc}" to "LEVEL_UP"
if yaml value "KILL-SOUND" from file "{@config-loc}" is not set:
set yaml value "KILL-SOUND" from file "{@config-loc}" to "ORB_PICKUP"

if yaml list "ENABLED-WORLDS" from file "{@config-loc}" is not set:
add "world" to yaml list "ENABLED-WORLDS" from file "{@config-loc}"
add "thepit" to yaml list "ENABLED-WORLDS" from file "{@config-loc}"
if yaml value "KILL-XP" from file "{@config-loc}" is not set:
set yaml value "KILL-XP" from file "{@config-loc}" to 15
if yaml value "KILL-GOLD" from file "{@config-loc}" is not set:
set yaml value "KILL-GOLD" from file "{@config-loc}" to 10
if yaml value "ASSIST-XP" from file "{@config-loc}" is not set:
set yaml value "ASSIST-XP" from file "{@config-loc}" to 10
if yaml value "MAX-LEVEL" from file "{@config-loc}" is not set:
set yaml value "MAX-LEVEL" from file "{@config-loc}" to 120
if yaml value "ENDER_CHEST-NEED-LEVEL" from file "{@config-loc}" is not set:
set yaml value "ENDER_CHEST-NEED-LEVEL" from file "{@config-loc}" to 50
if yaml value "PERK-SLOT-2-NEED-LEVEL" from file "{@config-loc}" is not set:
set yaml value "PERK-SLOT-2-NEED-LEVEL" from file "{@config-loc}" to 35
if yaml value "ASSIST-GOLD" from file "{@config-loc}" is not set:
set yaml value "ASSIST-GOLD" from file "{@config-loc}" to 5
if yaml value "prefix" from file "{@messages-loc}" is not set:
set yaml value "prefix" from file "{@messages-loc}" to "%{_&}%e%{_&}%lTHE PIT %{_&}%8%{_&}%l- %{_&}%7"
if yaml value "kill-message" from file "{@messages-loc}" is not set:
set yaml value "kill-message" from file "{@messages-loc}" to "%{_&}%aKILL! %{_&}%7on [%{_&}%e{level}%{_&}%7] {victim} %{_&}%b%{_&}%l+{xp}XP %{_&}%6%{_&}%l+{gold}"
if yaml value "assist-message" from file "{@messages-loc}" is not set:
set yaml value "assist-message" from file "{@messages-loc}" to "%{_&}%aASSIST! %{_&}%7on [%{_&}%e{level}%{_&}%7] {player} %{_&}%b%{_&}%l+{xp}XP %{_&}%6%{_&}%l+{gold}"
if yaml value "kill-streak" from file "{@messages-loc}" is not set:
set yaml value "kill-streak" from file "{@messages-loc}" to "%{_&}%c%{_&}%lSTREAK! %{_&}%7of %{_&}%c[streak] %{_&}%7by {level} {player}"
if yaml value "level-up" from file "{@messages-loc}" is not set:
set yaml value "level-up" from file "{@messages-loc}" to "%{_&}%3%{_&}%lLEVEL UP! %{_&}%7[%{_&}%e{level}%{_&}%7]"
if yaml value "ENDER_CHEST-NEED-LEVEL-MSG" from file "{@messages-loc}" is not set:
set yaml value "ENDER_CHEST-NEED-LEVEL-MSG" from file "{@messages-loc}" to "%{_&}%cYou need level {level} to use ender chest!"
if yaml value "item-purchase" from file "{@messages-loc}" is not set:
set yaml value "item-purchase" from file "{@messages-loc}" to "%{_&}%aPURCHASE! %{_&}%6[item]"
if yaml value "perk-purchase" from file "{@messages-loc}" is not set:
set yaml value "perk-purchase" from file "{@messages-loc}" to "%{_&}%aPURCHASED PERK!"
if yaml value "perk-selected" from file "{@messages-loc}" is not set:
set yaml value "perk-selected" from file "{@messages-loc}" to "%{_&}%c%{_&}%lSELECTED PERK"
if yaml value "perk-in-use" from file "{@messages-loc}" is not set:
set yaml value "perk-in-use" from file "{@messages-loc}" to "%{_&}%c%{_&}%lYou already use this perk."
if yaml value "no-gold" from file "{@messages-loc}" is not set:
set yaml value "no-gold" from file "{@messages-loc}" to "%{_&}%c%{_&}%lNOT ENOUGHT GOLD!"
if yaml value "in-game" from file "{@messages-loc}" is not set:
set yaml value "in-game" from file "{@messages-loc}" to "%{_&}%aYou are in game."
if yaml value "not-in-game" from file "{@messages-loc}" is not set:
set yaml value "not-in-game" from file "{@messages-loc}" to "%{_&}%c%{_&}%lYou are not in game."
if yaml value "in-fight-status" from file "{@messages-loc}" is not set:
set yaml value "in-fight-status" from file "{@messages-loc}" to "%{_&}%3%{_&}%lYou are in %{_&}%cFighting %{_&}%3status."
if yaml value "level-up-title" from file "{@titles-loc}" is not set:
set yaml value "level-up-title" from file "{@titles-loc}" to "%{_&}%b%{_&}%lLEVEL UP!"
if yaml value "level-up-subtitle" from file "{@titles-loc}" is not set:
set yaml value "level-up-subtitle" from file "{@titles-loc}" to "%{_&}%7[%{_&}%e{old}%{_&}%7] %{_&}%3%{_&}%l-> %{_&}%7[%{_&}%e{new}%{_&}%7]"
if yaml value "death-title" from file "{@titles-loc}" is not set:
set yaml value "death-title" from file "{@titles-loc}" to "%{_&}%c%{_&}%lYOU DIED"
if yaml value "death-subtitle" from file "{@titles-loc}" is not set:
set yaml value "death-subtitle" from file "{@titles-loc}" to "%{_&}%e"
if yaml value "website" from file "{@sb-loc}" is not set:
set yaml value "website" from file "{@sb-loc}" to "%{_&}%eMC.SERVER.ORG"
delete {THEPIT::*}
set {THEPIT::CONFIG::CHAT} to yaml value "chat-enable" from file "{@config-loc}"
set {THEPIT::CONFIG::CHAT-FORMAT} to yaml value "chat-format" from file "{@config-loc}"
set {THEPIT::CONFIG::BUNGEECORD} to yaml value "bungeecord" from file "{@config-loc}"
set {THEPIT::CONFIG::SHOP-ID} to yaml value "SHOP-ID" from file "{@config-loc}"
set {THEPIT::CONFIG::UPGRADE-ID} to yaml value "UPGRADE-ID" from file "{@config-loc}"
set {THEPIT::CONFIG::pRESSURE-PLATE} to yaml value "USE-PRESSURE-PLATE" from file "{@config-loc}"
set {THEPIT::CONFIG::LEVE-UP-SOUND} to yaml value "LEVE-UP-SOUND" from file "{@config-loc}"
set {THEPIT::CONFIG::KILL-SOUND} to yaml value "KILL-SOUND" from file "{@config-loc}"
set {THEPIT::CONFIG::ENABLED-WORLDS::*} to yaml list "ENABLED-WORLDS" from file "{@config-loc}"
set {THEPIT::CONFIG::ENDER_CHEST-NEED-LEVEL} to yaml value "ENDER_CHEST-NEED-LEVEL" from file "{@config-loc}"
set {THEPIT::CONFIG::pERK-SLOT-2-NEED-LEVEL} to yaml value "PERK-SLOT-2-NEED-LEVEL" from file "{@config-loc}"
set {THEPIT::CONFIG::NAME-FORMAT} to yaml value "NAME-FORMAT" from file "{@config-loc}"
set {THEPIT::CONFIG::VAULT} to yaml value "use-vault" from file "{@config-loc}"


set {THEPIT::CONFIG::KILL-XP} to yaml value "KILL-XP" from file "{@config-loc}"
set {THEPIT::CONFIG::KILL-GOLD} to yaml value "KILL-GOLD" from file "{@config-loc}"
set {THEPIT::CONFIG::ASSIST-XP} to yaml value "ASSIST-XP" from file "{@config-loc}"
set {THEPIT::CONFIG::ASSIST-GOLD} to yaml value "ASSIST-GOLD" from file "{@config-loc}"
set {THEPIT::CONFIG::MAX-LEVEL} to yaml value "MAX-LEVEL" from file "{@config-loc}"
set {THEPIT::MESSAGES::pREFIX} to yaml value "prefix" from file "{@messages-loc}"
set {THEPIT::MESSAGES::KILL} to yaml value "kill-message" from file "{@messages-loc}"
set {THEPIT::MESSAGES::ASSIST} to yaml value "assist-message" from file "{@messages-loc}"
set {THEPIT::MESSAGES::STREAK} to yaml value "kill-streak" from file "{@messages-loc}"
set {THEPIT::MESSAGES::LEVEL-UP} to yaml value "level-up" from file "{@messages-loc}"
set {THEPIT::MESSAGES::ITEM-PURCHASE} to yaml value "item-purchase" from file "{@messages-loc}"
set {THEPIT::MESSAGES::pERK-PURCHASE} to yaml value "perk-purchase" from file "{@messages-loc}"
set {THEPIT::MESSAGES::SELECTED-PERK} to yaml value "perk-selected" from file "{@messages-loc}"
set {THEPIT::MESSAGES::IN-USE-PERK} to yaml value "perk-in-use" from file "{@messages-loc}"
set {THEPIT::MESSAGES::NO-GOLD} to yaml value "no-gold" from file "{@messages-loc}"
set {THEPIT::MESSAGES::IN-GAME} to yaml value "in-game" from file "{@messages-loc}"
set {THEPIT::MESSAGES::NOT-IN-GAME} to yaml value "not-in-game" from file "{@messages-loc}"
set {THEPIT::MESSAGES::YOU-ARE-IN-FIGHT} to yaml value "in-fight-status" from file "{@messages-loc}"
set {THEPIT::MESSAGES::ENDER_CHEST-NEED-LEVEL-MSG} to yaml value "ENDER_CHEST-NEED-LEVEL-MSG" from file "{@messages-loc}"

set {THEPIT::TITLES::LEVEL-UP-TITLE} to yaml value "level-up-title" from file "{@titles-loc}"
set {THEPIT::TITLES::LEVEL-UP-SUBTITLE} to yaml value "level-up-subtitle" from file "{@titles-loc}"
set {THEPIT::TITLES::DEATH-TITLE} to yaml value "death-title" from file "{@titles-loc}"
set {THEPIT::TITLES::DEATH-SUBTITLE} to yaml value "death-subtitle" from file "{@titles-loc}"
loop {THEPIT::CONFIG::*}:
replace all "&" with "§" in {THEPIT::CONFIG::%loop-index%}
loop {THEPIT::MESSAGES::*}:
replace all "&" with "§" in {THEPIT::MESSAGES::%loop-index%}
loop {THEPIT::TITLES::*}:
replace all "&" with "§" in {THEPIT::TITLES::%loop-index%}
set {THEPIT::SB::WEBSITE} to yaml value "website" from file "{@sb-loc}"
replace all "&" with "§" in {THEPIT::SB::WEBSITE}



function pit_gold(p: player, do: text, gold: number) :: boolean:
set {_uuid} to uuid of {_p}
{_do} is "set":
if {THEPIT::CONFIG::VAULT} is true:
set {_p}'s balance to 0
else:
set {pit::%{_uuid}%::gold} to 0
{_do} is "add":
if {THEPIT::CONFIG::VAULT} is true:
add {_gold} to {_p}'s balance
else:
add {_gold} to {pit::%{_uuid}%::gold}
{_do} is "remove":
if {THEPIT::CONFIG::VAULT} is true:
remove {_gold} from {_p}'s balance
else:
remove {_gold} from {pit::%{_uuid}%::gold}
{_do} is "has":
if {THEPIT::CONFIG::VAULT} is true:
if {_p}'s balance >= {_gold}:
return true
else:
return false
else:
if {pit::%{_uuid}%::gold} >= {_gold}:
return true
else:
return false

function pit_join(p: player):
set {_uuid} to uuid of {_p}
set {pit::%{_uuid}%::state} to "ingame"
teleport {_p} to {pit.spawn}
if {pit::%{_uuid}%::level} is not set:
set {pit::%{_uuid}%::level} to 1
if {pit::%{_uuid}%::xp} is not set:
set {pit::%{_uuid}%::xp} to 0
if {pit::%{_uuid}%::xp-need} is not set:
set {pit::%{_uuid}%::xp-need} to 100
if {pit::%{_uuid}%::gold} is not set:
set {pit::%{_uuid}%::gold} to 0
set {pit::%{_uuid}%::streak} to 0
set {pit::%{_uuid}%::status} to "&aIdling"
pit_clear({_p})
pit_updatetag({_p})
pit_equip({_p})
pit_scoreboard({_p})

function pit_leave(p: player):
set {_uuid} to uuid of {_p}
if metadata value "ASSIST" of {_p} is set:
set {_G} to metadata value "ASSIST" of {_p}
set {_uuid2} to uuid of {_G}
set {_k} to {THEPIT::MESSAGES::ASSIST}
replace all "{player}" in {_k} with "%{_G}%"
replace all "{level}" in {_k} with "%{pit::%{_uuid2}%::level}%"
replace all "{gold}" in {_k} with "%{THEPIT::CONFIG::ASSIST-GOLD}%"
replace all "{xp}" in {_k} with "%{THEPIT::CONFIG::ASSIST-XP}%"
add {THEPIT::CONFIG::ASSIST-GOLD} to {pit::%{_uuid2}%::gold}
add {THEPIT::CONFIG::ASSIST-XP} to {pit::%{_uuid2}%::xp}
send "%{THEPIT::MESSAGES::pREFIX}% %{_k}%" to {_G}
delete stylish scoreboard "PIT-%{_p}%"
delete {pit::%{_uuid}%::streak}
delete {pit::%{_uuid}%::state}
delete {pit::%{_uuid}%::Damage::*}
pit_clear({_p})
make console execute command "nte player %{_p}% clear"
hub({_p})


function pit_clear(p: player):
clear {_p}'s inventory
clear {_p}'s level
remove all effects from {_p}


command /pit [<text>] [<player>] [<integer>]:
trigger:
if arg-1 is "join":
if player has permission "PIT.JOIN":
if {pit::%uuid of player%::state} is not set:
pit_join(player)
stop
else:
send "%{THEPIT::MESSAGES::pREFIX}% %{THEPIT::MESSAGES::IN-GAME}%"
stop
else:
send "%{THEPIT::MESSAGES::pREFIX}% &cNO PERMISSION"
if arg-1 is "leave":
if {pit::%uuid of player%::state} is "ingame":
pit_leave(player)
stop
if arg-1 is "setgold":
if player has permission "PIT.SETGOLD":
if arg-2 is set:
if arg-3 is set:
set {pit::%uuid of arg-2%::gold} to arg-3
send "%{THEPIT::MESSAGES::pREFIX}% &7Setted &b%arg-2%&b's &6&lGold to &c%arg-3%"
stop
else:
send "%{THEPIT::MESSAGES::pREFIX}% &7Specify a number"
stop
else:
send "%{THEPIT::MESSAGES::pREFIX}% &7Specify a player"
stop
if arg-1 is "addgold":
if player has permission "PIT.ADDGOLD":
if arg-2 is set:
if arg-3 is set:
add arg-3 to {pit::%uuid of arg-2%::gold}
send "%{THEPIT::MESSAGES::pREFIX}% &7You added &6&l%arg-3% Gold &7to &c%arg-2%&b's &6&lGold"
stop
else:
send "%{THEPIT::MESSAGES::pREFIX}% &7Specify a number"
stop
else:
send "%{THEPIT::MESSAGES::pREFIX}% &7Specify a player"
stop
if arg-1 is "setlevel":
if player has permission "PIT.SETLEVEL":
if arg-2 is set:
if arg-3 is set:
if {pit::%uuid of arg-2%::level} is set:
if arg-3 <= {THEPIT::CONFIG::MAX-LEVEL}:
set {pit::%uuid of arg-2%::level} to arg-3
set {pit::%uuid of arg-2%::xp} to 0
set {pit::%uuid of arg-2%::xp-need} to 100*{pit::%uuid of arg-2%::level}
pit_updatetag(arg-2)
send "%{THEPIT::MESSAGES::pREFIX}% &7Setted &b%arg-2%&b's &bLevel to &c%arg-3%"
stop
else:
send "%{THEPIT::MESSAGES::pREFIX}% &eThe level has to be equal or bellow max level. &8(&a%{THEPIT::CONFIG::MAX-LEVEL}%&8)"
else:
send "%{THEPIT::MESSAGES::pREFIX}% &c%arg-2% &anever played"
stop
else:
send "%{THEPIT::MESSAGES::pREFIX}% &7Specify a number"
stop
else:
send "%{THEPIT::MESSAGES::pREFIX}% &7Specify a player"
stop
if arg-1 is "spawn":
if {pit::%uuid of player%::state} is "ingame":
if {pit::%uuid of player%::status} is "&aIdling":
remove all golden_apple from player
remove all heads from player
teleport player to {pit.spawn}
stop
else:
send "%{THEPIT::MESSAGES::pREFIX}% %{THEPIT::MESSAGES::YOU-ARE-IN-FIGHT}%"
stop
else:
send "%{THEPIT::MESSAGES::pREFIX}% %{THEPIT::MESSAGES::NOT-IN-GAME}%"
stop
if arg-1 is "setspawn":
if player has permission "PIT.ADMIN":
set {pit.spawn} to player's location
send "%{THEPIT::MESSAGES::pREFIX}% &cSpawn Set"
stop
if arg-1 is "setshop":
if player has permission "PIT.ADMIN":
if citizen id of target entity is set:
set {THEPIT::CONFIG::SHOP-ID} to citizen id of target entity
set yaml value "SHOP-ID" from file "{@config-loc}" to citizen id of target entity
send "%{THEPIT::MESSAGES::pREFIX}% &cShop Set"
stop
else:
send "%{THEPIT::MESSAGES::pREFIX}% &aYou have to look at npc when you execute this command"
stop
if arg-1 is "editmode":
if player has permission "PIT.EDITMODE":
delete {pit::%uuid of player%::state}
send "%{THEPIT::MESSAGES::pREFIX}% &cYou are now able to build."
if arg-1 is "setleave":
if player has permission "PIT.ADMIN":
set {pit.leave} to location of player
send "%{THEPIT::MESSAGES::pREFIX}% &cLeave location set"
if arg-1 is "setupgrade":
if player has permission "PIT.ADMIN":
if citizen id of target entity is set:
set {THEPIT::CONFIG::UPGRADE-ID} to citizen id of target entity
set yaml value "UPGRADE-ID" from file "{@config-loc}" to citizen id of target entity
send "%{THEPIT::MESSAGES::pREFIX}% &cShop Set"
stop
else:
send "%{THEPIT::MESSAGES::pREFIX}% &aYou have to look at npc when you execute this command"
stop
if arg-1 is "reload":
if player has permission "PIT.ADMIN":
send "%{THEPIT::MESSAGES::pREFIX}% &aReloading..."
make console execute command "sk reload %script%"
else:
send "%{THEPIT::MESSAGES::pREFIX}% &aYou have to look at npc when you execute this command"
stop
else:
send "%{THEPIT::MESSAGES::pREFIX}% &8&l> &7Join"
send "%{THEPIT::MESSAGES::pREFIX}% &8&l> &7Spawn"
send "%{THEPIT::MESSAGES::pREFIX}% &8&l> &7Leave"
if player has permission "PIT.ADMIN":
send "%{THEPIT::MESSAGES::pREFIX}% &8&l> &7SetGold <PLAYER> <NUMBER>"
send "%{THEPIT::MESSAGES::pREFIX}% &8&l> &7SetLevel <PLAYER> <NUMBER>"
send "%{THEPIT::MESSAGES::pREFIX}% &8&l> &7EditMode"
send "%{THEPIT::MESSAGES::pREFIX}% &8&l> &7SetSpawn"
send "%{THEPIT::MESSAGES::pREFIX}% &8&l> &7SetLeave"
send "%{THEPIT::MESSAGES::pREFIX}% &8&l> &7Reload"
stop
else:
stop




on join:
delete {pit::%uuid of player%::state}

on quit:
pit_leave(player)
stop

on chat:
{pit::%uuid of player%::state} is "ingame"
{THEPIT::CONFIG::CHAT} is "true"
cancel event
loop all players in player's world:
{pit::%uuid of loop-player%::state} is "ingame"
set {_x} to {THEPIT::CONFIG::CHAT-FORMAT}
replace all "{level}" with "%{pit::%uuid of player%::level}%" in {_x}
replace all "{player}" with "%player%" in {_x}
replace all "{prefix}" with "%player's prefix%" in {_x}
replace all "{display-name}" with "%player's displayname%" in {_x}
replace all "&" with " " in message
replace all "{message}" with "%message%" in {_x}
send "%{_x}%" to loop-player



on pressure plate:
{pit::%uuid of player%::state} is "ingame"
{THEPIT::CONFIG::pRESSURE-PLATE} is "true"
cancel event
push the player upwards at speed 0.4
push the player forwards at speed 1.2



function pit_scoreboard(p: player):
set {_uuid} to uuid of {_p}
if stylish scoreboard "PIT-%{_p}%" does not exist:
create new stylish scoreboard named "PIT-%{_p}%"
loop 11 times:
create a new id based score "PIT-%{_p}%Slot%loop-number%" with text "&%loop-number%" slot loop-number for stylish scoreboard "PIT-%{_p}%"
while {pit::%{_uuid}%::state} is "ingame":
if stylish scoreboard "PIT-%{_p}%" exists:
if {pit::%{_uuid}%::level} >= {THEPIT::CONFIG::MAX-LEVEL}:
set {_need} to "MAX LEVEL"
if {pit::%{_uuid}%::level} < {THEPIT::CONFIG::MAX-LEVEL}:
set {_need} to {pit::%{_uuid}%::xp-need}-{pit::%{_uuid}%::xp}
if {THEPIT::CONFIG::VAULT} is true:
set {_gold} to {_p}'s balance
if {THEPIT::CONFIG::VAULT} is false:
set {_gold} to {pit::%{_uuid}%::gold}
set stylish scoreboard of {_p} to "PIT-%{_p}%"
set title of stylish scoreboard "PIT-%{_p}%" to "&e&lTHE PIT"
set the text of id "PIT-%{_p}%Slot11" to "&7%now%"
set the text of id "PIT-%{_p}%Slot10" to "&1&e"
set the text of id "PIT-%{_p}%Slot9" to "&7Level &7[&e%{pit::%{_uuid}%::level}%&7]"
set the text of id "PIT-%{_p}%Slot8" to "&7Needed XP: &b%{_need}%"
set the text of id "PIT-%{_p}%Slot7" to "&2&9"
set the text of id "PIT-%{_p}%Slot6" to "&7Gold: &6&l%{_gold}%"
set the text of id "PIT-%{_p}%Slot5" to "&3&9"
set the text of id "PIT-%{_p}%Slot4" to "&7Status: %{pit::%{_uuid}%::status}%"
set the text of id "PIT-%{_p}%Slot3" to "&7Streaks: &a%{pit::%{_uuid}%::streak}%"
set the text of id "PIT-%{_p}%Slot2" to "&4&9"
set the text of id "PIT-%{_p}%Slot1" to "%{THEPIT::SB::WEBSITE}%"
wait a second




on damage of player:
{pit::%uuid of victim%::state} is "ingame"
if damage cause is fall:
cancel event
if damage cause is void:
cancel event
kill victim
if "%damage cause%" is "projectile":
if {pit::%uuid of attacker%::perk::slot-1} or {pit::%uuid of attacker%::perk::slot-2} is "ENDLESS-QUIVER":
give 3 arrows to attacker
if attacker is player:
if attacker is not victim:
wait 1 tick
loop 20 times:
set {_health.%loop-integer%.%victim%} to "&7❤"
loop-integer is greater than max health of victim
set {_health.%loop-integer%.%victim%} to ""
loop rounded health of victim times:
set {_health.%loop-integer%.%victim%} to "&4❤"
set action bar of attacker to coloured "%{_health.1.%victim%}%%{_health.2.%victim%}%%{_health.3.%victim%}%%{_health.4.%victim%}%%{_health.5.%victim%}%%{_health.6.%victim%}%%{_health.7.%victim%}%%{_health.8.%victim%}%%{_health.9.%victim%}%%{_health.10.%victim%}%%{_health.11.%victim%}%%{_health.12.%victim%}%%{_health.13.%victim%}%%{_health.14.%victim%}%%{_health.15.%victim%}%%{_health.16.%victim%}%%{_health.17.%victim%}%%{_health.18.%victim%}%%{_health.19.%victim%}%%{_health.20.%victim%}%"

set {_sec.%uuid of victim%} to 10
set {_sec.%uuid of attacker%} to 10
if {pit::%uuid of victim%::status} is "&aIdling":
set {pit::%uuid of victim%::status} to "&cFighting"
while {pit::%uuid of victim%::status} is "&cFighting":
remove 1 from {_sec.%uuid of victim%}
wait 1 seconds
if {_sec.%uuid of victim%} is 0:
set {pit::%uuid of victim%::status} to "&aIdling"

if {pit::%uuid of attacker%::status} is "&aIdling":
set {pit::%uuid of attacker%::status} to "&cFighting"
while {pit::%uuid of attacker%::status} is "&cFighting":
remove 1 from {_sec.%uuid of attacker%}
wait 1 seconds
if {_sec.%uuid of attacker%} is 0:
set {pit::%uuid of attacker%::status} to "&aIdling"

set {_dmg} to damage
add rounded {_dmg} to {pit::%uuid of victim%::Damage::%uuid of attacker%}
if {pit::%uuid of victim%::Damage::%uuid of attacker%} > 10:
set metadata value "ASSIST" of victim to attacker
delete {pit::%uuid of victim%::Damage::%uuid of attacker%}

while {_sec.assist.%uuid of victim%} > 1:
remove 1 from {_sec.assist.%uuid of victim%}
wait 1 seconds
{_sec.assist.%uuid of victim%} = 1:
delete metadata value "ASSIST" of victim


function pit_give_gp(p: player):
set {_uuid} to uuid of {_p}
if {pit::%{_uuid}%::perk::slot-1} or {pit::%{_uuid}%::perk::slot-2} = "GOLDEN-HEADS":
if number of head in {_p}'s inventory = 0 or 1:
give skull of "StackedGold" parsed as offline player named "&6&lGolden Head" to {_p}
else:
if number of golden_apple in {_p}'s inventory = 0 or 1:
give 1 golden_apple to {_p}


on death of player:
{pit::%uuid of victim%::state} is "ingame"
set death message to ""
teleport victim to {pit.spawn}
clear drops
if metadata value "ASSIST" of victim is set:
set {_G} to metadata value "ASSIST" of victim
if {_G} is not attacker:
set {_k} to {THEPIT::MESSAGES::ASSIST}
set {_uuid} to uuid of {_G}
replace all "{player}" in {_k} with "%victim%"
replace all "{level}" in {_k} with "%{pit::%{_uuid}%::level}%"
replace all "{gold}" in {_k} with "%{THEPIT::CONFIG::ASSIST-GOLD}%"
replace all "{xp}" in {_k} with "%{THEPIT::CONFIG::ASSIST-XP}%"
pit_gold({_G}, "add", {THEPIT::CONFIG::ASSIST-GOLD})
add {THEPIT::CONFIG::ASSIST-XP} to {pit::%{_uuid}%::xp}
send "%{THEPIT::MESSAGES::pREFIX}% %{_k}%" to {_G}
add 1 to {pit::%uuid of attacker%::streak}
add {THEPIT::CONFIG::KILL-XP} to {pit::%uuid of attacker%::xp}
set {pit::%uuid of victim%::streak} to 0
if {pit::%uuid of attacker%::streak} = 5 or 10 or 15 or 25 or 30 or 35 or 40 or 45 or 50:
set {_x} to {THEPIT::MESSAGES::STREAK}
replace all "[streak]" in {_x} with "%{pit::%uuid of attacker%::streak}%"
replace all "{level}" in {_x} with "%{pit::%uuid of attacker%::level}%"
replace all "{player}" in {_x} with "%attacker's displayname%"
loop all players in attacker's world:
if {pit::%uuid of loop-player%::state} is "ingame":
send "%{THEPIT::MESSAGES::pREFIX}% %{_x}%" to loop-player
set {_x} to {THEPIT::MESSAGES::KILL}
replace all "{level}" in {_x} with "%{pit::%uuid of victim%::level}%"
replace all "{victim}" in {_x} with "%victim's displayname%"
replace all "{gold}" in {_x} with "%{THEPIT::CONFIG::KILL-GOLD}%"
replace all "{xp}" in {_x} with "%{THEPIT::CONFIG::KILL-XP}%"
send "%{THEPIT::MESSAGES::pREFIX}% %{_x}%" to attacker
pit_gold(attacker, "add", {THEPIT::CONFIG::KILL-GOLD})
bw_play_sound(attacker, {THEPIT::CONFIG::KILL-SOUND})
pit_give_gp(attacker)
if {pit::%uuid of attacker%::level} < {THEPIT::CONFIG::MAX-LEVEL}:
pit_check_level(attacker)
send victim title "%{THEPIT::TITLES::DEATH-TITLE}%" with subtitle "%{THEPIT::TITLES::DEATH-SUBTITLE}%" for 1 seconds
wait 0.2 seconds
force victim to respawn
wait 0.2 seconds
teleport victim to {pit.spawn}
set {pit::%uuid of victim%::status} to "&aIdling"
set action bar of attacker to coloured "&7&l%victim% &a&lKILL"
wait 0.2 seconds
pit_updatetag(victim)
pit_equip(victim)

on right click with head:
{pit::%uuid of player%::state} is "ingame"
name of event-item is "&6&lGolden Head"
{pit::%uuid of player%::perk::slot-1} or {pit::%uuid of player%::perk::slot-2} = "GOLDEN-HEADS"
cancel event
remove regeneration from player
remove absorption from player
apply regeneration 2 to the player for 5 seconds
apply absorption 1 to the player for 120 seconds
remove event-item from player

on right click on ender_chest:
{pit::%uuid of player%::state} is "ingame"
{pit::%uuid of player%::level} < {THEPIT::CONFIG::ENDER_CHEST-NEED-LEVEL}
cancel event
set {_x} to {THEPIT::MESSAGES::ENDER_CHEST-NEED-LEVEL-MSG}
replace all "{level}" in {_x} with "%{THEPIT::CONFIG::ENDER_CHEST-NEED-LEVEL}%"
send "%{THEPIT::MESSAGES::pREFIX}% %{_x}%"

function pit_check_level(p: player):
set {_uuid} to uuid of {_p}
if {pit::%{_uuid}%::xp} >= {pit::%{_uuid}%::xp-need}:
remove {pit::%{_uuid}%::xp-need} from {pit::%{_uuid}%::xp}
set {_old} to {pit::%{_uuid}%::level}
add 1 to {pit::%{_uuid}%::level}
pit_updatetag({_p})
set {_x} to {THEPIT::MESSAGES::LEVEL-UP}
replace all "{level}" with "%{pit::%{_uuid}%::level}%" in {_x}
send "%{THEPIT::MESSAGES::pREFIX}% %{_x}%" to {_p}
set {_x} to {THEPIT::TITLES::LEVEL-UP-TITLE}
set {_y} to {THEPIT::TITLES::LEVEL-UP-SUBTITLE}
replace all "{old}" with "%{_old}%" in {_x}
replace all "{old}" with "%{_old}%" in {_y}
replace all "{new}" with "%{pit::%{_uuid}%::level}%" in {_x}
replace all "{new}" with "%{pit::%{_uuid}%::level}%" in {_y}
send {_p} title "%{_x}%" with subtitle "%{_y}%" for 3 seconds
bw_play_sound({_p}, {THEPIT::CONFIG::LEVE-UP-SOUND})
set {_p}'s level to {pit::%{_uuid}%::level}
if {pit::%{_uuid}%::level} > 1:
set {pit::%{_uuid}%::xp-need} to 100*{pit::%{_uuid}%::level}
stop
else:
add 100 to {pit::%{_uuid}%::xp-need}
stop

function bw_play_sound(p: player, sound: text):
play raw sound "%{_sound}%" at {_p} with pitch 100 volume 100


function pit_check_in_use(p: player, slot: integer, perk: text) :: boolean:
set {_uuid} to uuid of {_p}
{_slot} is 1:
set {_x} to 2
{_slot} is 2:
set {_x} to 1
if {pit::%{_uuid}%::perk::slot-%{_x}%} is "%{_perk}%":
send "%{THEPIT::MESSAGES::pREFIX}% %{THEPIT::MESSAGES::IN-USE-PERK}%" to {_p}
return true
else:
return false

function pit_perk_shop(p: player, slot: integer):
set {_uuid} to uuid of {_p}
open virtual chest inventory with size 3 named "Chose a Perk" to {_p}
make a gui slot 10 of {_p} with gold block named "&cGolden Heads" with lore "||&7Golden apples you earn turn into &6Golden Heads||||&8&l- &7COST: &6&l500||" to run:
if {pit::%{_uuid}%::perk::golden-heads} is not set:
if pit_gold({_p}, "has", 500) is true:
set {pit::%{_uuid}%::perk::golden-heads} to true
set {pit::%{_uuid}%::perk::slot-%{_slot}%} to "GOLDEN-HEADS"
pit_gold({_p}, "remove", 500)
send "%{THEPIT::MESSAGES::pREFIX}% %{THEPIT::MESSAGES::pERK-PURCHASE}%"
pit_upgrades_shop({_p})
stop
else:
send "%{THEPIT::MESSAGES::pREFIX}% %{THEPIT::MESSAGES::NO-GOLD}%"
stop
else:
if pit_check_in_use({_p}, {_slot}, "GOLDEN-HEADS") is false:
set {pit::%{_uuid}%::perk::slot-%{_slot}%} to "GOLDEN-HEADS"
pit_upgrades_shop({_p})
send "%{THEPIT::MESSAGES::pREFIX}% %{THEPIT::MESSAGES::SELECTED-PERK}%"
stop
make a gui slot 12 of {_p} with fishing rod named "&cFishing rod" with lore "||&7Spawn with a fishing rod||||&8&l- &7COST: &6&l1000||" to run:
if {pit::%{_uuid}%::perk::fishing-rod} is not set:
if pit_gold({_p}, "has", 1000) is true:
set {pit::%{_uuid}%::perk::fishing-rod} to true
set {pit::%{_uuid}%::perk::slot-%{_slot}%} to "FISHING-ROD"
pit_gold({_p}, "remove", 1000)
send "%{THEPIT::MESSAGES::pREFIX}% %{THEPIT::MESSAGES::pERK-PURCHASE}%"
pit_upgrades_shop({_p})
stop
else:
send "%{THEPIT::MESSAGES::pREFIX}% %{THEPIT::MESSAGES::NO-GOLD}%"
stop
else:
if pit_check_in_use({_p}, {_slot}, "FISHING-ROD") is false:
set {pit::%{_uuid}%::perk::slot-%{_slot}%} to "FISHING-ROD"
pit_upgrades_shop({_p})
send "%{THEPIT::MESSAGES::pREFIX}% %{THEPIT::MESSAGES::SELECTED-PERK}%"
stop
make a gui slot 14 of {_p} with lava bucket named "&cLava Bucket" with lore "||&7Spawn with a lava bucket||||&8&l- &7COST: &6&l1000||" to run:
if {pit::%{_uuid}%::perk::lava-bucket} is not set:
if pit_gold({_p}, "has", 1000) is true:
set {pit::%{_uuid}%::perk::lava-bucket} to true
set {pit::%{_uuid}%::perk::slot-%{_slot}%} to "LAVA-BUCKET"
pit_gold({_p}, "remove", 1000)
send "%{THEPIT::MESSAGES::pREFIX}% %{THEPIT::MESSAGES::pERK-PURCHASE}%"
pit_upgrades_shop({_p})
stop
else:
send "%{THEPIT::MESSAGES::pREFIX}% %{THEPIT::MESSAGES::NO-GOLD}%"
stop
else:
if pit_check_in_use({_p}, {_slot}, "LAVA-BUCKET") is false:
set {pit::%{_uuid}%::perk::slot-%{_slot}%} to "LAVA-BUCKET"
pit_upgrades_shop({_p})
send "%{THEPIT::MESSAGES::pREFIX}% %{THEPIT::MESSAGES::SELECTED-PERK}%"
stop
make a gui slot 16 of {_p} with bow named "&cEndless Quiver" with lore "||&7Get 3 arrows on arrow hit||||&8&l- &7COST: &6&l2000||" to run:
if {pit::%{_uuid}%::perk::endless-quiver} is not set:
if pit_gold({_p}, "has", 1000) is true:
set {pit::%{_uuid}%::perk::endless-quiver} to true
set {pit::%{_uuid}%::perk::slot-%{_slot}%} to "ENDLESS-QUIVER"
pit_gold({_p}, "remove", 2000)
send "%{THEPIT::MESSAGES::pREFIX}% %{THEPIT::MESSAGES::pERK-PURCHASE}%"
pit_upgrades_shop({_p})
stop
else:
send "%{THEPIT::MESSAGES::pREFIX}% %{THEPIT::MESSAGES::NO-GOLD}%"
stop
else:
if pit_check_in_use({_p}, {_slot}, "ENDLESS-QUIVER") is false:
set {pit::%{_uuid}%::perk::slot-%{_slot}%} to "ENDLESS-QUIVER"
pit_upgrades_shop({_p})
send "%{THEPIT::MESSAGES::pREFIX}% %{THEPIT::MESSAGES::SELECTED-PERK}%"
stop


function pit_upgrades_shop(p: player):
set {_uuid} to uuid of {_p}
open virtual chest inventory with size 5 named "Permanent upgrades" to {_p}
wait a tick
if {pit::%{_uuid}%::perk::slot-1} is not set:
make a gui slot 12 of {_p} with diamond block named "&aPERK SLOT ##1" with lore "||&7Select a perk to fill this slot||||&eClick to chose perk!||" to run function pit_perk_shop({_p}, 1)

if {pit::%{_uuid}%::perk::slot-1} is set:
if {pit::%{_uuid}%::perk::slot-1} = "GOLDEN-HEADS":
make a gui slot 12 of {_p} with gold block named "&ePERK SLOT &3##1 &7- &6&lGOLDEN HEADS" to run function pit_perk_shop({_p}, 1)
if {pit::%{_uuid}%::perk::slot-1} = "FISHING-ROD":
make a gui slot 12 of {_p} with fishing rod named "&ePERK SLOT &3##1 &7- &9&lFISHING ROD" to run function pit_perk_shop({_p}, 1)
if {pit::%{_uuid}%::perk::slot-1} = "LAVA-BUCKET":
make a gui slot 12 of {_p} with lava bucket named "&ePERK SLOT &3##1 &7- &9&lLAVA BUCKET" to run function pit_perk_shop({_p}, 1)
if {pit::%{_uuid}%::perk::slot-1} = "ENDLESS-QUIVER":
make a gui slot 12 of {_p} with bow named "&ePERK SLOT &3##2 &7- &9&lENDLESS QUIVER" to run function pit_perk_shop({_p}, 1)

if {pit::%{_uuid}%::level} >= {THEPIT::CONFIG::pERK-SLOT-2-NEED-LEVEL}:
if {pit::%{_uuid}%::perk::slot-2} is not set:
make a gui slot 14 of {_p} with diamond block named "&aPERK SLOT ##2" with lore "||&7Select a perk to fill this slot||||&eClick to chose perk!||" to run function pit_perk_shop({_p}, 2)

if {pit::%{_uuid}%::perk::slot-2} is set:
if {pit::%{_uuid}%::perk::slot-2} = "GOLDEN-HEADS":
make a gui slot 14 of {_p} with gold block named "&ePERK SLOT &3##2 &7- &6&lGOLDEN HEADS" to run function pit_perk_shop({_p}, 2)
if {pit::%{_uuid}%::perk::slot-2} = "FISHING-ROD":
make a gui slot 14 of {_p} with fishing rod named "&ePERK SLOT &3##2 &7- &9&lFISHING ROD" to run function pit_perk_shop({_p}, 2)
if {pit::%{_uuid}%::perk::slot-2} = "LAVA-BUCKET":
make a gui slot 14 of {_p} with lava bucket named "&ePERK SLOT &3##2 &7- &9&lLAVA BUCKET" to run function pit_perk_shop({_p}, 2)
if {pit::%{_uuid}%::perk::slot-2} = "ENDLESS-QUIVER":
make a gui slot 14 of {_p} with bow named "&ePERK SLOT &3##2 &7- &9&lENDLESS QUIVER" to run function pit_perk_shop({_p}, 2)
else:
make a gui slot 14 of {_p} with bedrock named "&cPERK SLOT ##2" with lore "&7Required level: &7[&a%{THEPIT::CONFIG::pERK-SLOT-2-NEED-LEVEL}%&7]" to do nothing





function pit_items_shop(p: player):
open virtual chest inventory with size 3 named "Non-permanent items" to {_p}
wait a tick
set {_uuid} to uuid of {_p}
make a gui slot 10 of {_p} with diamond_sword named "&e&lDIAMOND SWORD" with lore "||&8&l- &7LOST ON DEATH||||&8&l- &7COST: &6&l100" to run:
set {_uuid} to uuid of {_p}
if pit_gold({_p}, "has", 100) is true:
pit_gold({_p}, "remove", 100)
give 1 diamond_sword to {_p}
set {_item} to "DIAMOND SWORD"
set {_x} to {THEPIT::MESSAGES::ITEM-PURCHASE}
replace all "[item]" with "%{_item}%" in {_x}
send "%{THEPIT::MESSAGES::pREFIX}% %{_x}%" to {_p}
else:
send "%{THEPIT::MESSAGES::pREFIX}% %{THEPIT::MESSAGES::NO-GOLD}%"
make a gui slot 11 of {_p} with 8 obsidian named "&e&lOBSIDIAN" with lore "||&8&l- &7REMAINS FOR 120 SECONDS||||&8&l- &7LOST ON DEATH||||&8&l- &7COST: &6&l40" to run:
if pit_gold({_p}, "has", 40) is true:
pit_gold({_p}, "remove", 40)
give 8 obsidian to {_p}
set {_item} to "OBSIDIAN"
set {_x} to {THEPIT::MESSAGES::ITEM-PURCHASE}
replace all "[item]" with "%{_item}%" in {_x}
send "%{THEPIT::MESSAGES::pREFIX}% %{_x}%" to {_p}
else:
send "%{THEPIT::MESSAGES::pREFIX}% %{THEPIT::MESSAGES::NO-GOLD}%"

make a gui slot 12 of {_p} with 32 arrow named "&e&lARROW" with lore "||&8&l- &7LOST ON DEATH||||&8&l- &7COST: &6&l16" to run:
if {pit::%{_uuid}%::gold} >= 16:
remove 16 from {pit::%{_uuid}%::gold}
give 32 arrow to {_p}
set {_item} to "ARROW"
set {_x} to {THEPIT::MESSAGES::ITEM-PURCHASE}
replace all "[item]" with "%{_item}%" in {_x}
send "%{THEPIT::MESSAGES::pREFIX}% %{_x}%" to {_p}
else:
send "%{THEPIT::MESSAGES::pREFIX}% %{THEPIT::MESSAGES::NO-GOLD}%"

make a gui slot 15 of {_p} with diamond_chestplate named "&e&lDIAMOND CHESTPLATE" with lore "||&8&l- &7AUTO EQUIP ON BUY||||&8&l- &7LOST ON DEATH||||&8&l- &7COST: &6&l250" to run:
if pit_gold({_p}, "has", 250) is true:
pit_gold({_p}, "remove", 250)
set {_p}'s chestplate to diamond_chestplate
set {_item} to "DIAMOND CHESTPLATE"
set {_x} to {THEPIT::MESSAGES::ITEM-PURCHASE}
replace all "[item]" with "%{_item}%" in {_x}
send "%{THEPIT::MESSAGES::pREFIX}% %{_x}%" to {_p}
else:
send "%{THEPIT::MESSAGES::pREFIX}% %{THEPIT::MESSAGES::NO-GOLD}%"

make a gui slot 16 of {_p} with diamond_boots named "&e&lDIAMOND BOOTS" with lore "||&8&l- &7AUTO EQUIP ON BUY||||&8&l- &7LOST ON DEATH||||&8&l- &7COST: &6&l150" to run:
if pit_gold({_p}, "has", 150) is true:
pit_gold({_p}, "remove", 150)
set {_p}'s boots to diamond_boots
set {_item} to "DIAMOND BOOTS"
set {_x} to {THEPIT::MESSAGES::ITEM-PURCHASE}
replace all "[item]" with "%{_item}%" in {_x}
send "%{THEPIT::MESSAGES::pREFIX}% %{_x}%" to {_p}
else:
send "%{THEPIT::MESSAGES::pREFIX}% %{THEPIT::MESSAGES::NO-GOLD}%"



on place:
{pit::%uuid of player%::state} is "ingame"
if event-block is obsidian:
add location of event-block to {PIT::CLEANUP::*}
wait 120 seconds
set event-block to air
remove location of event-block from {PIT::CLEANUP::*}
if event-block is lava:
add location of event-block to {PIT::CLEANUP::*}
wait 2 seconds
set event-block to air
remove location of event-block from {PIT::CLEANUP::*}
else:
cancel event

on load:
broadcast "%{THEPIT::MESSAGES::pREFIX}% &aLoaded."
loop {PIT::CLEANUP::*}:
set block at loop-value to air
wait a tick

on block flow:
if event-block is lava:
loop {THEPIT::CONFIG::ENABLED-WORLDS::*}:
if event-world is loop-value:
cancel event
on break:
{pit::%uuid of player%::state} is "ingame"
event-block is not stationary_lava
cancel event

on drop:
{pit::%uuid of player%::state} is "ingame"
cancel event

on hunger bar change:
{pit::%uuid of player%::state} is "ingame"
cancel event
set player's hunger to 20


on right click on entity:
{pit::%uuid of player%::state} is "ingame"
if citizen id of event-entity is {THEPIT::CONFIG::SHOP-ID}:
pit_items_shop(player)
if citizen id of event-entity is {THEPIT::CONFIG::UPGRADE-ID}:
pit_upgrades_shop(player)


function pit_updatetag(p: player):
set {_uuid} to uuid of {_p}
set {_x} to {THEPIT::CONFIG::NAME-FORMAT}
replace all "{level}" with "%{pit::%{_uuid}%::level}%" in {_x}
replace all "{prefix}" with "%{_p}'s prefix%" in {_x}
make console execute command "nte player %{_p}% prefix %{_x}%"

function pit_equip(p: player):
set {_uuid} to uuid of {_p}
set {_p}'s level to {pit::%{_uuid}%::level}
wait 0.5 seconds
set slot 0 of {_p} to unbreakable iron_sword
set slot 1 of {_p} to unbreakable bow
if {pit::%{_uuid}%::perk::slot-1} or {pit::%{_uuid}%::perk::slot-2} = "FISHING-ROD":
set slot 2 of {_p} to unbreakable fishing rod
if {pit::%{_uuid}%::perk::slot-2} or {pit::%{_uuid}%::perk::slot-1} = "LAVA-BUCKET":
set slot 3 of {_p} to lava bucket
set slot 8 of {_p} to 30 arrows
wait 0.5 seconds
set {_p}'s helmet to unbreakable chain_helmet
set {_p}'s chestplate to unbreakable chain_chestplate
set {_p}'s leggings to unbreakable iron_leggings
set {_p}'s boots to unbreakable iron_boots

 
Üst