Does anyone know how to link variables/options to specific numbers?

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Mar 13, 2025
2
0
1
Im trying to make a custom enchant rather than using vanilla enchants for fortune. exp gain and block break.. does anyone know how to connect variables of text to specific numbers so the player can get the correct number of items per fortune? Is there then a way I can add math to the number variable to get alternate variables?

Code:
#Options:
    material.mine.stone: stone button named "&7Stone Chunk"
    material.mine.coal: coal named "&7Coal Chunk"
    material.mine.fossil: quartz named "&7Fossil"
    
    material.crop.desc: &8[&b&8] › &7Common Crop
    material.mine.desc: &8[&b&8] › &7Common Deposit
    material.fish.desc: &8[&b&8] › &7Common Catch
    material.combat.desc: &8[&b&8] › &7Common Loot
    
    add "&8[&7Mining Tool&8] &c &f&nI"
    &8[&7Mining Tool&8] &c &f&nII : 2 : {II}
    &8[&7Mining Tool&8] &c &f&nIII : 3 : {II}
    &8[&7Mining Tool&8] &c &f&nIV : 4 : {IV}
    &8[&7Mining Tool&8] &c &f&nV : 5 : {V}
    
    tier.null: &8[&7✦✦✦✦✦&8]
    tier.common: &8[&6✦&7✦✦✦✦&8]
    tier.uncommon: &8[&6✦✦&7✦✦✦&8]
    tier.rare: &8[&6✦✦✦&7✦✦&8]
    tier.reowned: &8[&6✦✦✦✦&7✦&8]
    tier.legendary: &8[&6✦✦✦✦&7✦&8]
    tier.titan: &8「&c✯&8」
    tier.cosmetic: &8[&d✦✦✦✦✦&8]
    
    icon.tool: &8[&7&6⛏&8]
    icon.material: &8[&b&8]
    icon.experience: &8[&7&a✨&8]
    
    
      
# MINING

command /pickaxe:
    description: Recieve another pickaxe. CD: 1 day.
    permission: lost.pickaxe
    executable by: players
    cooldown: a day
    cooldown storage: {hoe::%player's uuid%}
    cooldown message: These picks don't grow on trees! Try again %remaining time% later.
    cooldown bypass: hoe.infinity
    trigger:
        if the player has space for a wooden pickaxe:
            give 1 wooden pickaxe named "&8[&7Mining Tool&8] &c &f&nV" with the lore "{@icon.tool}&8 › &7Sturdy &8[&7I&8]", "{@icon.material}&8 › &7Fortune &8[&7I&8]" and "{@icon.experience}&8 › &7Mastery &8[&7{_0}&8]" to player
        else:
            send "You do not have enough space in your inventory to hold the wooden hoe!"
            cancel the cooldown

Variables:
    {tool.mining.level} =
    {material.mining.stone} = {tool.mining.level}
    {tool}.mining})
    {"&8[&7Mining Tool&8] &c &f&nI"} = {_0}
    {_0} = 1
    {"&8[&7Mining Tool&8] &c &f&nII"} = {_0}
    {_0} = 2
    {"&8[&7Mining Tool&8] &c &f&nIII"} = {_0}
    {_0} = 3
    {"&8[&7Mining Tool&8] &c &f&nIV"} = {_0}
    {_0} = 4
    {"&8[&7Mining Tool&8] &c &f&nV"} = {_0}
    {_0} = 5
    
on break of stone:
    cancel event
    if {})
    set event-block to stone
    if name of player's tool is "&8[&7Mining Tool&8] &c &f&nI", "&8[&7Mining Tool&8] &c &f&nII", "&8[&7Mining Tool&8] &c &f&nIII", "&8[&7Mining Tool&8] &c &f&nIV" or "&8[&7Mining Tool&8] &c &f&nV":
        if lore of item contains "{@icon.material}&8 › &7Fortune &8[&7I&8]":
            give player {_0} {@material.mine.stone} with lore "{@material.mine.desc}" and "{@tier.uncommon}"
        if lore of item contains "{@icon.material}&8 › &7Fortune &8[&7II&8]":
            give player {_0} {@material.mine.stone} with lore "{@material.mine.desc}" and "{@tier.uncommon}"
        if lore of item contains "{@icon.material}&8 › &7Fortune &8[&7III&8]":
            give player {_0} {@material.mine.stone} with lore "{@material.mine.desc}" and "{@tier.uncommon}"
        if lore of item contains "{@icon.material}&8 › &7Fortune &8[&7IV&8]":
            give player {_0} {@material.mine.stone} with lore "{@material.mine.desc}" and "{@tier.uncommon}"
        if lore of item contains "{@icon.material}&8 › &7Fortune &8[&7V&8]":
            give player {_0} {@material.mine.stone} with lore "{@material.mine.desc}" and "{@tier.uncommon}"