Issues with a Pickaxe Upgrade Skipt

  • 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!

Status
Not open for further replies.

Put

New Member
Aug 7, 2021
7
0
1
23
Hi!
I've been troubleshooting this skript for quite a while now and can't seem to get the items in the menu to show up. Any help would be appreciated, thanks!

Code:
Code:
command /upgrade:
    cooldown: 1 second
    cooldown message: &cSlow Down!
    trigger:
        if player is holding stone pickaxe:
            open chest with 3 rows named "Pickaxe Upgrade" to player
            wait 1 tick
            format gui slot 10 of player with prismarine shard named "&e&lENCHANT: &fEfficiency" with lore "&e- &f&oAbility To Break Blocks Faster" and "&r" and "&e- &fCost &e$200" and "&e- &fMax: &e5" to run:
                set {_i} to level of efficiency of {_p}'s tool
                set {_i} to 0 if {_i} is not set
                if {_i} < 10:
                    if {_p}'s balance >= 200:
                        remove 200 from {_p}'s balance
                        enchant {_p}'s held item with "efficiency %level of efficiency of tool + 1%" parsed as enchantment type
                        set line 3 of lore of player's tool to "&e&l| &fEfficiency: &f%level of efficiency of tool%"
                        send "&a&l[!] &aUpgraded Efficiency Level" to {_p}
                    else:
                        send "&c&l[!] &cInsufficent Funds" to {_p}
                else:
                    send "&c&l[!] &cMax Level Reached" to {_p}
        else:
            send "&fHold The default pickaxe"
 
Hi!
I've been troubleshooting this skript for quite a while now and can't seem to get the items in the menu to show up. Any help would be appreciated, thanks!

Code:
Code:
command /upgrade:
    cooldown: 1 second
    cooldown message: &cSlow Down!
    trigger:
        if player is holding stone pickaxe:
            open chest with 3 rows named "Pickaxe Upgrade" to player
            wait 1 tick
            format gui slot 10 of player with prismarine shard named "&e&lENCHANT: &fEfficiency" with lore "&e- &f&oAbility To Break Blocks Faster" and "&r" and "&e- &fCost &e$200" and "&e- &fMax: &e5" to run:
                set {_i} to level of efficiency of {_p}'s tool
                set {_i} to 0 if {_i} is not set
                if {_i} < 10:
                    if {_p}'s balance >= 200:
                        remove 200 from {_p}'s balance
                        enchant {_p}'s held item with "efficiency %level of efficiency of tool + 1%" parsed as enchantment type
                        set line 3 of lore of player's tool to "&e&l| &fEfficiency: &f%level of efficiency of tool%"
                        send "&a&l[!] &aUpgraded Efficiency Level" to {_p}
                    else:
                        send "&c&l[!] &cInsufficent Funds" to {_p}
                else:
                    send "&c&l[!] &cMax Level Reached" to {_p}
        else:
            send "&fHold The default pickaxe"
Which addon are you using for the gui?
 
Hi!
I've been troubleshooting this skript for quite a while now and can't seem to get the items in the menu to show up. Any help would be appreciated, thanks!

Code:
Code:
command /upgrade:
    cooldown: 1 second
    cooldown message: &cSlow Down!
    trigger:
        if player is holding stone pickaxe:
            open chest with 3 rows named "Pickaxe Upgrade" to player
            wait 1 tick
            format gui slot 10 of player with prismarine shard named "&e&lENCHANT: &fEfficiency" with lore "&e- &f&oAbility To Break Blocks Faster" and "&r" and "&e- &fCost &e$200" and "&e- &fMax: &e5" to run:
                set {_i} to level of efficiency of {_p}'s tool
                set {_i} to 0 if {_i} is not set
                if {_i} < 10:
                    if {_p}'s balance >= 200:
                        remove 200 from {_p}'s balance
                        enchant {_p}'s held item with "efficiency %level of efficiency of tool + 1%" parsed as enchantment type
                        set line 3 of lore of player's tool to "&e&l| &fEfficiency: &f%level of efficiency of tool%"
                        send "&a&l[!] &aUpgraded Efficiency Level" to {_p}
                    else:
                        send "&c&l[!] &cInsufficent Funds" to {_p}
                else:
                    send "&c&l[!] &cMax Level Reached" to {_p}
        else:
            send "&fHold The default pickaxe"
I don't usually work with tuske https://docs.skunity.com/syntax/search/id:3411 I don't see a "run:" do you get any errors?
 
nvm I'm using skrayfall for the menus there are no errors
I looked in the docs of skrayfall, can't find the format in docs, so I'm just going to suggest using another addon, or you could use vanilla skript, although i don't know if it would work with your version here is what I use:
Code:
function openGui(p: player):
    set metadata tag "Gui" of {_p} to chest inventory with 1 row named "Upgrades"
    set slot 0 of metadata tag "Gui" of {_p} to chest named "&5&lEnchant" with lore "&7click to view ranks"
    open (metadata tag "Gui" of {_p}) to {_p}
You don't have to use a function just replace {_p} with player if its not a function, here is how to check when the player clicks the slot
Code:
on inventory click:
    if event-inventory = (metadata tag "Gui" of player):
        if index of event-slot is 0: #slot number
            #Your code here when he clicks on the slot
this is vanilla skript, doesn't require any addons
 
I looked in the docs of skrayfall, can't find the format in docs, so I'm just going to suggest using another addon, or you could use vanilla skript, although i don't know if it would work with your version here is what I use:
Code:
function openGui(p: player):
    set metadata tag "Gui" of {_p} to chest inventory with 1 row named "Upgrades"
    set slot 0 of metadata tag "Gui" of {_p} to chest named "&5&lEnchant" with lore "&7click to view ranks"
    open (metadata tag "Gui" of {_p}) to {_p}
You don't have to use a function just replace {_p} with player if its not a function, here is how to check when the player clicks the slot
Code:
on inventory click:
    if event-inventory = (metadata tag "Gui" of player):
        if index of event-slot is 0: #slot number
            #Your code here when he clicks on the slot
this is vanilla skript, doesn't require any addons
Cool Thanks I'll try this out
 
Cool Thanks I'll try this out
Also a little thing i forgot
Code:
on inventory click:
    if event-inventory = (metadata tag "Gui" of player):
        cancel event
        if index of event-slot is 0: #slot number
add a 'cancel event' like where i did, so players can't steal the item
 
Status
Not open for further replies.