Solved Variable Wont Update

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

Mattllama987

Active Member
Aug 5, 2018
225
7
18
24
Hello, im working on a fishing skript, and im a little stuck on something. I have the skript working fine with no errors. But im stuck on a little part. Im trying to add some more fish i added into the skript. But when i add the "Common Herring" fish, it will add $10 to the var and it will update and show the correct amount. But when i add the "Common Crab" fish, it should add $100 to the var. But it only says it adds 10 to the var. But when i sell the Crab by its self, it shows there is $10 in the var, but when i sell it, it shows the correct msg with the correct money amount. The $100. But it should be adding $100 to the var.

the common herring is $10 and the common crab is $100

Skript version:
2.4

Server Version:
1.14.4

Code:
function commonherring(P: player):
    set {temp::%{_P}%} to true
    set {_m} to 0
    set {_a} to 0
    open chest with 4 rows named "&bMr. Boatwright" to {_P}
    format gui slot 27, 28, 29, 30, 32, 33, 34 and 35 of {_P} with green stained glass pane named ""
    while {temp::%{_P}%} is true:
        set {_f} to amount of raw cod in {_P}'s current inventory
        set {_m} to {_f} * 10.00
        format gui slot 31 of {_P} with diamond named "&aSell for: &a$&a%{_m}%" with lore "&bAmount of fish: %{_f}%" to run:
            add ({_f} * 10.00) to {_m}
            set {_m} to {_f} * 10.00
            loop all items in {_P}'s current inventory:
                if name of loop-value contains "&7Common Herring":
                    if line 1 of lore of loop-value contains "&8* &aSize":
                        add ({_f} * 10.00) to balance of {_P}
                        send "&b[Mr. Boatwright] &7You sold all your fish for &a$%{_m}%" to {_P}
                        close {_P}'s inventory
                        stop
                else if name of loop-value contains "&7Common Crab":
                    while {temp::%{_P}%} is true:
                        add ({_f} * 100.00) to {_m}
                        set {_m} to {_f} * 100.00
                        loop all items in {_P}'s current inventory:
                            if name of loop-value-2 contains "&7Common Crab":
                                if line 1 of lore of loop-value-2 contains "&8* &aSize":
                                    add ({_f} * 100.00) to balance of {_P}
                                    send "&b[Mr. Boatwright] &7You sold all your fish for &a$%{_m}%" to {_P}
                                    close {_P}'s inventory
                                    stop
                        wait 1 ticks
        wait 1 ticks
[doublepost=1583783636,1583687219][/doublepost]bump
 
Hello, im working on a fishing skript, and im a little stuck on something. I have the skript working fine with no errors. But im stuck on a little part. Im trying to add some more fish i added into the skript. But when i add the "Common Herring" fish, it will add $10 to the var and it will update and show the correct amount. But when i add the "Common Crab" fish, it should add $100 to the var. But it only says it adds 10 to the var. But when i sell the Crab by its self, it shows there is $10 in the var, but when i sell it, it shows the correct msg with the correct money amount. The $100. But it should be adding $100 to the var.

the common herring is $10 and the common crab is $100

Skript version:
2.4

Server Version:
1.14.4

Code:
function commonherring(P: player):
    set {temp::%{_P}%} to true
    set {_m} to 0
    set {_a} to 0
    open chest with 4 rows named "&bMr. Boatwright" to {_P}
    format gui slot 27, 28, 29, 30, 32, 33, 34 and 35 of {_P} with green stained glass pane named ""
    while {temp::%{_P}%} is true:
        set {_f} to amount of raw cod in {_P}'s current inventory
        set {_m} to {_f} * 10.00
        format gui slot 31 of {_P} with diamond named "&aSell for: &a$&a%{_m}%" with lore "&bAmount of fish: %{_f}%" to run:
            add ({_f} * 10.00) to {_m}
            set {_m} to {_f} * 10.00
            loop all items in {_P}'s current inventory:
                if name of loop-value contains "&7Common Herring":
                    if line 1 of lore of loop-value contains "&8* &aSize":
                        add ({_f} * 10.00) to balance of {_P}
                        send "&b[Mr. Boatwright] &7You sold all your fish for &a$%{_m}%" to {_P}
                        close {_P}'s inventory
                        stop
                else if name of loop-value contains "&7Common Crab":
                    while {temp::%{_P}%} is true:
                        add ({_f} * 100.00) to {_m}
                        set {_m} to {_f} * 100.00
                        loop all items in {_P}'s current inventory:
                            if name of loop-value-2 contains "&7Common Crab":
                                if line 1 of lore of loop-value-2 contains "&8* &aSize":
                                    add ({_f} * 100.00) to balance of {_P}
                                    send "&b[Mr. Boatwright] &7You sold all your fish for &a$%{_m}%" to {_P}
                                    close {_P}'s inventory
                                    stop
                        wait 1 ticks
        wait 1 ticks
[doublepost=1583783636,1583687219][/doublepost]bump

Why are u using while loops? I think the while loops are not stopped properly causing them to keep running and mess with next triggers.
[doublepost=1583924930][/doublepost]
Hello, im working on a fishing skript, and im a little stuck on something. I have the skript working fine with no errors. But im stuck on a little part. Im trying to add some more fish i added into the skript. But when i add the "Common Herring" fish, it will add $10 to the var and it will update and show the correct amount. But when i add the "Common Crab" fish, it should add $100 to the var. But it only says it adds 10 to the var. But when i sell the Crab by its self, it shows there is $10 in the var, but when i sell it, it shows the correct msg with the correct money amount. The $100. But it should be adding $100 to the var.

the common herring is $10 and the common crab is $100

Skript version:
2.4

Server Version:
1.14.4

Code:
function commonherring(P: player):
    set {temp::%{_P}%} to true
    set {_m} to 0
    set {_a} to 0
    open chest with 4 rows named "&bMr. Boatwright" to {_P}
    format gui slot 27, 28, 29, 30, 32, 33, 34 and 35 of {_P} with green stained glass pane named ""
    while {temp::%{_P}%} is true:
        set {_f} to amount of raw cod in {_P}'s current inventory
        set {_m} to {_f} * 10.00
        format gui slot 31 of {_P} with diamond named "&aSell for: &a$&a%{_m}%" with lore "&bAmount of fish: %{_f}%" to run:
            add ({_f} * 10.00) to {_m}
            set {_m} to {_f} * 10.00
            loop all items in {_P}'s current inventory:
                if name of loop-value contains "&7Common Herring":
                    if line 1 of lore of loop-value contains "&8* &aSize":
                        add ({_f} * 10.00) to balance of {_P}
                        send "&b[Mr. Boatwright] &7You sold all your fish for &a$%{_m}%" to {_P}
                        close {_P}'s inventory
                        stop
                else if name of loop-value contains "&7Common Crab":
                    while {temp::%{_P}%} is true:
                        add ({_f} * 100.00) to {_m}
                        set {_m} to {_f} * 100.00
                        loop all items in {_P}'s current inventory:
                            if name of loop-value-2 contains "&7Common Crab":
                                if line 1 of lore of loop-value-2 contains "&8* &aSize":
                                    add ({_f} * 100.00) to balance of {_P}
                                    send "&b[Mr. Boatwright] &7You sold all your fish for &a$%{_m}%" to {_P}
                                    close {_P}'s inventory
                                    stop
                        wait 1 ticks
        wait 1 ticks
[doublepost=1583783636,1583687219][/doublepost]bump
Code:
function sellherring(p: player, sell: boolean):
    set {_totalprice} to 0
    set {_totalfish} to 0
    loop all items in {_P}'s current inventory:
        if loop-value is raw cod, raw salmon or pufferfish:
            set {_worth} to 0
            set {_size} to line 1 of lore of loop-value #U MIGHT NEED TO CHANGE THIS BC IDK WHAT UR LORE IS
            set {_s::*} to {_size} split at "&aSize " #U MIGHT NEED TO CHANGE THIS BC IDK WHAT UR LORE IS
            set {_size} to {_s::2} parsed as a integer #U MIGHT NEED TO CHANGE THIS BC IDK WHAT UR LORE IS
            if name of loop-value contains "&7Common Herring":
                set {_minworth} to 10
                set {_sizeinc} to 1 #1$ for size 1 2$ for size 2
                if {_size} > 0:
                    add {_minworth} + ({_sizeinc}*{_size}) to {_worth}
                add 1 to {_totalfish}
                if {_sell} is true:
                    remove loop-value from {_p}               
            else if name of loop-value contains "&7Common Crab":
                set {_minworth} to 100
                set {_sizeinc} to 10 #10$ for size 1 20$ for size 2
                if {_size} > 0:
                    add {_minworth} + ({_sizeinc}*{_size}) to {_worth}
                add 1 to {_totalfish}
                if {_sell} is true:
                    remove loop-value from {_p}   
            add {_worth} to {_totalprice}
    
    if {_sell} is true:
        add {_totalprice} to balance of {_P}
        send "&b[Mr. Boatwright] &7You sold all your fish for &a$%{_totalprice}%" to {_P}
        close {_P}'s inventory
        stop                   

    format gui slot 31 of {_P} with diamond named "&aSell for: &a$&a%{_TotalPrice_Cod}%" with lore "&bAmount of fish: %{_totalfish}%" to run:
        sellherring({_p}, true)

function openherring(p: player):
    open chest with 4 rows named "&bMr. Boatwright" to {_p}
    format gui slot 27, 28, 29, 30, 32, 33, 34 and 35 of {_p} with green stained glass pane named ""
    sellherring({_p}, false)
 
Why are u using while loops? I think the while loops are not stopped properly causing them to keep running and mess with next triggers.
[doublepost=1583924930][/doublepost]
Code:
function sellherring(p: player, sell: boolean):
    set {_totalprice} to 0
    set {_totalfish} to 0
    loop all items in {_P}'s current inventory:
        if loop-value is raw cod, raw salmon or pufferfish:
            set {_worth} to 0
            set {_size} to line 1 of lore of loop-value #U MIGHT NEED TO CHANGE THIS BC IDK WHAT UR LORE IS
            set {_s::*} to {_size} split at "&aSize " #U MIGHT NEED TO CHANGE THIS BC IDK WHAT UR LORE IS
            set {_size} to {_s::2} parsed as a integer #U MIGHT NEED TO CHANGE THIS BC IDK WHAT UR LORE IS
            if name of loop-value contains "&7Common Herring":
                set {_minworth} to 10
                set {_sizeinc} to 1 #1$ for size 1 2$ for size 2
                if {_size} > 0:
                    add {_minworth} + ({_sizeinc}*{_size}) to {_worth}
                add 1 to {_totalfish}
                if {_sell} is true:
                    remove loop-value from {_p}              
            else if name of loop-value contains "&7Common Crab":
                set {_minworth} to 100
                set {_sizeinc} to 10 #10$ for size 1 20$ for size 2
                if {_size} > 0:
                    add {_minworth} + ({_sizeinc}*{_size}) to {_worth}
                add 1 to {_totalfish}
                if {_sell} is true:
                    remove loop-value from {_p}  
            add {_worth} to {_totalprice}
   
    if {_sell} is true:
        add {_totalprice} to balance of {_P}
        send "&b[Mr. Boatwright] &7You sold all your fish for &a$%{_totalprice}%" to {_P}
        close {_P}'s inventory
        stop                  

    format gui slot 31 of {_P} with diamond named "&aSell for: &a$&a%{_TotalPrice_Cod}%" with lore "&bAmount of fish: %{_totalfish}%" to run:
        sellherring({_p}, true)

function openherring(p: player):
    open chest with 4 rows named "&bMr. Boatwright" to {_p}
    format gui slot 27, 28, 29, 30, 32, 33, 34 and 35 of {_p} with green stained glass pane named ""
    sellherring({_p}, false)
Thank you very much for getting back with me. But when i place a common herring in the GUI, it wont update and show how many fish are in the GUI. It just says 0.


Code:
on right click on entity:
    if name of clicked entity contains "&bMr. Boatwright":
        openherring(player)
function sellherring(p: player, sell: boolean):
    set {_totalprice} to 0
    set {_totalfish} to 0
    loop all items in {_P}'s current inventory:
        if loop-value is raw cod, raw salmon or pufferfish:
            set {_worth} to 0
            set {_size} to line 1 of lore of loop-value #U MIGHT NEED TO CHANGE THIS BC IDK WHAT UR LORE IS
            set {_s::*} to {_size} split at "&8* &aSize" #U MIGHT NEED TO CHANGE THIS BC IDK WHAT UR LORE IS
            set {_size} to {_s::2} parsed as a integer #U MIGHT NEED TO CHANGE THIS BC IDK WHAT UR LORE IS
            if name of loop-value contains "&7Common Herring":
                set {_minworth} to 10
                set {_sizeinc} to 1 #1$ for size 1 2$ for size 2
                if {_size} > 0:
                    add {_minworth} + ({_sizeinc}*{_size}) to {_worth}
                add 1 to {_totalfish}
                if {_sell} is true:
                    remove loop-value from {_p}             
            else if name of loop-value contains "&7Common Crab":
                set {_minworth} to 100
                set {_sizeinc} to 10 #10$ for size 1 20$ for size 2
                if {_size} > 0:
                    add {_minworth} + ({_sizeinc}*{_size}) to {_worth}
                add 1 to {_totalfish}
                if {_sell} is true:
                    remove loop-value from {_p} 
            add {_worth} to {_totalprice}
  
    if {_sell} is true:
        add {_totalprice} to balance of {_P}
        send "&b[Mr. Boatwright] &7You sold all your fish for &a$%{_totalprice}%" to {_P}
        close {_P}'s inventory
        stop                 
 
    format gui slot 31 of {_P} with diamond named "&aSell for: &a$&a%{_TotalPrice_Cod}%" with lore "&bAmount of fish: %{_totalfish}%" to run:
        sellherring({_p}, true)
 
function openherring(p: player):
    open chest with 4 rows named "&bMr. Boatwright" to {_p}
    format gui slot 27, 28, 29, 30, 32, 33, 34 and 35 of {_p} with green stained glass pane named ""
    sellherring({_p}, false)
 
Need more info about what lores and names the items have and what item types there are?
My bad :emoji_slight_smile: But the name of the common herring is: "&7Common Herring" and the crab is "&7Common Crab" and the lore is this:
Code:
"&8* &aSize: %{_var}%cm" and "&b* &7Caught By %{_P}%"
 
My bad :emoji_slight_smile: But the name of the common herring is: "&7Common Herring" and the crab is "&7Common Crab" and the lore is this:
Code:
"&8* &aSize: %{_var}%cm" and "&b* &7Caught By %{_P}%"

Sry i totaly missunderstood what it needed to do gonna make a fix without while loops now
[doublepost=1584009493,1583998228][/doublepost]
My bad :emoji_slight_smile: But the name of the common herring is: "&7Common Herring" and the crab is "&7Common Crab" and the lore is this:
Code:
"&8* &aSize: %{_var}%cm" and "&b* &7Caught By %{_P}%"
Code:
function getWorthOfFish(i: item) :: number:
    if name of {_i} contains "&7Common Herring":
        return 10
    else if name of {_i} contains "&7Common Crab":
        return 100
    else:
        return 0

#Bonus money u get wenn a fish has a bigger size than 1.
# Example:
#     Inc value = 1$:
#         size = 1 = 1$
#         size = 1.5 = 1.5$
#         size = 3 = 3$
#     Inc value = 2.5$:   
#         size = 1 = 2.5$
#         size = 1.5 = 3.75$
#         size = 3 = 7.5$
function getSizeIncrease(i: item, s: number) :: number:
    if name of {_i} contains "&7Common Herring":
        return (1 * {_s})
    else if name of {_i} contains "&7Common Crab":
        return (10 * {_s})
    else:
        return 0

function getSize(i: item) :: number:
    set {_s} to line 1 of lore of {_i}
    set {_s::*} to {_s} split at "&8* &aSize: "
    set {_s} to {_s::2}
    replace every "cm" with "" in {_s}
    set {_s} to {_s} parsed as a number
    return {_s}
    
function getPriceOfFish(i: items) :: number:
    set {_t} to 0
    loop {_i::*}:
        delete {_p::*}
        set {_p::w} to getWorthOfFish(loop-value)
        set {_p::s} to getSize(loop-value)
        set {_p::i} to getSizeIncrease(loop-value,{_p::s})
        set {_p::p} to {_p::w} + {_p::i}
        add {_p::p} to {_t}
    return {_t}

function getFish(p: player) :: items:
    loop all items in {_p}'s current inventory:
        if loop-value is raw cod, raw salmon or pufferfish:
            if name of loop-value contains "&7Common Herring" or "&7Common Crab":
                add loop-value to {_fish::*}
    return {_fish::*}

function getLatestPrice(i: item) :: number:
    set {_p} to name of {_i}
    replace every "&aSell for: &a$&a" with "" in {_p}
    set {_p} to {_p} parsed as a number
    return {_p}

function updateFishPrice(p: player):
    set {_fish::*} to getFish({_p})
    set {_fishamount} to size of {_fish::*}
    set {_totalprice} to getPriceOfFish({_fish::*})
    set name of slot 31 of {_p}'s current inventory to "&aSell for: &a$&a%{_totalprice}%"
    set line 1 of lore of slot 31 of {_p}'s current inventory to "&bAmount of fish: %{_fishamount}%"

function sellFish(p: player, i: item):
    set {_fish::*} to getFish({_p})
    set {_fishamount} to size of {_fish::*}
    set {_totalprice} to getPriceOfFish({_fish::*})
    set {_latestprice} to getLatestPrice({_i})
    if {_latestprice} = {_totalprice}:
        close {_p}'s inventory
        add {_totalprice} to balance of {_p}
        send "&b[Mr. Boatwright] &7You sold all your fish for &a$%{_totalprice}%" to {_p}
    else:
        send "&b[Mr. Boatwright] &cOops something went wrong. ##001 Price Not Matching" to {_p}
        send "&b[Mr. Boatwright] &7Updating Price..." to {_p}
        updateFishPrice({_p})
        send "&b[Mr. Boatwright] &7##001 Pls try again." to {_p}

function openfish(p: player):
    open virtual chest with size 4 named "&bMr. Boatwright" to {_p}
    format gui slot 27, 28, 29, 30, 32, 33, 34 and 35 of {_p} with green stained glass pane named "" to do nothing
    format gui slot 31 of {_p} with diamond to run function sellFish({_p}, gui-clicked-item)
    updateFishPrice({_p})

on inventory move:
    if name of player's current inventory = "&bMr. Boatwright":
        updateFishPrice(player)
            
on inventory drag:
    if name of player's current inventory = "&bMr. Boatwright":
        updateFishPrice(player)
    
on right click on entity:
    if name of clicked entity contains "&bMr. Boatwright":
        openfish(player)
 
Sry i totaly missunderstood what it needed to do gonna make a fix without while loops now
[doublepost=1584009493,1583998228][/doublepost]
Code:
function getWorthOfFish(i: item) :: number:
    if name of {_i} contains "&7Common Herring":
        return 10
    else if name of {_i} contains "&7Common Crab":
        return 100
    else:
        return 0

#Bonus money u get wenn a fish has a bigger size than 1.
# Example:
#     Inc value = 1$:
#         size = 1 = 1$
#         size = 1.5 = 1.5$
#         size = 3 = 3$
#     Inc value = 2.5$:  
#         size = 1 = 2.5$
#         size = 1.5 = 3.75$
#         size = 3 = 7.5$
function getSizeIncrease(i: item, s: number) :: number:
    if name of {_i} contains "&7Common Herring":
        return (1 * {_s})
    else if name of {_i} contains "&7Common Crab":
        return (10 * {_s})
    else:
        return 0

function getSize(i: item) :: number:
    set {_s} to line 1 of lore of {_i}
    set {_s::*} to {_s} split at "&8* &aSize: "
    set {_s} to {_s::2}
    replace every "cm" with "" in {_s}
    set {_s} to {_s} parsed as a number
    return {_s}
   
function getPriceOfFish(i: items) :: number:
    set {_t} to 0
    loop {_i::*}:
        delete {_p::*}
        set {_p::w} to getWorthOfFish(loop-value)
        set {_p::s} to getSize(loop-value)
        set {_p::i} to getSizeIncrease(loop-value,{_p::s})
        set {_p::p} to {_p::w} + {_p::i}
        add {_p::p} to {_t}
    return {_t}

function getFish(p: player) :: items:
    loop all items in {_p}'s current inventory:
        if loop-value is raw cod, raw salmon or pufferfish:
            if name of loop-value contains "&7Common Herring" or "&7Common Crab":
                add loop-value to {_fish::*}
    return {_fish::*}

function getLatestPrice(i: item) :: number:
    set {_p} to name of {_i}
    replace every "&aSell for: &a$&a" with "" in {_p}
    set {_p} to {_p} parsed as a number
    return {_p}

function updateFishPrice(p: player):
    set {_fish::*} to getFish({_p})
    set {_fishamount} to size of {_fish::*}
    set {_totalprice} to getPriceOfFish({_fish::*})
    set name of slot 31 of {_p}'s current inventory to "&aSell for: &a$&a%{_totalprice}%"
    set line 1 of lore of slot 31 of {_p}'s current inventory to "&bAmount of fish: %{_fishamount}%"

function sellFish(p: player, i: item):
    set {_fish::*} to getFish({_p})
    set {_fishamount} to size of {_fish::*}
    set {_totalprice} to getPriceOfFish({_fish::*})
    set {_latestprice} to getLatestPrice({_i})
    if {_latestprice} = {_totalprice}:
        close {_p}'s inventory
        add {_totalprice} to balance of {_p}
        send "&b[Mr. Boatwright] &7You sold all your fish for &a$%{_totalprice}%" to {_p}
    else:
        send "&b[Mr. Boatwright] &cOops something went wrong. ##001 Price Not Matching" to {_p}
        send "&b[Mr. Boatwright] &7Updating Price..." to {_p}
        updateFishPrice({_p})
        send "&b[Mr. Boatwright] &7##001 Pls try again." to {_p}

function openfish(p: player):
    open virtual chest with size 4 named "&bMr. Boatwright" to {_p}
    format gui slot 27, 28, 29, 30, 32, 33, 34 and 35 of {_p} with green stained glass pane named "" to do nothing
    format gui slot 31 of {_p} with diamond to run function sellFish({_p}, gui-clicked-item)
    updateFishPrice({_p})

on inventory move:
    if name of player's current inventory = "&bMr. Boatwright":
        updateFishPrice(player)
           
on inventory drag:
    if name of player's current inventory = "&bMr. Boatwright":
        updateFishPrice(player)
   
on right click on entity:
    if name of clicked entity contains "&bMr. Boatwright":
        openfish(player)
Ok, there are no errors, but when i place a common herring in the GUI, it does nothing at all. It wont let me sell the fish, and it doesnt show how many fish are in the gui, and how much it sells for.
https://gyazo.com/061dcd23c95431c659389d7125d2aeaa
 
Yeah, im 100% sure. I posted a example of the fish in the GUI.
https://gyazo.com/061dcd23c95431c659389d7125d2aeaa
hard to see difference between cooked and raw but gonna make a debug version now
[doublepost=1584029321,1584028925][/doublepost]
Yeah, im 100% sure. I posted a example of the fish in the GUI.
https://gyazo.com/061dcd23c95431c659389d7125d2aeaa
Code:
function getWorthOfFish(i: item) :: number:
    broadcast "1"
    if name of {_i} contains "&7Common Herring":
        broadcast "2"
        return 10
    else if name of {_i} contains "&7Common Crab":
        return 100
    else:
        return 0
 
#Bonus money u get wenn a fish has a bigger size than 1.
# Example:
#     Inc value = 1$:
#         size = 1 = 1$
#         size = 1.5 = 1.5$
#         size = 3 = 3$
#     Inc value = 2.5$:
#         size = 1 = 2.5$
#         size = 1.5 = 3.75$
#         size = 3 = 7.5$
function getSizeIncrease(i: item, s: number) :: number:
    broadcast "3"
    if name of {_i} contains "&7Common Herring":
        broadcast "4"
        return (1 * {_s})
    else if name of {_i} contains "&7Common Crab":
        return (10 * {_s})
    else:
        return 0
 
function getSize(i: item) :: number:
    broadcast "5"
    set {_s} to line 1 of lore of {_i}
    set {_s::*} to {_s} split at "&8* &aSize: "
    set {_s} to {_s::2}
    replace every "cm" with "" in {_s}
    set {_s} to {_s} parsed as a number
    return {_s}
 
function getPriceOfFish(i: items) :: number:
    broadcast "6"
    set {_t} to 0
    loop {_i::*}:
        broadcast "7"
        delete {_p::*}
        set {_p::w} to getWorthOfFish(loop-value)
        set {_p::s} to getSize(loop-value)
        set {_p::i} to getSizeIncrease(loop-value,{_p::s})
        set {_p::p} to {_p::w} + {_p::i}
        add {_p::p} to {_t}
    return {_t}
 
function getFish(p: player) :: items:
    broadcast "8"
    loop all items in {_p}'s current inventory:
        broadcast "9"
        if loop-value is raw cod, raw salmon or pufferfish:
            broadcast "10"
            if name of loop-value contains "&7Common Herring" or "&7Common Crab":
                broadcast "11"
                add loop-value to {_fish::*}
    return {_fish::*}
 
function getLatestPrice(i: item) :: number:
    broadcast "12"
    set {_p} to name of {_i}
    replace every "&aSell for: &a$&a" with "" in {_p}
    set {_p} to {_p} parsed as a number
    return {_p}
 
function updateFishPrice(p: player):
    broadcast "13"
    set {_fish::*} to getFish({_p})
    set {_fishamount} to size of {_fish::*}
    set {_totalprice} to getPriceOfFish({_fish::*})
    set name of slot 31 of {_p}'s current inventory to "&aSell for: &a$&a%{_totalprice}%"
    set line 1 of lore of slot 31 of {_p}'s current inventory to "&bAmount of fish: %{_fishamount}%"
 
function sellFish(p: player, i: item):
    broadcast "14"
    set {_fish::*} to getFish({_p})
    set {_fishamount} to size of {_fish::*}
    set {_totalprice} to getPriceOfFish({_fish::*})
    set {_latestprice} to getLatestPrice({_i})
    if {_latestprice} = {_totalprice}:
        broadcast "15"
        close {_p}'s inventory
        add {_totalprice} to balance of {_p}
        send "&b[Mr. Boatwright] &7You sold all your fish for &a$%{_totalprice}%" to {_p}
    else:
        broadcast "16"
        send "&b[Mr. Boatwright] &cOops something went wrong. ##001 Price Not Matching" to {_p}
        send "&b[Mr. Boatwright] &7Updating Price..." to {_p}
        updateFishPrice({_p})
        send "&b[Mr. Boatwright] &7##001 Pls try again." to {_p}
 
function openfish(p: player):
    broadcast "17"
    open virtual chest with size 4 named "&bMr. Boatwright" to {_p}
    format gui slot 27, 28, 29, 30, 32, 33, 34 and 35 of {_p} with green stained glass pane named "" to do nothing
    format gui slot 31 of {_p} with diamond to run function sellFish({_p}, gui-clicked-item)
    updateFishPrice({_p})
 
on inventory move:
    broadcast "18"
    if name of player's current inventory = "&bMr. Boatwright":
        broadcast "19"
        updateFishPrice(player)
         
on inventory drag:
    broadcast "20"
    if name of player's current inventory = "&bMr. Boatwright":
        broadcast "21"
        updateFishPrice(player)
 
on right click on entity:
    broadcast "22"
    if name of clicked entity contains "&bMr. Boatwright":
        broadcast "23"
        openfish(player)

Can u click mr boatwright

then insert 1 raw cod named "&7Common Herring"

then take it out again

then put it back in

and click on the diamond

and send chat out put here
 
hard to see difference between cooked and raw but gonna make a debug version now
[doublepost=1584029321,1584028925][/doublepost]
Code:
function getWorthOfFish(i: item) :: number:
    broadcast "1"
    if name of {_i} contains "&7Common Herring":
        broadcast "2"
        return 10
    else if name of {_i} contains "&7Common Crab":
        return 100
    else:
        return 0
 
#Bonus money u get wenn a fish has a bigger size than 1.
# Example:
#     Inc value = 1$:
#         size = 1 = 1$
#         size = 1.5 = 1.5$
#         size = 3 = 3$
#     Inc value = 2.5$:
#         size = 1 = 2.5$
#         size = 1.5 = 3.75$
#         size = 3 = 7.5$
function getSizeIncrease(i: item, s: number) :: number:
    broadcast "3"
    if name of {_i} contains "&7Common Herring":
        broadcast "4"
        return (1 * {_s})
    else if name of {_i} contains "&7Common Crab":
        return (10 * {_s})
    else:
        return 0
 
function getSize(i: item) :: number:
    broadcast "5"
    set {_s} to line 1 of lore of {_i}
    set {_s::*} to {_s} split at "&8* &aSize: "
    set {_s} to {_s::2}
    replace every "cm" with "" in {_s}
    set {_s} to {_s} parsed as a number
    return {_s}
 
function getPriceOfFish(i: items) :: number:
    broadcast "6"
    set {_t} to 0
    loop {_i::*}:
        broadcast "7"
        delete {_p::*}
        set {_p::w} to getWorthOfFish(loop-value)
        set {_p::s} to getSize(loop-value)
        set {_p::i} to getSizeIncrease(loop-value,{_p::s})
        set {_p::p} to {_p::w} + {_p::i}
        add {_p::p} to {_t}
    return {_t}
 
function getFish(p: player) :: items:
    broadcast "8"
    loop all items in {_p}'s current inventory:
        broadcast "9"
        if loop-value is raw cod, raw salmon or pufferfish:
            broadcast "10"
            if name of loop-value contains "&7Common Herring" or "&7Common Crab":
                broadcast "11"
                add loop-value to {_fish::*}
    return {_fish::*}
 
function getLatestPrice(i: item) :: number:
    broadcast "12"
    set {_p} to name of {_i}
    replace every "&aSell for: &a$&a" with "" in {_p}
    set {_p} to {_p} parsed as a number
    return {_p}
 
function updateFishPrice(p: player):
    broadcast "13"
    set {_fish::*} to getFish({_p})
    set {_fishamount} to size of {_fish::*}
    set {_totalprice} to getPriceOfFish({_fish::*})
    set name of slot 31 of {_p}'s current inventory to "&aSell for: &a$&a%{_totalprice}%"
    set line 1 of lore of slot 31 of {_p}'s current inventory to "&bAmount of fish: %{_fishamount}%"
 
function sellFish(p: player, i: item):
    broadcast "14"
    set {_fish::*} to getFish({_p})
    set {_fishamount} to size of {_fish::*}
    set {_totalprice} to getPriceOfFish({_fish::*})
    set {_latestprice} to getLatestPrice({_i})
    if {_latestprice} = {_totalprice}:
        broadcast "15"
        close {_p}'s inventory
        add {_totalprice} to balance of {_p}
        send "&b[Mr. Boatwright] &7You sold all your fish for &a$%{_totalprice}%" to {_p}
    else:
        broadcast "16"
        send "&b[Mr. Boatwright] &cOops something went wrong. ##001 Price Not Matching" to {_p}
        send "&b[Mr. Boatwright] &7Updating Price..." to {_p}
        updateFishPrice({_p})
        send "&b[Mr. Boatwright] &7##001 Pls try again." to {_p}
 
function openfish(p: player):
    broadcast "17"
    open virtual chest with size 4 named "&bMr. Boatwright" to {_p}
    format gui slot 27, 28, 29, 30, 32, 33, 34 and 35 of {_p} with green stained glass pane named "" to do nothing
    format gui slot 31 of {_p} with diamond to run function sellFish({_p}, gui-clicked-item)
    updateFishPrice({_p})
 
on inventory move:
    broadcast "18"
    if name of player's current inventory = "&bMr. Boatwright":
        broadcast "19"
        updateFishPrice(player)
        
on inventory drag:
    broadcast "20"
    if name of player's current inventory = "&bMr. Boatwright":
        broadcast "21"
        updateFishPrice(player)
 
on right click on entity:
    broadcast "22"
    if name of clicked entity contains "&bMr. Boatwright":
        broadcast "23"
        openfish(player)

Can u click mr boatwright

then insert 1 raw cod named "&7Common Herring"

then take it out again

then put it back in

and click on the diamond

and send chat out put here
This is the only thing it sends:
https://gyazo.com/1187096454bf1d5249b56da279523f26
 

And this?

Code:
function getWorthOfFish(i: item) :: number:
    broadcast "1"
    if name of {_i} contains "&7Common Herring":
        broadcast "2"
        return 10
    else if name of {_i} contains "&7Common Crab":
        return 100
    else:
        return 0
 
#Bonus money u get wenn a fish has a bigger size than 1.
# Example:
#     Inc value = 1$:
#         size = 1 = 1$
#         size = 1.5 = 1.5$
#         size = 3 = 3$
#     Inc value = 2.5$: 
#         size = 1 = 2.5$
#         size = 1.5 = 3.75$
#         size = 3 = 7.5$
function getSizeIncrease(i: item, s: number) :: number:
    broadcast "3"
    if name of {_i} contains "&7Common Herring":
        broadcast "4"
        return (1 * {_s})
    else if name of {_i} contains "&7Common Crab":
        return (10 * {_s})
    else:
        return 0
 
function getSize(i: item) :: number:
    broadcast "5"
    set {_s} to line 1 of lore of {_i}
    set {_s::*} to {_s} split at "&8* &aSize: "
    set {_s} to {_s::2}
    replace every "cm" with "" in {_s}
    set {_s} to {_s} parsed as a number
    return {_s}
  
function getPriceOfFish(i: items) :: number:
    broadcast "6"
    set {_t} to 0
    loop {_i::*}:
        broadcast "7"
        delete {_p::*}
        set {_p::w} to getWorthOfFish(loop-value)
        set {_p::s} to getSize(loop-value)
        set {_p::i} to getSizeIncrease(loop-value,{_p::s})
        set {_p::p} to {_p::w} + {_p::i}
        add {_p::p} to {_t}
    return {_t}
 
function getFish(p: player) :: items:
    broadcast "8"
    loop all items in {_p}'s current inventory:
        broadcast "9"
        if loop-value is raw cod, raw salmon or pufferfish:
            broadcast "10"
            if name of loop-value contains "&7Common Herring" or "&7Common Crab":
                broadcast "11"
                add loop-value to {_fish::*}
    return {_fish::*}
 
function getLatestPrice(i: item) :: number:
    broadcast "12"
    set {_p} to name of {_i}
    replace every "&aSell for: &a$&a" with "" in {_p}
    set {_p} to {_p} parsed as a number
    return {_p}
 
function updateFishPrice(p: player):
    broadcast "13"
    set {_fish::*} to getFish({_p})
    set {_fishamount} to size of {_fish::*}
    set {_totalprice} to getPriceOfFish({_fish::*})
    set name of slot 31 of {_p}'s current inventory to "&aSell for: &a$&a%{_totalprice}%"
    set line 1 of lore of slot 31 of {_p}'s current inventory to "&bAmount of fish: %{_fishamount}%"
 
function sellFish(p: player, i: item):
    broadcast "14"
    set {_fish::*} to getFish({_p})
    set {_fishamount} to size of {_fish::*}
    set {_totalprice} to getPriceOfFish({_fish::*})
    set {_latestprice} to getLatestPrice({_i})
    if {_latestprice} = {_totalprice}:
        broadcast "15"
        close {_p}'s inventory
        add {_totalprice} to balance of {_p}
        send "&b[Mr. Boatwright] &7You sold all your fish for &a$%{_totalprice}%" to {_p}
    else:
        broadcast "16"
        send "&b[Mr. Boatwright] &cOops something went wrong. ##001 Price Not Matching" to {_p}
        send "&b[Mr. Boatwright] &7Updating Price..." to {_p}
        updateFishPrice({_p})
        send "&b[Mr. Boatwright] &7##001 Pls try again." to {_p}
 
function openfish(p: player):
    broadcast "17"
    open virtual chest with size 4 named "&bMr. Boatwright" to {_p}
    format gui slot 27, 28, 29, 30, 32, 33, 34 and 35 of {_p} with green stained glass pane named "" to do nothing
    format gui slot 31 of {_p} with diamond to run function sellFish({_p}, gui-clicked-item)
    updateFishPrice({_p})
 
on inventory move:
    broadcast "18"
    if inventory name of player's current inventory = "&bMr. Boatwright":
        broadcast "19"
        updateFishPrice(player)
          
on inventory drag:
    broadcast "20"
    if inventory name of player's current inventory = "&bMr. Boatwright":
        broadcast "21"
        updateFishPrice(player)
  
on right click on entity:
    broadcast "22"
    if name of clicked entity contains "&bMr. Boatwright":
        broadcast "23"
        openfish(player)
 
And this?

Code:
function getWorthOfFish(i: item) :: number:
    broadcast "1"
    if name of {_i} contains "&7Common Herring":
        broadcast "2"
        return 10
    else if name of {_i} contains "&7Common Crab":
        return 100
    else:
        return 0
 
#Bonus money u get wenn a fish has a bigger size than 1.
# Example:
#     Inc value = 1$:
#         size = 1 = 1$
#         size = 1.5 = 1.5$
#         size = 3 = 3$
#     Inc value = 2.5$:
#         size = 1 = 2.5$
#         size = 1.5 = 3.75$
#         size = 3 = 7.5$
function getSizeIncrease(i: item, s: number) :: number:
    broadcast "3"
    if name of {_i} contains "&7Common Herring":
        broadcast "4"
        return (1 * {_s})
    else if name of {_i} contains "&7Common Crab":
        return (10 * {_s})
    else:
        return 0
 
function getSize(i: item) :: number:
    broadcast "5"
    set {_s} to line 1 of lore of {_i}
    set {_s::*} to {_s} split at "&8* &aSize: "
    set {_s} to {_s::2}
    replace every "cm" with "" in {_s}
    set {_s} to {_s} parsed as a number
    return {_s}
 
function getPriceOfFish(i: items) :: number:
    broadcast "6"
    set {_t} to 0
    loop {_i::*}:
        broadcast "7"
        delete {_p::*}
        set {_p::w} to getWorthOfFish(loop-value)
        set {_p::s} to getSize(loop-value)
        set {_p::i} to getSizeIncrease(loop-value,{_p::s})
        set {_p::p} to {_p::w} + {_p::i}
        add {_p::p} to {_t}
    return {_t}
 
function getFish(p: player) :: items:
    broadcast "8"
    loop all items in {_p}'s current inventory:
        broadcast "9"
        if loop-value is raw cod, raw salmon or pufferfish:
            broadcast "10"
            if name of loop-value contains "&7Common Herring" or "&7Common Crab":
                broadcast "11"
                add loop-value to {_fish::*}
    return {_fish::*}
 
function getLatestPrice(i: item) :: number:
    broadcast "12"
    set {_p} to name of {_i}
    replace every "&aSell for: &a$&a" with "" in {_p}
    set {_p} to {_p} parsed as a number
    return {_p}
 
function updateFishPrice(p: player):
    broadcast "13"
    set {_fish::*} to getFish({_p})
    set {_fishamount} to size of {_fish::*}
    set {_totalprice} to getPriceOfFish({_fish::*})
    set name of slot 31 of {_p}'s current inventory to "&aSell for: &a$&a%{_totalprice}%"
    set line 1 of lore of slot 31 of {_p}'s current inventory to "&bAmount of fish: %{_fishamount}%"
 
function sellFish(p: player, i: item):
    broadcast "14"
    set {_fish::*} to getFish({_p})
    set {_fishamount} to size of {_fish::*}
    set {_totalprice} to getPriceOfFish({_fish::*})
    set {_latestprice} to getLatestPrice({_i})
    if {_latestprice} = {_totalprice}:
        broadcast "15"
        close {_p}'s inventory
        add {_totalprice} to balance of {_p}
        send "&b[Mr. Boatwright] &7You sold all your fish for &a$%{_totalprice}%" to {_p}
    else:
        broadcast "16"
        send "&b[Mr. Boatwright] &cOops something went wrong. ##001 Price Not Matching" to {_p}
        send "&b[Mr. Boatwright] &7Updating Price..." to {_p}
        updateFishPrice({_p})
        send "&b[Mr. Boatwright] &7##001 Pls try again." to {_p}
 
function openfish(p: player):
    broadcast "17"
    open virtual chest with size 4 named "&bMr. Boatwright" to {_p}
    format gui slot 27, 28, 29, 30, 32, 33, 34 and 35 of {_p} with green stained glass pane named "" to do nothing
    format gui slot 31 of {_p} with diamond to run function sellFish({_p}, gui-clicked-item)
    updateFishPrice({_p})
 
on inventory move:
    broadcast "18"
    if inventory name of player's current inventory = "&bMr. Boatwright":
        broadcast "19"
        updateFishPrice(player)
         
on inventory drag:
    broadcast "20"
    if inventory name of player's current inventory = "&bMr. Boatwright":
        broadcast "21"
        updateFishPrice(player)
 
on right click on entity:
    broadcast "22"
    if name of clicked entity contains "&bMr. Boatwright":
        broadcast "23"
        openfish(player)
It sends this:
https://gyazo.com/2d90af01f1f2a6627d2297667765832c
 
Code:
function getWorthOfFish(i: item) :: number:
    broadcast "1"
    if name of {_i} contains "&7Common Herring":
        broadcast "2"
        return 10
    else if name of {_i} contains "&7Common Crab":
        return 100
    else:
        return 0
 
#Bonus money u get wenn a fish has a bigger size than 1.
# Example:
#     Inc value = 1$:
#         size = 1 = 1$
#         size = 1.5 = 1.5$
#         size = 3 = 3$
#     Inc value = 2.5$: 
#         size = 1 = 2.5$
#         size = 1.5 = 3.75$
#         size = 3 = 7.5$
function getSizeIncrease(i: item, s: number) :: number:
    broadcast "3"
    if name of {_i} contains "&7Common Herring":
        broadcast "4"
        return (1 * {_s})
    else if name of {_i} contains "&7Common Crab":
        return (10 * {_s})
    else:
        return 0
 
function getSize(i: item) :: number:
    broadcast "5"
    set {_s} to line 1 of lore of {_i}
    set {_s::*} to {_s} split at "&8* &aSize: "
    set {_s} to {_s::2}
    replace every "cm" with "" in {_s}
    set {_s} to {_s} parsed as a number
    return {_s}
  
function getPriceOfFish(i: items) :: number:
    broadcast "6"
    set {_t} to 0
    loop {_i::*}:
        broadcast "7"
        delete {_p::*}
        set {_p::w} to getWorthOfFish(loop-value)
        set {_p::s} to getSize(loop-value)
        set {_p::i} to getSizeIncrease(loop-value,{_p::s})
        set {_p::p} to {_p::w} + {_p::i}
        add {_p::p} to {_t}
    return {_t}
 
function getFish(p: player) :: items:
    broadcast "8"
    loop all items in {_p}'s current inventory:
        broadcast "9"
        if loop-value is raw cod, raw salmon or pufferfish:
            broadcast "10"
            if name of loop-value contains "&7Common Herring" or "&7Common Crab":
                broadcast "11"
                add loop-value to {_fish::*}
    return {_fish::*}
 
function getLatestPrice(i: item) :: number:
    broadcast "12"
    set {_p} to name of {_i}
    replace every "&aSell for: &a$&a" with "" in {_p}
    set {_p} to {_p} parsed as a number
    return {_p}
 
function updateFishPrice(p: player):
    broadcast "13"
    set {_fish::*} to getFish({_p})
    set {_fishamount} to size of {_fish::*}
    set {_totalprice} to getPriceOfFish({_fish::*})
    set name of slot 31 of {_p}'s current inventory to "&aSell for: &a$&a%{_totalprice}%"
    set line 1 of lore of slot 31 of {_p}'s current inventory to "&bAmount of fish: %{_fishamount}%"
 
function sellFish(p: player, i: item):
    broadcast "14"
    set {_fish::*} to getFish({_p})
    set {_fishamount} to size of {_fish::*}
    set {_totalprice} to getPriceOfFish({_fish::*})
    set {_latestprice} to getLatestPrice({_i})
    if {_latestprice} = {_totalprice}:
        broadcast "15"
        close {_p}'s inventory
        add {_totalprice} to balance of {_p}
        send "&b[Mr. Boatwright] &7You sold all your fish for &a$%{_totalprice}%" to {_p}
    else:
        broadcast "16"
        send "&b[Mr. Boatwright] &cOops something went wrong. ##001 Price Not Matching" to {_p}
        send "&b[Mr. Boatwright] &7Updating Price..." to {_p}
        updateFishPrice({_p})
        send "&b[Mr. Boatwright] &7##001 Pls try again." to {_p}
 
function openfish(p: player):
    broadcast "17"
    open virtual chest with size 4 named "&bMr. Boatwright" to {_p}
    format gui slot 27, 28, 29, 30, 32, 33, 34 and 35 of {_p} with green stained glass pane named "" to do nothing
    format gui slot 31 of {_p} with diamond to run function sellFish({_p}, gui-clicked-item)
    updateFishPrice({_p})
 
on inventory move:
    broadcast "18"
    if inventory name of player's current inventory = "&bMr. Boatwright":
        broadcast "19"
        updateFishPrice(player)
          
on inventory drag:
    broadcast "20"
    broadcast "&a%inventory name of player's current inventory%"
    if inventory name of player's current inventory = "&bMr. Boatwright":
        broadcast "21"
        updateFishPrice(player)
  
on right click on entity:
    broadcast "22"
    if name of clicked entity contains "&bMr. Boatwright":
        broadcast "23"
        openfish(player)
 
Code:
function getWorthOfFish(i: item) :: number:
    broadcast "1"
    if name of {_i} contains "&7Common Herring":
        broadcast "2"
        return 10
    else if name of {_i} contains "&7Common Crab":
        return 100
    else:
        return 0
 
#Bonus money u get wenn a fish has a bigger size than 1.
# Example:
#     Inc value = 1$:
#         size = 1 = 1$
#         size = 1.5 = 1.5$
#         size = 3 = 3$
#     Inc value = 2.5$:
#         size = 1 = 2.5$
#         size = 1.5 = 3.75$
#         size = 3 = 7.5$
function getSizeIncrease(i: item, s: number) :: number:
    broadcast "3"
    if name of {_i} contains "&7Common Herring":
        broadcast "4"
        return (1 * {_s})
    else if name of {_i} contains "&7Common Crab":
        return (10 * {_s})
    else:
        return 0
 
function getSize(i: item) :: number:
    broadcast "5"
    set {_s} to line 1 of lore of {_i}
    set {_s::*} to {_s} split at "&8* &aSize: "
    set {_s} to {_s::2}
    replace every "cm" with "" in {_s}
    set {_s} to {_s} parsed as a number
    return {_s}
 
function getPriceOfFish(i: items) :: number:
    broadcast "6"
    set {_t} to 0
    loop {_i::*}:
        broadcast "7"
        delete {_p::*}
        set {_p::w} to getWorthOfFish(loop-value)
        set {_p::s} to getSize(loop-value)
        set {_p::i} to getSizeIncrease(loop-value,{_p::s})
        set {_p::p} to {_p::w} + {_p::i}
        add {_p::p} to {_t}
    return {_t}
 
function getFish(p: player) :: items:
    broadcast "8"
    loop all items in {_p}'s current inventory:
        broadcast "9"
        if loop-value is raw cod, raw salmon or pufferfish:
            broadcast "10"
            if name of loop-value contains "&7Common Herring" or "&7Common Crab":
                broadcast "11"
                add loop-value to {_fish::*}
    return {_fish::*}
 
function getLatestPrice(i: item) :: number:
    broadcast "12"
    set {_p} to name of {_i}
    replace every "&aSell for: &a$&a" with "" in {_p}
    set {_p} to {_p} parsed as a number
    return {_p}
 
function updateFishPrice(p: player):
    broadcast "13"
    set {_fish::*} to getFish({_p})
    set {_fishamount} to size of {_fish::*}
    set {_totalprice} to getPriceOfFish({_fish::*})
    set name of slot 31 of {_p}'s current inventory to "&aSell for: &a$&a%{_totalprice}%"
    set line 1 of lore of slot 31 of {_p}'s current inventory to "&bAmount of fish: %{_fishamount}%"
 
function sellFish(p: player, i: item):
    broadcast "14"
    set {_fish::*} to getFish({_p})
    set {_fishamount} to size of {_fish::*}
    set {_totalprice} to getPriceOfFish({_fish::*})
    set {_latestprice} to getLatestPrice({_i})
    if {_latestprice} = {_totalprice}:
        broadcast "15"
        close {_p}'s inventory
        add {_totalprice} to balance of {_p}
        send "&b[Mr. Boatwright] &7You sold all your fish for &a$%{_totalprice}%" to {_p}
    else:
        broadcast "16"
        send "&b[Mr. Boatwright] &cOops something went wrong. ##001 Price Not Matching" to {_p}
        send "&b[Mr. Boatwright] &7Updating Price..." to {_p}
        updateFishPrice({_p})
        send "&b[Mr. Boatwright] &7##001 Pls try again." to {_p}
 
function openfish(p: player):
    broadcast "17"
    open virtual chest with size 4 named "&bMr. Boatwright" to {_p}
    format gui slot 27, 28, 29, 30, 32, 33, 34 and 35 of {_p} with green stained glass pane named "" to do nothing
    format gui slot 31 of {_p} with diamond to run function sellFish({_p}, gui-clicked-item)
    updateFishPrice({_p})
 
on inventory move:
    broadcast "18"
    if inventory name of player's current inventory = "&bMr. Boatwright":
        broadcast "19"
        updateFishPrice(player)
         
on inventory drag:
    broadcast "20"
    broadcast "&a%inventory name of player's current inventory%"
    if inventory name of player's current inventory = "&bMr. Boatwright":
        broadcast "21"
        updateFishPrice(player)
 
on right click on entity:
    broadcast "22"
    if name of clicked entity contains "&bMr. Boatwright":
        broadcast "23"
        openfish(player)
https://gyazo.com/5e572f31e49277ee527f94de055b6546
 
u don't get this after 20
Code:
broadcast "&a%inventory name of player's current inventory%"
[doublepost=1584030399,1584030351][/doublepost]do u use skript-mirror?
 
Status
Not open for further replies.