Sol Banner
Sağ Banner

Paylaşım SkyBlock World Edit Skripti

Moonshine

Risk almazsan, risk alanlar için çalışırsın.
Katılım
26 Ekim 2019
Mesajlar
65
En iyi cevaplar
1
Tepki puanı
-31
Puanları
1,215
Konum
Konya
Web Sitesi
batihost.com
Hastebin Bağlantısı
https://hastebin.com/efaguhivut.sql
6490

Tanıtım

Tekrardan merhaba MinecraftTR kullanıcıları. Bugün ki konumuzda SkyBlock sunucularında meşhur olan oyunculara açık olarak yapılandırılan world edit sisteminin skript halini paylaşacağım. Şimdiden söylüyorum skript bana ait değildir! Skript ASkyBlock, BSkyBlock, FabledSkyBlock ve WorldGuard pluginleriyle uyumludur.
6490

Skript
Evet, gelelim skript kısmına. İşte skript:



Kod:
import:
    fr.mrmicky.fastparticle.FastParticle
    fr.mrmicky.fastparticle.ParticleType   

options:
    plugin-version: 1.2.0
    
function leafwe_check_yaml(dir: text, value: text, set: text, type: text = "text"):
    yaml value {_value} from "leafwe.%{_dir}%" is not set:
        if {_type} is "text" or "material":
            set yaml value {_value} from "leafwe.%{_dir}%" to {_set}
        if {_type} is "number":
            set yaml value {_value} from "leafwe.%{_dir}%" to {_set} parsed as number   
        if {_type} is "boolean":   
            set yaml value {_value} from "leafwe.%{_dir}%" to {_set} parsed as boolean
    if {_type} is "list":
        yaml list {_value} from "leafwe.%{_dir}%" is not set   
        loop {_set} split at "||":
            add loop-value to yaml list {_value} from "leafwe.%{_dir}%"

#By EWS#5810
#https://forums.skunity.com/members/ews.60/
local expression replacer %texts% with %texts% in %text%:
    return type: text
    get:
        set {_result} to expr-3
        loop exprs-1:
            add 1 to {_n}
            replace all "%loop-value-1%" with ({_n}th element of exprs-2 ? "") in {_result}
        return {_result}
#

function leaf_we_set_pos(p: player, loc: location, pos: text):
    block at {_loc} is not air
    distance between {_p} and block at {_loc} < 5
    set {-LEAF-WE::PlayerData::%{_p}%::POS-%{_pos}%} to {_loc}
    send replacer "{pos}" with "%{_pos}%" in yaml value "Messages.Position Set" from "leafwe.config" to {_p}

on left click:
    if player's tool is {-LEAF-WE::Wand} named yaml value "Settings.Wand.Name" from "leafwe.config":
        cancel event
        leaf_we_set_pos(player, location of target block, "1")
    
on right click:
    if player's tool is {-LEAF-WE::Wand} named yaml value "Settings.Wand.Name" from "leafwe.config":
        cancel event
        leaf_we_set_pos(player, location of target block, "2")

function leafwe_check_block(loc: location) :: boolean:
    loop {-LEAF-WE::BlocksBlackList::*}:
        if block at {_loc} is loop-value-1:
            return true
    return false

function deleteMinion(p: player, loc: location):
    loop all entities in radius 1 of {_loc}:
        if metadata value "MINION_BUILDER" of loop-entity = "%{_p}%":
            clear loop-entity

function createMinion(p: player, loc: location, block: material) :: entity:
    spawn an armor stand at {_loc}
    set {_stand} to spawned armor stand   
    set metadata value "MINION_BUILDER" of {_stand} to "%{_p}%"
    set {_stand}'s helmet to {-LEAF-WE::MinionHead::%{_p}%}   
    {_stand}.setArms(true)   
    {_stand}.setSmall(true)   
    {_stand}.setGravity(false)
    {_stand}.setBasePlate(false)   
    {_stand}.setCustomNameVisible(true)
    {_stand}.setCustomName("&7%{_p}'s display name%")   
    set {_stand}'s tool to {_block}       
    set {_stand}'s Chestplate to Iron Chestplate
    set {_stand}'s Leggings to Iron Leggings
    set {_stand}'s Boots to Iron Boots
    return {_stand}

command CreateWorldEditTool:
    trigger:
        if player has permission yaml value "Settings.Permission" from "leafwe.config":
            if "%type of player's tool%" is "%type of {-LEAF-WE::Wand}%":
                set name of player's tool to yaml value "Settings.Wand.Name" from "leafwe.config"
            else:
                send replacer "{item}" with "%type of {-LEAF-WE::Wand}%" in yaml value "Messages.Invalid Item" from "leafwe.config" to player       
        else:
            send yaml value "Messages.No Permission" from "leafwe.config"

command set [<material>]:
    trigger:
        if player has permission yaml value "Settings.Permission" from "leafwe.config":
            if {-LEAF-WE::PlayerData::%player%::POS-1} is set:
                if {-LEAF-WE::PlayerData::%player%::POS-2} is set:
                    if arg-1 is not set:
                        set {_block} to player's tool
                    if arg-1 is set:               
                        set {_block} to arg-1
                    if {_block} is solid:   
                        if yaml value "Settings.Multiple Jobs" from "leafwe.config" is false:
                            {-LEAF-WE::PlayerData::%player%::RUNNING} is set   
                            send yaml value "Messages.Already Started" from "leafwe.config"
                            stop
                        set {-LEAF-WE::PlayerData::%player%::RUNNING} to true   
                        send yaml value "Messages.Start Job" from "leafwe.config"
                        set {_w} to world of {-LEAF-WE::PlayerData::%player%::POS-1}
                        if yaml value "Settings.Minion" from "leafwe.config" is true:                       
                            set {_stand} to createMinion(player, location of block above {-LEAF-WE::PlayerData::%player%::POS-1}, {_block})
                        loop blocks within {-LEAF-WE::PlayerData::%player%::POS-1} to {-LEAF-WE::PlayerData::%player%::POS-2}:
                            if player is online:
                                if number of {_block} in player's inventory > 0:
                                    set {_loc} to location of loop-block
                                    leafwe player can build at {_loc}
                                    if leafwe_check_block({_loc}) is false:   
                                        if block at {_loc} != any leaves or air:
                                            give block at {_loc} to player   
                                        if {_stand} is set:
                                            teleport {_stand} to block above {_loc}                                           
                                        set block at {_loc} to {_block}
                                        FastParticle.spawnParticle({_w}, ParticleType.FIREWORKS_SPARK, {_loc} and 1)
                                        remove 1 of {_block} from player's inventory
                                    wait {-LEAF-WE::Speed}
                                else:
                                    delete {-LEAF-WE::PlayerData::%player%::RUNNING}
                                    deleteMinion(player, location of {_stand})
                                    send yaml value "Messages.Out of blocks" from "leafwe.config"
                                    stop
                            else:
                                deleteMinion(player, location of {_stand})
                                stop   
                        delete {-LEAF-WE::PlayerData::%player%::RUNNING}   
                        deleteMinion(player, location of {_stand})
                        send yaml value "Messages.Finish Job" from "leafwe.config"
                    else:
                        send yaml value "Messages.Cannot use this item" from "leafwe.config"
                else:
                    send replacer "{pos}" with "2" in yaml value "Messages.Position Not Set" from "leafwe.config" to player       
            else:
                send replacer "{pos}" with "1" in yaml value "Messages.Position Not Set" from "leafwe.config" to player       
        else:
            send yaml value "Messages.No Permission" from "leafwe.config"
                
on quit:
    delete {-LEAF-WE::PlayerData::%player%::*}

on load:
    loop currently loaded yaml files:
        loop-value contains "leafwe.config"
        unload yaml loop-value-1   
    load yaml "plugins/LeafWorldEdit/config.yml" as "leafwe.config"
    leafwe_check_yaml("config", "Settings.Wand.Item", "blaze rod")       
    leafwe_check_yaml("config", "Settings.Wand.Name", "&8❐ &eWorld Edit &8❐")   
    leafwe_check_yaml("config", "Settings.Permission", "leafwe.set")       
    leafwe_check_yaml("config", "Settings.Speed", "2 ticks")
    leafwe_check_yaml("config", "Settings.Multiple Jobs", "true", "boolean")   
    leafwe_check_yaml("config", "Settings.Block Break Blacklist", "chest||bedrock||mob spawner||ender chest", "list")   
    leafwe_check_yaml("config", "Settings.Minion", "true", "boolean")   
    leafwe_check_yaml("config", "Messages.Position Not Set", "&ePozisyon &3{pos} &ebelirlenmedi.")   
    leafwe_check_yaml("config", "Messages.Position Set", "&ePozisyon &3{pos} &eolarak belirlendi.")
    leafwe_check_yaml("config", "Messages.Out of blocks", "&eBlok dışı.")
    leafwe_check_yaml("config", "Messages.Cannot use this item", "&eMaalesef bu eşyayı kullanamazsın.")   
    leafwe_check_yaml("config", "Messages.Start Job", "&eBloklar koyulmaya başlandı...")       
    leafwe_check_yaml("config", "Messages.Already Started", "&eLütfen blokların tümünün koyulmasını bekleyiniz.")       
    leafwe_check_yaml("config", "Messages.Invalid Item", "&eYetersiz Eşya. &a{item} &eeşya kadar ihtiyacın var!")   
    leafwe_check_yaml("config", "Messages.Finish Job", "&eBitti.")       
    leafwe_check_yaml("config", "Messages.No Permission", "&cBu komudu kullanmaya iradeniz yetmemektedir.")           
    send "&8|--------------------------------------------&8|" to console
    send " " to console
    send "&3&lYükleniyor.. &aLeaf &6WorldEdit &ev.{@plugin-version}&3..." to console
    send "&3&lPlugin yüklendi!" to console
    send " " to console
    send "&8|--------------------------------------------&8|" to console
    save yaml "leafwe.config"
    delete {-LEAF-WE::*}
    set {-LEAF-WE::Speed} to yaml value "Settings.Speed" from "leafwe.config" parsed as timespan
    set {-LEAF-WE::Wand} to yaml value "Settings.Wand.Item" from "leafwe.config" parsed as material
    loop yaml list "Settings.Block Break Blacklist" from "leafwe.config":
        if "%loop-value-1%" parsed as material is set:
            add "%loop-value-1%" parsed as material to {-LEAF-WE::BlocksBlackList::*}
        else:
            broadcast "&aBlok &c%loop-value-1% bulunamadı!"

on join:
    set {-LEAF-WE::MinionHead::%player%} to skull of "%player%" parsed as offline player


on unload:
    send "&8|--------------------------------------------&8|" to console
    send " " to console
    send "&3&lDevre dışı bırakılıyor.. &ev.{@plugin-version}&3&l..." to console
    send "&3&lv.{@plugin-version} devre dışı!" to console
    send " " to console
    send "&8|--------------------------------------------&8|" to console
Kod:

6490

Gerekli Addonlar




6490
 

Üst