Help with custom pickaxe skript

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

lixciaxan

Member
Aug 28, 2023
4
0
1
19
options:
prefix: "&5&lZETHERIUM &8➠ &r"
starsvariable: {stars::%player's uuid%}
minerspickaxe: {pickaxe::item}

function upgradeCOST(p: player, enchant: string):
#Multiplier Enchant
if {_enchant} is "multiplier":
if {_enchlevel} < 5:
set {_cost} to (5000*{_enchlevel}+500)
set {_req} to ((2500*{_enchlevel})+2500)
set {pickaxe::upreq::multiplier::%{_p}'s uuid%} to {_req}
set {pickaxe::upcost::multiplier::%{_p}'s uuid%} to {_cost}

on join:
if {pickaxe::upgrades::multiplier::%player's uuid%} is not set:
set {pickaxe::upgrades::multiplier::%player's uuid%} to 0

upgradeCOST(player, "multiplier")

on load:
set {pickaxe::item} to netherite pickaxe named "&b&lMINERS PICKAXE" with lore "&7Core Tools"
loop all players:
set {pickaxe::upgrades::multiplier::%loop-player's uuid%} to 0
on right click:
if 1 of player's tool is {pickaxe::item}:
openPICKUPGRADEGUI(player)

function openPICKUPGRADEGUI(p: player):
set {_gui} to chest inventory with 5 rows named "Upgrades"
set slot (numbers between 0 and 45) of {_gui} to purple stained glass pane
set slot 10 of {_gui} to diamond named "&7MULTIPLIER" with lore "&7[%{pickaxe::upgrades::multiplier::%{_p}'s uuid%}%/5]" and "" and " ▋ &7Magically duplicates mine drops" and "" and "Costs: &6%{pickaxe::upcost::multiplier::%{_p}'s uuid%}%"
set slot 12 of {_gui} to tripwire hook named "test"
set slot 14 of {_gui} to sunflower
set slot 16 of {_gui} to ender chest
set slot 20 of {_gui} to experience bottle
set slot 24 of {_gui} to paper
set slot 40 of {_gui} to barrier named "&cEXIT (E)"
open {_gui} to {_p}

on inventory click:
name of event-inventory is "Upgrades"
cancel event
event-inventory is not player's inventory
if clicked slot is 10:
if {pickaxe::upgrades::multiplier::%player's uuid%} <= 5:
broadcast "x"
#if {stars::%player's uuid%} >= {pickaxe::upcost::multiplier::%player's uuid%}:
#broadcast "x2"
if {blocksmined::%player's uuid%} <= {pickaxe::upreq::multiplier::%player's uuid%}:
broadcast "x3"

remove {pickaxe::upcost::multiplier::%player's uuid%} from {credits::%player's uuid%}
add 1 to {pickaxe::upgrades::multiplier::%player's uuid%}
upgradeCOST(player,"multiplier")
send "You have upgraded multiplier"
else:
send "You dont meet the requirements"
else:
send "Max Level"
if clicked slot is 12:
send "You clicked on slot 12"
if clicked slot is 14:
send "You clicked on slot 14"
if clicked slot is 16:
send "You clicked on slot 16"
if clicked slot is 20:
send "You clicked on slot 20"
if clicked slot is 24:
send "You clicked on slot 24"
if clicked slot is 40:
close player's inventory

on item damage:
if 1 of player's tool is {pickaxe::item}:
cancel event



#Commands
command /upgrade:
trigger:
if 1 of player's tool is {pickaxe::item}:
openPICKUPGRADEGUI(player)
else:
send "%{@prefix}%&cPlease hold the &b&lMINERS PICKAXE &cbefore executing"

command /givepickaxe:
permission: op
trigger:
give player {pickaxe::item}
 
The
if clicked slot is 10:
if {pickaxe::upgrades::multiplier::%player's uuid%} <= 5:
broadcast "x"
#if {stars::%player's uuid%} >= {pickaxe::upcost::multiplier::%player's uuid%}:
#broadcast "x2"
if {blocksmined::%player's uuid%} <= {pickaxe::upreq::multiplier::%player's uuid%}:
broadcast "x3"
part only displays "x" despite all conditions being met
Apologies for not using code blocks I got no clue how to make one
 
The
if clicked slot is 10:
if {pickaxe::upgrades::multiplier::%player's uuid%} <= 5:
broadcast "x"
#if {stars::%player's uuid%} >= {pickaxe::upcost::multiplier::%player's uuid%}:
#broadcast "x2"
if {blocksmined::%player's uuid%} <= {pickaxe::upreq::multiplier::%player's uuid%}:
broadcast "x3"
part only displays "x" despite all conditions being met
Apologies for not using code blocks I got no clue how to make one
First off, let me show you how to use a code block.
Code:
this is a code block.
 

Attachments

  • Screenshot_20230905-192715~2.png
    Screenshot_20230905-192715~2.png
    103.9 KB · Views: 56
Second, once you use an if: , the next time you call an if: at the same indent, you would need to call it else if: . For example:

Code:
if: [dependency]
    [code]
else if: [another dependency]
    [more code]
 
The
if clicked slot is 10:
if {pickaxe::upgrades::multiplier::%player's uuid%} <= 5:
broadcast "x"
#if {stars::%player's uuid%} >= {pickaxe::upcost::multiplier::%player's uuid%}:
#broadcast "x2"
if {blocksmined::%player's uuid%} <= {pickaxe::upreq::multiplier::%player's uuid%}:
broadcast "x3"
part only displays "x" despite all conditions being met
Apologies for not using code blocks I got no clue how to make one
hey i also if you want i have a auto block auto pickup and autosmelt script all in one that i use
edit: sry but uh the auto block thing only works with a certain pickaxe which you do /autopickaxe [player] but if the "[player]" is left blank it gives it to you
 
hey i also if you want i have a auto block auto pickup and autosmelt script all in one that i use
edit: sry but uh the auto block thing only works with a certain pickaxe which you do /autopickaxe [player] but if the "[player]" is left blank it gives it to you
The point isn't to spoonfeed code. Explain how to fix the problem, then show how to fix it. If they just copy over the code and don't take the time to understand it, that's their fault. However, if you just spoonfeed code, they aren't learning anything.
 
The point isn't to spoonfeed code. Explain how to fix the problem, then show how to fix it. If they just copy over the code and don't take the time to understand it, that's their fault. However, if you just spoonfeed code, they aren't learning anything.
I learned by just spoon feeding me and well now to be fair I'm pretty good.
 
I learned by just spoon feeding me and well now to be fair I'm pretty good.
Not all people learn like that. I try to tell people step by step while giving examples, scenarios, etc. If you spoonfeed, they might not learn anything amd are just leeching off of other's code.
 
Not all people learn like that. I try to tell people step by step while giving examples, scenarios, etc. If you spoonfeed, they might not learn anything amd are just leeching off of other's code.
Welllllllllllllllllllllllllllllll my script is also going public soon and idk how to explain how I changed it if I just copy another script I made
 
Welllllllllllllllllllllllllllllll my script is also going public soon and idk how to explain how I changed it if I just copy another script I made
Well, that's nice, but they asked you to fix the issue, not make code for them.
 
hey i also if you want i have a auto block auto pickup and autosmelt script all in one that i use
edit: sry but uh the auto block thing only works with a certain pickaxe which you do /autopickaxe [player] but if the "[player]" is left blank it gives it to you
this skript does it as well anyways lmao, but i fixed this shit a long time ago