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
[doublepost=1583783636,1583687219][/doublepost]bump
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