Jump to content

Skript does not work


BOXEY

Recommended Posts

So my /sell skript does not work it does not give them the money or say the money them got

 

Please Help

 

 

on load:
    clear {sell::*}
    clear {price::*}
    
    set {sell::coal} to coal named "&7Coal &8(&eRight click&8)"

    set {price::coal} to 5


options:
    prefix: &6Money &7>>
    sellout: &6Sell &7>>


command /sellop:
    trigger:
        loop {sell::*}:
            set {_items} to loop-value
            set {_amount} to number of {_items} in player's inventory
            if {_amount} is more than or equal to 0:
                remove {_amount} of {_items} from player's inventory
                set {_block} to "%loop-value%"
                set {_g} to (({_amount} * {price::%{_block}%}) * ({%uuid of player%::booster} + 1))
                add {_amount} to {Totali}
                add {_g} to  {_TotalAmount}
            if {_TotalAmount} is more than 0:
                send "{@prefix} You Sold All Your Items For %{_TotalAmount}%"
                add {_TotalAmount} to {bal::%player%}
            else:
                send "{@sellout} No Items To Sell"

 

Link to comment
Share on other sites

6 hours ago, ReportCards said:

Have you tried putting in debug messages? Where does it stop at? What is the reason of the issues?

there is no error it does not give the player the money they got but it takes the items they are selling

Link to comment
Share on other sites

55 minutes ago, Boxmonkey said:

there is no error it does not give the player the money they got but it takes the items they are selling

I see the reason now, try replacing 

set {_block} to "%loop-value%"

with

set {_block} to "%loop-index%"

Because using loop-value will return something like "coal named 'name here'" and not just "coal", but since the loop index is just "coal" it should work just fine

  • Like 1

Zora

💬 » Discord: @reportcards

 

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...