Jump to content

Gen Script


ZephsyJ

Recommended Posts

options:
    prefix: &d[FARMIED]&7
    wheatItem: hay bale named "&eWheat Generator" with lore "&7Output: &e$5" and "&7Tier: &e1"
    melonItem: melon block named "&eMelon Generator" with lore "&7Output: &e$10" and "&7Tier: &e2"
    pumpkinItem: pumpkin named "&ePumpkin Generator" with lore "&7Output: &e$20" and "&7Tier: &e3"
    coalItem: coal block named "&eCoal Generator" with lore "&7Output: &e$35" and "&7Tier: &e4"
    ironItem: iron block named "&eIron Generator" with lore "&7Output: &e$50" and "&7Tier: &e5"
    goldItem: gold block named "&eGold Generator" with lore "&7Output: &e$75" and "&7Tier: &e6"
    redstoneItem: redstone block named "&eRedstone Generator" with lore "&7Output: &e$100" and "&7Tier: &e7"
    lapisItem: lapis block named "&eLapis Generator" with lore "&7Output: &e$150" and "&7Tier: &e8"
    diamondItem: diamond block named "&eDiamond Generator" with lore "&7Output: &e$200" and "&7Tier: &e9"
    emeraldItem: emerald block named "&eEmerald Generator" with lore "&7Output: &e$250" and "&7Tier: &e10"
    magmaItem: magma block named "&eMagma Generator" with lore "&7Output: &e$300" and "&7Tier: &e11"
    obsidianItem: obsidian named "&eObsidian Generator" with lore "&7Output: &e$400" and "&7Tier: &e12"
    netheriteItem: netherite block named "&eNetherite Generator" with lore "&7Output: &e$500" and "&7Tier: &e13"
    starItem: beacon named "&eStar Generator" with lore "&7Output: &e$750" and "&7Tier: &e14"
    abyssItem: purple glazed terracotta named "&eVoid Generator" with lore "&7Output: &e$1000" and "&7Tier: &e15"
    warpedItem: warped hyphae named "&eWarped Generator" with lore "&7Output: &e$1500" and "&7Tier: &e16"
    twirledItem: crimson hyphae named "&eTwirled Generator" with lore "&7Output: &e$3000" and "&7Tier: &e17"
    wheat2melon: 2500
    melon2pumpkin: 7500
    pumpkin2coal: 15000
    coal2iron: 30000
    iron2gold: 60000
    gold2redstone: 120000
    redstone2lapis: 260000
    lapis2diamond: 420000
    diamond2emerald: 650000
    emerald2magma: 1000000
    magma2obsidian: 1500000
    obsidian2netherite: 2500000
    netherite2star: 10000000
    star2abyss: 25000000
    abyss2warped: 35000000
    warped2twirled: 50000000

command /generators [<player>]:
    aliases: /gens
    trigger:
        if arg-1 is not set:
            send "{@prefix} You have &e%size of {generators::%player%::*}%&7/&e%getGens(player)% &7Generators placed"
        else:
            send "{@prefix} You have &e%size of {generators::%arg-1%::*}%&7/&e%getGens(arg-1)% &7Generators placed"

command /genlist:
    aliases: /generatorlist, /gl
    trigger:
        create a gui with virtual chest with 5 rows named "Generator List":
            make gui slot 10 with hay bale named "&dWheat Generator" with lore "&7Output: &d$5" and "&7Price: &d$500"
            make gui slot 11 with melon block named "&dMelon Generator" with lore "&7Output: &d$10" and "&7Price: &d$2,500"
            make gui slot 12 with carved pumpkin named "&dPumpkin Generator" with lore "&7Output: &d$20" and "&7Price: &d$7,500"
            make gui slot 13 with coal block named "&dCoal Generator" with lore "&7Output: &d$35" and "&7Price: &d$15,000"
            make gui slot 14 with iron block named "&dIron Generator" with lore "&7Output: &d$50" and "&7Price: &d$30,000"
            make gui slot 15 with gold block named "&dGold Generator" with lore "&7Output: &d$75" and "&7Price: &d$60,000"
            make gui slot 16 with redstone block named "&dRedstone Generator" with lore "&7Output: &d$100" and "&7Price: &d$120,000"
            make gui slot 19 with lapis block named "&dLapis Generator" with lore "&7Output: &d$150" and "&7Price: &d$260,000"
            make gui slot 20 with diamond block named "&dDiamond Generator" with lore "&7Output: &d$200" and "&7Price: &d$420,000"
            make gui slot 21 with emerald block named "&dEmerald Generator" with lore "&7Output: &d$250" and "&7Price: &d$650,000"
            make gui slot 22 with magma block named "&dMagma Generator" with lore "&7Output: &d$300" and "&7Price: &d$1,000,000"
            make gui slot 23 with obsidian named "&dObsidian Generator" with lore "&7Output: &d$400" and "&7Price: &d$1,500,000"
            make gui slot 24 with black wool named "&dNetherite Generator" with lore "&7Output: &d$500" and "&7Price: &d$2,500,000"
            make gui slot 25 with beacon named "&dStar Generator" with lore "&7Output: &d$750" and "&7Price: &d$10,000,000"
            make gui slot 28 with purple glazed terracotta named "&dVoid Generator" with lore "&7Output: &d$1,000" and "&7Price: &d$25,000,000"
            make gui slot 29 with {@warpedItem} with lore "&7Output: &e$1,500" and "&7Price: &d$35,000,000"
            make gui slot 30 with {@twirledItem} with lore "&7Output: &e$3,000" and "&7Price: &d$50,000,000"
        open last gui to player

command /generator <text> <number>:
    permission: admin
    aliases: /gen
    trigger:
        send "{@prefix} You were given a generator"
        if arg-1 is "wheat":
            give player arg-2 of {@wheatItem}
        else if arg-1 is "melon":
            give player arg-2 of {@melonItem}
        else if arg-1 is "pumpkin":
            give player arg-2 of {@pumpkinItem}
        else if arg-1 is "coal":
            give player arg-2 of {@coalItem}
        else if arg-1 is "iron":
            give player arg-2 of {@ironItem}
        else if arg-1 is "gold":
            give player arg-2 of {@goldItem}
        else if arg-1 is "redstone":
            give player arg-2 of {@redstoneItem}
        else if arg-1 is "lapis":
            give player arg-2 of {@lapisItem}
        else if arg-1 is "diamond":
            give player arg-2 of {@diamondItem}
        else if arg-1 is "emerald":
            give player arg-2 of {@emeraldItem}
        else if arg-1 is "magma":
            give player arg-2 of {@magmaItem}
        else if arg-1 is "obsidian":
            give player arg-2 of {@obsidianItem}
        else if arg-1 is "netherite":
            give player arg-2 of {@netheriteItem}
        else if arg-1 is "star":
            give player arg-2 of {@starItem}
        else if arg-1 is "abyss":
            give player arg-2 of {@abyssItem}
        else if arg-1 is "warped":
            give player arg-2 of {@warpedItem}
        else if arg-1 is "twirl":
            give player arg-2 of {@twirledItem}
        else:
            send "{@prefix} That is not a generator type!"

on place:
    if player's tool is hay block or melon or pumpkin or coal block or iron block or gold block or redstone block or lapis block or diamond block or emerald block or magma block or obsidian or netherite block or beacon or purple glazed terracotta or warped hyphae or crimson hyphae:
        set {_name} to name of player's tool
        if {_name} contains "Generator" and "&e":
            if size of {generators::%player%::*} is less than getGens(player):
                play sound "entity.experience_orb.pickup" with volume 10 and pitch 1 at player's location for player
                add event-location to {generators::%player%::*}
                send "{@prefix} You have placed a generator &e(%size of {generators::%player%::*}%&e/%getGens(player)%&e)"
            else:
                cancel event
                play "ENTITY_VILLAGER_NO" to player at volume 10
                send "{@prefix} &cYou cannot place any more gens! &c(&f%size of {generators::%player%::*}%&c/&f%getGens(player)%&c)"
        else:
            cancel event
            play "ENTITY_VILLAGER_NO" to player at volume 10
            send "{@prefix} &cYou may not place this block as it is not a generator!"

on leftclick:
    if {generators::%player%::*} contains event-location:
        play sound "entity.experience_orb.pickup" with volume 10 and pitch 1 at player's location for player
        set {_block} to block at event-location
        if {_block} is hay bale:
            give player 1 of {@wheatItem}
        else if {_block} is melon block:
            give player 1 of {@melonItem}
        else if {_block} is pumpkin:
            give player 1 of {@pumpkinItem}
        else if {_block} is coal block:
            give player 1 of {@coalItem}
        else if {_block} is iron block:
            give player 1 of {@ironItem}
        else if {_block} is gold block:
            give player 1 of {@goldItem}
        else if {_block} is lapis block:
            give player 1 of {@lapisItem}
        else if {_block} is redstone block:
            give player 1 of {@redstoneItem}
        else if {_block} is diamond block:
            give player 1 of {@diamondItem}
        else if {_block} is emerald block:
            give player 1 of {@emeraldItem}
        else if {_block} is magma block:
            give player 1 of {@magmaItem}
        else if {_block} is obsidian:
            give player 1 of {@obsidianItem}
        else if {_block} is netherite block:
            give player 1 of {@netheriteItem}
        else if {_block} is beacon:
            give player 1 of {@starItem}
        else if {_block} is purple glazed terracotta:
            give player 1 of {@abyssItem}
        else if {_block} is warped hyphae:
            give player 1 of {@warpedItem}
        else if {_block} is crimson hyphae:
            give player 1 of {@twirledItem}
        set block at event-location to air
        remove event-location from {generators::%player%::*}
        send "{@prefix} You have removed a generator &e(%size of {generators::%player%::*}%&e/%getGens(player)%&e)"

every 5 seconds:
    loop all players:
        loop {generators::%loop-player%::*}:
            set {_block} to block at loop-value-2
            set {_location} to loop-value-2
            add 0.5 to the y-coordinate of {_location}
            if {_block} is hay bale:
                drop 1 wheat at {_location} without velocity
            else if {_block} is melon block:
                drop 1 melon slice at {_location} without velocity
            else if {_block} is pumpkin:
                drop 1 pumpkin pie at {_location} without velocity
            else if {_block} is coal block:
                drop 1 coal at {_location} without velocity
            else if {_block} is iron block:
                drop 1 iron ingot at {_location} without velocity
            else if {_block} is gold block:
                drop 1 gold ingot at {_location} without velocity
            else if {_block} is redstone block:
                drop 1 redstone at {_location} without velocity
            else if {_block} is lapis block:
                drop 1 lapis lazuli at {_location} without velocity
            else if {_block} is diamond block:
                drop 1 diamond at {_location} without velocity
            else if {_block} is emerald block:
                drop 1 emerald at {_location} without velocity
            else if {_block} is magma block:
                drop 1 magma cream at {_location} without velocity
            else if {_block} is obsidian:
                drop 1 flint at {_location} without velocity
            else if {_block} is netherite block:
                drop 1 netherite ingot at {_location} without velocity
            else if {_block} is beacon:
                drop 1 nether star at {_location} without velocity
            else if {_block} is purple glazed terracotta:
                drop 1 dried kelp at {_location} without velocity
            else if {_block} is warped hyphae:
                drop 1 blue dye at {_location} without velocity
            else if {_block} is crimson hyphae:
                drop 1 red dye at {_location} without velocity
            else:
                remove loop-value-2 from {generators::%loop-player%::*}

on rightclick:
    player is sneaking
    if {generators::%player%::*} contains event-location:
        set {_block} to block at event-location
        if {_block} is hay bale:
            if player's balance is more than or equal to {@wheat2melon}:
                send "{@prefix} You have upgraded your generator!"
                set block at event-location to melon
                remove {@wheat2melon} from player's balance
                play sound "entity.experience_orb.pickup" with volume 10 and pitch 1 at player's location for player
            else:
                play sound "block.note_block.bass" with volume 10 and pitch 1 at player's location for player
                send "{@prefix} You need &a$%{@wheat2melon}-player's balance% &7more to upgrade!"
        else if {_block} is melon:
            if player's balance is more than or equal to {@melon2pumpkin}:
                send "{@prefix} You have upgraded your generator!"
                set block at event-location to pumpkin
                remove {@melon2pumpkin} from player's balance
                play sound "entity.experience_orb.pickup" with volume 10 and pitch 1 at player's location for player
            else:
                play sound "block.note_block.bass" with volume 10 and pitch 1 at player's location for player
                send "{@prefix} You need &a$%{@melon2pumpkin}-player's balance% &7more to upgrade!"
        else if {_block} is pumpkin:
            if player's balance is more than or equal to {@pumpkin2coal}:
                send "{@prefix} You have upgraded your generator!"
                set block at event-location to coal block
                remove {@pumpkin2coal} from player's balance
                play sound "entity.experience_orb.pickup" with volume 10 and pitch 1 at player's location for player
            else:
                play sound "block.note_block.bass" with volume 10 and pitch 1 at player's location for player
                send "{@prefix} You need &a$%{@pumpkin2coal}-player's balance% &7more to upgrade!"
        else if {_block} is coal block:
            if player's balance is more than or equal to {@coal2iron}:
                send "{@prefix} You have upgraded your generator!"
                set block at event-location to iron block
                remove {@coal2iron} from player's balance
                play sound "entity.experience_orb.pickup" with volume 10 and pitch 1 at player's location for player
            else:
                play sound "block.note_block.bass" with volume 10 and pitch 1 at player's location for player
                send "{@prefix} You need &a$%{@coal2iron}-player's balance% &7more to upgrade!"
        else if {_block} is iron block:
            if player's balance is more than or equal to {@iron2gold}:
                send "{@prefix} You have upgraded your generator!"
                set block at event-location to gold block
                remove {@iron2gold} from player's balance
                play sound "entity.experience_orb.pickup" with volume 10 and pitch 1 at player's location for player
            else:
                play sound "block.note_block.bass" with volume 10 and pitch 1 at player's location for player
                send "{@prefix} You need &a$%{@iron2gold}-player's balance% &7more to upgrade!"
        else if {_block} is gold block:
            if player's balance is more than or equal to {@gold2redstone}:
                send "{@prefix} You have upgraded your generator!"
                set block at event-location to redstone block
                remove {@gold2redstone} from player's balance
                play sound "entity.experience_orb.pickup" with volume 10 and pitch 1 at player's location for player
            else:
                play sound "block.note_block.bass" with volume 10 and pitch 1 at player's location for player
                send "{@prefix} You need &a$%{@gold2redstone}-player's balance% &7more to upgrade!"
        else if {_block} is redstone block:
            if player's balance is more than or equal to {@redstone2lapis}:
                send "{@prefix} You have upgraded your generator!"
                set block at event-location to lapis block
                remove {@redstone2lapis} from player's balance
                play sound "entity.experience_orb.pickup" with volume 10 and pitch 1 at player's location for player
            else:
                play sound "block.note_block.bass" with volume 10 and pitch 1 at player's location for player
                send "{@prefix} You need &a$%{@redstone2lapis}-player's balance% &7more to upgrade!"
        else if {_block} is lapis block:
            if player's balance is more than or equal to {@lapis2diamond}:
                send "{@prefix} You have upgraded your generator!"
                set block at event-location to diamond block
                remove {@lapis2diamond} from player's balance
                play sound "entity.experience_orb.pickup" with volume 10 and pitch 1 at player's location for player
            else:
                play sound "block.note_block.bass" with volume 10 and pitch 1 at player's location for player
                send "{@prefix} You need &a$%{@lapis2diamond}-player's balance% &7more to upgrade!"
        else if {_block} is diamond block:
            if player's balance is more than or equal to {@diamond2emerald}:
                send "{@prefix} You have upgraded your generator!"
                set block at event-location to emerald block
                remove {@diamond2emerald} from player's balance
                play sound "entity.experience_orb.pickup" with volume 10 and pitch 1 at player's location for player
            else:
                play sound "block.note_block.bass" with volume 10 and pitch 1 at player's location for player
                send "{@prefix} You need &a$%{@diamond2emerald}-player's balance% &7more to upgrade!"
        else if {_block} is emerald block:
            if player's balance is more than or equal to {@emerald2magma}:
                send "{@prefix} You have upgraded your generator!"
                set block at event-location to magma block
                remove {@emerald2magma} from player's balance
                play sound "entity.experience_orb.pickup" with volume 10 and pitch 1 at player's location for player
            else:
                play sound "block.note_block.bass" with volume 10 and pitch 1 at player's location for player
                send "{@prefix} You need &a$%{@emerald2magma}-player's balance% &7more to upgrade!"
        else if {_block} is magma block:
            if player's balance is more than or equal to {@magma2obsidian}:
                send "{@prefix} You have upgraded your generator!"
                set block at event-location to obsidian
                remove {@magma2obsidian} from player's balance
                play sound "entity.experience_orb.pickup" with volume 10 and pitch 1 at player's location for player
            else:
                play sound "block.note_block.bass" with volume 10 and pitch 1 at player's location for player
                send "{@prefix} You need &a$%{@magma2obsidian}-player's balance% &7more to upgrade!"
        else if {_block} is obsidian:
            if player's balance is more than or equal to {@obsidian2netherite}:
                send "{@prefix} You have upgraded your generator!"
                set block at event-location to netherite block
                remove {@obsidian2netherite} from player's balance
                play sound "entity.experience_orb.pickup" with volume 10 and pitch 1 at player's location for player
            else:
                play sound "block.note_block.bass" with volume 10 and pitch 1 at player's location for player
                send "{@prefix} You need &a$%{@obsidian2netherite}-player's balance% &7more to upgrade!"
        else if {_block} is netherite block:
            if player's balance is more than or equal to {@netherite2star}:
                send "{@prefix} You have upgraded your generator!"
                set block at event-location to beacon
                remove {@netherite2star} from player's balance
                play sound "entity.experience_orb.pickup" with volume 10 and pitch 1 at player's location for player
            else:
                play sound "block.note_block.bass" with volume 10 and pitch 1 at player's location for player
                send "{@prefix} You need &a$%{@netherite2star}-player's balance% &7more to upgrade!"
        else if {_block} is beacon:
            if player's balance is more than or equal to {@star2abyss}:
                send "{@prefix} You have upgraded your generator!"
                set block at event-location to purple glazed terracotta
                remove {@star2abyss} from player's balance
                play sound "entity.experience_orb.pickup" with volume 10 and pitch 1 at player's location for player
            else:
                play sound "block.note_block.bass" with volume 10 and pitch 1 at player's location for player
                send "{@prefix} You need &a$%{@star2abyss}-player's balance% &7more to upgrade!"
        else if {_block} is purple glazed terracotta:
            if player's balance is more than or equal to {@abyss2warped}:
                send "{@prefix} You have upgraded your generator!"
                set block at event-location to warped hyphae
                remove {@abyss2warped} from player's balance
                play sound "entity.experience_orb.pickup" with volume 10 and pitch 1 at player's location for player
            else:
                play sound "block.note_block.bass" with volume 10 and pitch 1 at player's location for player
                send "{@prefix} You need &a$%{@star2abyss}-player's balance% &7more to upgrade!"
        else if {_block} is warped hyphae:
            if player's balance is more than or equal to {@warped2twirled}:
                send "{@prefix} You have upgraded your generator!"
                set block at event-location to crimson hyphae
                remove {@warped2twirled} from player's balance
                play sound "entity.experience_orb.pickup" with volume 10 and pitch 1 at player's location for player
            else:
                play sound "block.note_block.bass" with volume 10 and pitch 1 at player's location for player
                send "{@prefix} You need &a$%{@star2abyss}-player's balance% &7more to upgrade!"
        else if {_block} is warped hyphae:
            send "{@prefix} Your gen is maxed!"
            play sound "block.note_block.bass" with volume 10 and pitch 1 at player's location for player

on block break:
    if "%region at event-block%" is not "mine":
        if block is hay block, pumpkin, melon, coal block, iron block, gold block, lapis block, redstone block, diamond block, emerald block, magma block, obsidian, beacon, purple glazed terracotta or netherite block:
            cancel event

Link to comment
Share on other sites

trash skript lol.. you could use so many less lines if you used functions but ehh the skript is bad in general

 

 

Edited by emopediaMC
  • Haha 1

Developer

 

Joined Minecraft in 2010 on PC

Joined Minehut in August 2016

1 year Skript experience

2 months Java experience

5 months Javascript experience

 

Link to comment
Share on other sites

I suggest putting the skripts into code blocks, much easier to read.

 

-----------------------------------------------------------

[MOD] - Azuyamat

----------------------------------------------------------

[VIP]

[PRO]

[EVENTS]

[TESTER]

[MOD] - March 18th 2023

----------------------------------------------------------

If you are as kind of a person to leave me a like on a comment or post then you are my friend!

 

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

🔐 Topic locked.

Please do not reply on threads that have been inactive for over a month.

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

---------------------------------------------------------

[VIP] - 7/27/2020

Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

---------------------------------------------------------

image.png.70849a9b84e0347ce107b8e3eaee312c.pngimage.png.2111009afbd8bef10966ba9ede35a199.png

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...