Jump to content

Enchant Skript Not Working Right


Narratrr

Recommended Posts

Okay, so I have this skript right here, and i tried to set it so that if u tried to upgrade your pickaxe past efficiency 6 it wouldn't work but it still allowed you to go past efficiency 6, also I cant seem t get it to take tokens from your token balance and it cant seem to understand the code

        if token balance is greater than 9999:
            execute console command "token take %player% 10000"

If someone could help fix this I would greatly appreciate! 😄


command /efficiency [<text>]:
    permission: efficiency.enchant
    permission message: [&c&l&!&f] You don't have permission
    trigger:
        if arg 1 is not set:
            if level of efficiency of player's tool is greater than or equal to 6:
                send "Youre too high!"
            if {wait.%player%} does not exist:
                set {wait.%player%} to false
            if {wait.%player%} is true:
                wait 3 ticks
            enchant the tool with "efficiency %level of efficiency of the tool + 1%" parsed as enchantment type
        if token balance is greater than 9999:
            execute console command "token take %player% 10000"
            message "&7Efficiency &chas now been applied on your Pickaxe!"
        else:
            message "&cYou don't have enough Tokens to apply &7Efficiency 6 &con your Pickaxe! You need &f10000&c!"

Edited by LastMC

IGN: LastMC

Discord: LastXD#7171

Rank: PRO

Join date: Monday - December - 23rd - 2019

Link to comment
Share on other sites

29 minutes ago, LastMC said:

Okay, so I have this skript right here, and i tried to set it so that if u tried to upgrade your pickaxe past efficiency 6 it wouldn't work but it still allowed you to go past efficiency 6, also I cant seem t get it to take tokens from your token balance and it cant seem to understand the code

        if token balance is greater than 9999:
            execute console command "token take %player% 10000"

If someone could help fix this I would greatly appreciate! 😄


command /efficiency [<text>]:
    permission: efficiency.enchant
    permission message: [&c&l&!&f] You don't have permission
    trigger:
        if arg 1 is not set:
            if level of efficiency of player's tool is greater than or equal to 6:
                send "Youre too high!"
            if {wait.%player%} does not exist:
                set {wait.%player%} to false
            if {wait.%player%} is true:
                wait 3 ticks
            enchant the tool with "efficiency %level of efficiency of the tool + 1%" parsed as enchantment type
        if token balance is greater than 9999:
            execute console command "token take %player% 10000"
            message "&7Efficiency &chas now been applied on your Pickaxe!"
        else:
            message "&cYou don't have enough Tokens to apply &7Efficiency 6 &con your Pickaxe! You need &f10000&c!"

try "if player's balance" if you're using vault

Edited by AgentGamerPro

 

 

image.png.bc433d6489d70ad831075fe76809b993.png
 

Owner of Lifestealed, Exploratory, Encore, UNOfficially and Observed
 

OG [VIP] 12/26/20 - 10/27/2021
OG [PRO] 12/27/21 - 11/18/2022
OG [LEGEND] 11/18/2022 - 3/14/2023
[DEFAULT] 3/14/2023 - 5/8/2024

[MOD] 5/8/2024 - Present

 

Link to comment
Share on other sites

6 hours ago, LastMC said:

execute console command "token take %player% 10000"

you forgot to add a "/"

also, can you tell me the following:

a) the variable you used to set or change a player's tokens

b) with [<text>] you are using on the /efficiency command, what is the [<text>] going to be used for? cause currently it has no use at all.

EDIT: Also, you are checking for the player's tokens after you enchanted. Make sure to put that first and put the rest of the code in an "else:" section

Edited by BanditEagle

If I have helped you out in your post or you liked what I posted, please upvote and react to my post! It helps me a lot!

Some Minehut Links:

Server Rules • Staff Applications • News & Updates • Reports • Appeals


Minehut: VIP (07/04/2021 --> Current)
Elestra/Versa Realms: Manager (12/04/2021 --> Current)

If you have any questions contact me!
My Discord: BanditEagle#2481
My Spigot Profile: https://www.spigotmc.org/members/banditeagle.935281/
My IGN: BanditEagle

Link to comment
Share on other sites

okay thanks for the advice  and ill take note to it, but i dont undertsand what u mean by 

a) the variable you used to set or change a player's tokens

b) with [<text>] you are using on the /efficiency command, what is the [<text>] going to be used for? cause currently it has no use at all.

IGN: LastMC

Discord: LastXD#7171

Rank: PRO

Join date: Monday - December - 23rd - 2019

Link to comment
Share on other sites

1 hour ago, LastMC said:

a) the variable you used to set or change a player's tokens

Currently you have this:

if token balance is greater than 9999:

however, there is no such thing as "token balance" in skript. You will need to use a variable which you change the value of in order to look for if a player has a specific amount or higher, such as:

{tokenBalance::%uuid of player%}

and will need to change the value of this whenver you want to add/remove/set the balance to a specific value. And to check if it is greater than 9999, you can do:

if {tokenBalance::%uuid of player%} >= 10000:

 

1 hour ago, LastMC said:

b) with [<text>] you are using on the /efficiency command, what is the [<text>] going to be used for? cause currently it has no use at all.

in the command, you have set it to be the following:

/efficiency [<text>]

where [<text>] will need to have some sort of input. However, you are not using the argument you are setting in the command, so I am asking how you are thinking of using it.

Hope this is a bit clearer!

If I have helped you out in your post or you liked what I posted, please upvote and react to my post! It helps me a lot!

Some Minehut Links:

Server Rules • Staff Applications • News & Updates • Reports • Appeals


Minehut: VIP (07/04/2021 --> Current)
Elestra/Versa Realms: Manager (12/04/2021 --> Current)

If you have any questions contact me!
My Discord: BanditEagle#2481
My Spigot Profile: https://www.spigotmc.org/members/banditeagle.935281/
My IGN: BanditEagle

Link to comment
Share on other sites

ty my guy, im still kinda new to skript so thanks. also im using it as like if someone wants insta mine they can upgrade from eff 5 - eff 6 but not past that

 

Edited by LastMC

IGN: LastMC

Discord: LastXD#7171

Rank: PRO

Join date: Monday - December - 23rd - 2019

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...