#Explain why this doesn’t work.
1 messages · Page 1 of 1 (latest)
so far im only at the commands, the gui (makeshift one for now), and the depositing.
can you point me to the problem?
it wont take the item from my inventory
@velvet ferry like when i click the deposit 16 it wont take 16 of the item
the remove is not after the if statement
send error also
how would i fix?
if player's inventory contains 16 of {deposititem.coin}: remove 16 of {deposititem.coin} from player's inventory play sound "block.note_block.pling" for player
if player's inventory contains 16 of {deposititem.coin}: remove 16 of {deposititem.coin} from player's inventory play sound "block.note_block.pling" for player
try
u are not utilizing the shape in the gui
```on script load:
create gui with id "forge" with virtual chest inventory with 5 rows named "Forge" and shape "xxxxxxxxx", "xabcdefgx", "xhijklmnx", "xopqrstux" and "xxxxXxxxx":
# border
make gui slot "x" to {border}
make gui slot "X" with a barrier named "&cClose":
close player's inventory
use id also
this is example from my server
everywhere i wanted a border in the gui i put an "x" but it could be anything
and then I made all x to be border
also use id when making gui
btw is the problem fixed?
got it
no not yet im testing
if its not working send error
got it 1s
so the id would be the name of the gui?
no id is just to identify the gui
its not needed but good to use
u can do open gui with id "forge" to player for example
okay I have this so far
{border}
also how would I make {border} a real border
@velvet ferry
got it
how do I make the barrier close the inventory
```
on script load:
create gui with id "bank" with virtual chest inventory with 5 rows named "ʏᴏᴜʀ ʙᴀɴᴋ" and shape "xxxxxxxxx", "xeeeAeeex", "xabcBefgx", "xeeeeeeex" and "xxxxXxxxx":
make gui slot "x" to {border}
make gui slot "A" to a emerald named "&a&lBANK INFO"
make gui slot "e" to air
make gui slot "X" with a barrier named "&cClose"
close player's inventory
@velvet ferry
just like i did here
add an ":" at the end of the make gui blah blah blah and then what you want to happen when its clicked
for this instance
close player's inventory
this what I got now
@velvet ferry
make gui slot "X" with a barrier named "&cClose": close player's inventory
bro im kinda busy rn this is last i help u
idk a good way to fix this but i did
```function sell(p: player, i: item, amount: number, coinsper: number):
set {_allof} to amount of {_i} in inventory of {_p}
if {_allof} < 1:
stop
if {_allof} >= {_amount}:
remove {_amount} of {_i} from {_p}
increase {coins::%{_p}'s uuid%} by ({_coinsper} * {_amount})
this is a function i created for my server, change it to work for your var names and stuff
where would I use this?