Skript version: 2.5.3-MH
Minecraft version: 1.16.4
https://www.imagebanana.com/s/big/1997/ivLkcaXP.png
*Can't access the console on MH
Addons:
https://www.imagebanana.com/s/big/1997/o4yWe1Fe.png
Thr problem is in line 23/24. I want to test if the player has enough money. but I can't get the player's uuid. I also tried to add the uuid as an argument to the function but then it doesn't work at all. No errors. It just doesn't work.
I have researched everywhere and have been trying for over and hour but I didn't fix it.
Minecraft version: 1.16.4
Code:
on inventory click:
if event-player has a gui:
cancel event
command /shop:
trigger:
send "%{economy::balance::%player's uuid%}%" to player
show virtual chest inventory with 5 rows named "Shop" to player
format gui slot 4 of player with gold nugget named "&rBalance: $%{economy::balance::%player's uuid%}%" to do nothing
format gui slot 19 of player with grass block named "&rBlocks" to close then run function blockMenu(player)
function blockMenu(p: player):
show virtual chest inventory with 5 rows named "Shop - Blocks" to {_p}
format gui slot 10 of {_p} with grass block to close then run function buy({_p}, grass block, 10)
function buy(p: player, i: item, c: integer):
set {amount::%{_p}%} to 1
show virtual chest inventory with 5 rows named "Shop - Buy" to {_p}
format gui slot 22 of {_p} with "%{amount::%{_p}%}% %{_i}%" parsed as item with lore "&rPrice: %{_c}%" to do nothing
format gui slot 41 of {_p} with lime glass pane named "&rBuy" to run:
if {economy::balance::%{_p}'s uuid%} is greater than or equal to {_c} * {amount::%{_p}%}:
send {economy::balance::%{_p}'s uuid%} to {_p}
format gui slot 39 of {_p} with red glass pane named "&rSell" to run:
send "no" to {_p}
format gui slot 20 of {_p} with red glass pane named "&rRemove 1" to run:
addAmount(-1, {_p}, {_i}, {_c})
format gui slot 24 of {_p} with lime glass pane named "&rAdd 1" to run:
addAmount(1, {_p}, {_i}, {_c})
format gui slot 25 of {_p} with lime glass pane named "&rSet to 64" to run:
setAmount(64, {_p}, {_i}, {_c})
format gui slot 19 of {_p} with red glass pane named "&rSet to 1" to run:
setAmount(1, {_p}, {_i}, {_c})
function addAmount(a: integer, p: player, i: item, c: integer):
add {_a} to {amount::%{_p}%}
if {amount::%{_p}%} is greater than 64:
set {amount::%{_p}%} to 1
if {amount::%{_p}%} is less than 1:
set {amount::%{_p}%} to 64
format gui slot 22 of {_p} with "%{amount::%{_p}%}% %{_i}%" parsed as item with lore "&rPrice: %{_c} * {amount::%{_p}%}%" to do nothing
function setAmount(a: integer, p: player, i: item, c: integer):
set {amount::%{_p}%} to {_a}
format gui slot 22 of {_p} with "%{amount::%{_p}%}% %{_i}%" parsed as item with lore "&rPrice: %{_c} * {amount::%{_p}%}%" to do nothing
https://www.imagebanana.com/s/big/1997/ivLkcaXP.png
*Can't access the console on MH
Addons:
https://www.imagebanana.com/s/big/1997/o4yWe1Fe.png
Thr problem is in line 23/24. I want to test if the player has enough money. but I can't get the player's uuid. I also tried to add the uuid as an argument to the function but then it doesn't work at all. No errors. It just doesn't work.
I have researched everywhere and have been trying for over and hour but I didn't fix it.