# # # # # # # # # # # # # # # # # # # # # # # # # # # # # Skrypt stworzony przez 3_fendi_3 # # Zakaz podpisywania go jako swojego # # Zakaz sprzedawania # # Zezwalam na modyfikacje lub udostepnianie # # DC: https://discord.gg/kqMPxN9HuQ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # options: prefix: &e&l[&d&lTikTok&e&l] command /tiktok [] []: permission: op permission message: "&cGdzie z łapami" trigger: if arg 1 is not set: send "&6Komendy TikTok &7(Made By Fendi)" to player send "&6/tiktok (kilof) (moc kopania)" to player send "&8-&7Otrzymujesz kilof tiktok do ekwipunktu" to player send "&6/tiktok (blok) (hp bloku)" to player send "&8-&7Otrzymujesz blok tiktok z wpisaną przez ciebie ilością życia" to player send "&6/tiktok (dodaj) (ilosc hp)" to player send "&8-&7Dodajesz hp do bloku pod którym stoisz" to player send "&6/tiktok (usun) (ilosc hp)" to player send "&8-&7Usuwasz hp z bloku pod którym stoisz" to player else if arg 1 is "kilof": set {_} to diamond pickaxe of mending 10 named "&5Kilof Tiktok" with lore "&6Specjalny kilof kopiący bloki z HP" if arg 2 is set: set 2nd line of lore of {_} to "&5Moc kopania: &f%arg-2%" give player {_} send "{@prefix} &aOtrzymałeś kilof tiktok" to player arg 2 is set if arg 1 is "blok": give player diamond ore named "&aBlok gracza %player%" with lore "&aHp bloku: &e%arg-2%" send "{@prefix} &aOtrzymałeś blok tiktok z %arg-2% hp!" to player else if arg 1 is "dodaj": if {blok::%location of block under player%} is set: add arg 2 to {blok::%location of block under player%} send "{@prefix} &aDodałes %arg-2% do bloku!" to player tiktok_holo(location of block under player) else: send "{@prefix} &aTo nie jest blok Tiktok!" to player else if arg 1 is "usun": remove arg 2 from {blok::%location of block under player%} send "{@prefix} &aUsunąłeś %arg-2% z bloku!" to player tiktok_holo(location of block under player) on tab complete of "/tiktok": set tab completions for position 1 to "kilof", "blok", "dodaj" and "usun" on place: name of player's held item contains "&aBlok gracza" set {_} to uncolored 1st line of lore of player's held item replace "Hp bloku: " with "" in {_} set {_} to "%{_}%" parsed as integer set {blok::%location of event-block%} to {_} send "{@prefix} &aPołożyłeś blok tiktok!" to player tiktok_holo(location of event-block) on break: event-block is diamond ore {blok::%location of event-block%} is set cancel event set {_moc} to 1 set {_lore} to uncolored 2nd line of lore of player's tool if {_lore} contains "Moc kopania: ": replace "Moc kopania: " with "" in {_lore} set {_lore} to "%{_lore}%" parsed as integer set {_moc} to {_lore} if {blok::%location of event-block%} > 0: remove {_moc} from {blok::%location of event-block%} tiktok_holo(location of event-block) if {blok::%location of event-block%} <= 0: send "{@prefix} &aWykopałeś blok Tiktok!" to player clear drops set event-block to air loop all armor stands in radius 1 of location of event-block: delete loop-entity delete {holo::%location of event-block%} stop function tiktok_holo(l: location): if {holo::%{_l}%} is set: loop all armor stands in radius 1 of {_l}: set string tag "CustomName" of nbt compound of loop-value to "{""text"":"""",""extra"":[{""text"":""HP: "",""obfuscated"":false,""italic"":false,""underlined"":false,""strikethrough"":false,""color"":""green"",""bold"":false},{""text"":""%{blok::%{_l}%}%"",""italic"":false,""color"":""red""}]}" else: set {holo::%{_l}%} to {_l} create hologram "&aHP: &c%{blok::%{_l}%}%" with id {_l} at location 0.5 block above {_l} command /resettiktok: permission: op permission message: "&cGdzie z łapami" trigger: delete {blok::*} loop {holo::*}: delete hologram with id loop-value delete {holo::*} send "&aSkrypt zresetowany" command /tikfinityblok [] []: permission: op permission message: "&cGdzie z łapami" trigger: if target block of arg 1 is diamond ore: set {_} to location of target block of arg 1 {blok::%{_}%} is set add arg 2 to {blok::%{_}%} tiktok_holo(location of target block of arg 1) else: loop all blocks in radius 30 of player: if loop-block is diamond ore: set {_} to location of loop-block if {blok::%{_}%} is set: add arg 2 to {blok::%{_}%} tiktok_holo(location of {_}) # API do hologramu https://www.spigotmc.org/resources/skript-holograms.117196/ import: org.bukkit.entity.ArmorStand # # # ██╗ ██╗ ██████╗ ██╗ ██████╗ ██████╗ ██████╗ █████╗ ███╗ ███╗ █████╗ ██████╗ ██╗ # ██║ ██║██╔═══██╗██║ ██╔═══██╗██╔════╝ ██╔══██╗██╔══██╗████╗ ████║██╔══██╗██╔══██╗██║ # ███████║██║ ██║██║ ██║ ██║██║ ███╗██████╔╝███████║██╔████╔██║███████║██████╔╝██║ # ██╔══██║██║ ██║██║ ██║ ██║██║ ██║██╔══██╗██╔══██║██║╚██╔╝██║██╔══██║██╔═══╝ ██║ # ██║ ██║╚██████╔╝███████╗╚██████╔╝╚██████╔╝██║ ██║██║ ██║██║ ╚═╝ ██║██║ ██║██║ ██║ # ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ # # Author: iannikde # Ver: v1.0 # options: index: skholo offset: 0 spacing: 4 add: 1 remove: 2 get: 3 set: 4 # ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ # # -- Syntax -- # # ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ condition holo[gram] with id %string% exists: check: return true if (existHolo(expr-1) = true) condition holo[gram] with id %string% doesn't exist: check: return true if (existHolo(expr-1) != true) effect create holo[gram] %string% with id %string% at %location%: trigger: set {_text} to expr-1 set {_id} to expr-2 set {_loc} to expr-3 holoBuilder({_id}, {_loc}, {_text}) effect append %string% to holo[gram] with id %string%: trigger: set {_text} to expr-1 set {_id} to expr-2 appendLine({_id}, {_text}) expression line %int% of holo[gram] with id %string%: get: set {_line} to expr-1 set {_id} to expr-2 return hololine({@get}, {_id}, {_line}, "") set: set {_line} to expr-1 set {_id} to expr-2 set {_text} to (change value) hololine({@set}, {_id}, {_line}, {_text}) effect delete holo[gram] with id %string%: trigger: set {_id} to expr-1 removeHolo({_id}) effect create temp-holo[gram] %string% at %location% for %timespan%: trigger: set {_text} to expr-1 set {_loc} to expr-2 set {_time} to expr-3 tempHoloBuilder({_loc}, {_time}, {_text}) expression all registered holo[gram]s: return type: objects get: return getAllHolos() expression location of holo[gram] with id %string%: return type: location get: return getHoloLoc(expr-1) # ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ # # -- Code -- # # ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ on load: purgeTempHolos(1) every second: purgeTempHolos(2) local function getAllHolos() :: objects: return {{@index}::allholos::*} local function getAllTempHolos() :: objects: return {{@index}::alltempholos::*} local function allHolos(act: number, id: string): add {_id} to {{@index}::allholos::*} if ({_act} = {@add}) remove {_id} from {{@index}::allholos::*} if ({_act} = {@remove}) local function allTempHolos(act: number, id: string): add {_id} to {{@index}::alltempholos::*} if ({_act} = {@add}) remove {_id} from {{@index}::alltempholos::*} if ({_act} = {@remove}) local function createHolo(id: string, holo: object): set {{@index}::holo::parent::%{_id}%} to {_holo} if (getAllHolos() doesn't contain {_id}) add {_holo} to {{@index}::holo::children::%{_id}%::*} if (getAllHolos() contains {_id}) local function getChildren(id: string) :: int: return (amount of {{@index}::holo::children::%{_id}%::*}) local function hololine(act: int, str: string, line: int, text: string) :: string: set {_id} to toID({_str}) if {_line} = 1: set {_holo} to {{@index}::holo::parent::%{_id}%} if (getAllHolos() contains {_id}) if {_line} > 1: set {_child} to ({_line} -1) if getChildren({_id}) >= {_child}: set {_holo} to {{@index}::holo::children::%{_id}%::%{_child}%} if (getAllHolos() contains {_id}) if {_holo} is set: return {_holo}.getCustomName() if {_act} = {@get} {_holo}.setCustomName(formatted {_text}) if {_act} = {@set} local function removeHolo(str: string): set {_id} to toID({_str}) {{@index}::holo::parent::%{_id}%}.remove() delete {{@index}::holo::parent::%{_id}%} loop {{@index}::holo::children::%{_id}%::*}: set {_holo} to loop-value {_holo}.remove() clear {{@index}::holo::children::%{_id}%::*} allHolos({@remove}, {_id}) local function createTempHolo(id: string, holo: object, time: timespan): set {{@index}::tempholo::holo::%{_id}%} to {_holo} set {{@index}::tempholo::time::%{_id}%} to {_time} set {{@index}::tempholo::creation::%{_id}%} to now local function removeTempHolo(str: string): set {_id} to toID({_str}) {{@index}::tempholo::holo::%{_id}%}.remove() delete {{@index}::tempholo::time::%{_id}%} delete {{@index}::tempholo::creation::%{_id}%} allTempHolos({@remove}, {_id}) local function toID(str: string) :: string: return {_str}.toLowerCase().replace(" ","_") local function holoBuilder(str: string, loc: location, text: string): set {_type} to (armor stand) set {_id} to toID({_str}) set {_spawnloc} to {_loc} if (getAllHolos() doesn't contain {_id}): if {_type} = armor stand: {_spawnloc}.setY({_spawnloc}.getY() + 100) set {_holo} to {_spawnloc}.getWorld().spawn({_spawnloc}, ArmorStand.class) {_holo}.setVisible(false) {_holo}.setMarker(true) {_holo}.setCustomName(formatted {_text}) {_holo}.setCustomNameVisible(true) {_holo}.setGravity(false) # if {_type} = text display: createHolo({_id}, {_holo}) allHolos({@add}, {_id}) {_loc}.setY({_loc}.getY() + {@offset}) {_holo}.teleport({_loc}) local function tempHoloBuilder(loc: location, time: timespan, text: string): set {_type} to (armor stand) set {_str} to tempHoloIdManager().toString() set {_id} to toID({_str}) set {_spawnloc} to {_loc} if (getAllTempHolos() doesn't contain {_id}): if {_type} = armor stand: {_spawnloc}.setY({_spawnloc}.getY() + 100) set {_holo} to {_spawnloc}.getWorld().spawn({_spawnloc}, ArmorStand.class) {_holo}.setVisible(false) {_holo}.setMarker(true) {_holo}.setCustomName(formatted {_text}) {_holo}.setCustomNameVisible(true) {_holo}.setGravity(false) # if {_type} = text display: createTempHolo({_id}, {_holo}, {_time}) allTempHolos({@add}, {_id}) {_loc}.setY({_loc}.getY() + {@offset}) {_holo}.teleport({_loc}) local function getHoloLoc(str: string) :: location: set {_id} to toID({_str}) return {{@index}::holo::parent::%{_id}%} local function getTempHoloLoc(str: string) :: location: set {_id} to toID({_str}) return {{@index}::tempholo::loc::%{_id}%} local function getTempHoloTime(str: string) :: timespan: set {_id} to toID({_str}) return {{@index}::tempholo::time::%{_id}%} local function getTempHoloCreation(str: string) :: date: set {_id} to toID({_str}) return {{@index}::tempholo::creation::%{_id}%} local function tempHoloIdManager() :: int: set {_amount} to amount of getAllTempHolos() -1 return ({_amount} +1) if {_amount} is set, else 0 local function purgeTempHolos(act: int): if {_act} = 1: set {_holos::*} to getAllTempHolos() loop {_holos::*}: set {_holo} to loop-value removeTempHolo({_holo}) if {_act} = 2: set {_holos::*} to getAllTempHolos() loop {_holos::*}: set {_holo} to loop-value set {_time} to getTempHoloTime({_holo}) set {_creation} to getTempHoloCreation({_holo}) set {_diff} to difference between {_creation} and now if {_diff} >= {_time}: removeTempHolo({_holo}) local function appendLine(str: string, text: string): set {_id} to toID({_str}) if (getAllHolos() contains {_id}): set {_spawnloc} to getHoloLoc({_str}) set {_loc} to getHoloLoc({_str}) {_spawnloc}.setY({_spawnloc}.getY() + 100) set {_holo} to {_spawnloc}.getWorld().spawn({_spawnloc}, ArmorStand.class) {_holo}.setVisible(false) {_holo}.setMarker(true) {_holo}.setCustomName(formatted {_text}) {_holo}.setCustomNameVisible(true) {_holo}.setGravity(false) createHolo({_id}, {_holo}) set {_factor} to getChildren({_id}) / {@spacing} {_loc}.setY({_loc}.getY() - {_factor}) {_holo}.teleport({_loc}) local function existHolo(str: string) :: boolean: set {_id} to toID({_str}) return true if (getAllHolos() contains {_id})