Skript Version: 2.4.1
Minecraft Version: 1.15.2
Full Code:
Errors on reload:
https://ibb.co/gvxsxh4
Addons using (including versions): Skellet , SkExtras's, SkQuery, skRayFall, Skript, TuSKe
Troubleshooting:
Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
What other methods have you tried to fix it? i searched the errors up and nothing came up
Minecraft Version: 1.15.2
Full Code:
Code:
options:
AMOUNT_Grass: 8
SINGLE_Grass: 5
AMOUNT_Dirt: 8
SINGLE_Dirt: 3
AMOUNT_Redstone: 8
SINGLE_Redstone: 10
BUY_Redstone: %{@AMOUNT_Redstone}*{@SINGLE_Redstone}%
function setShop(slot: integer, player: player, amount: integer, item: item, buy: number, menu: string):
if inventory name of {_player}'s current inventory is "&2{_menu}":
if event-slot is {_slot}:
if {_player}'s balance is more than {_buy}:
if {_player} can hold {_amount} {_item}:
remove {_buy} from {_player}'s balance
give {_player} {_amount} {_item}
else:
send "&cYou do not have enough inventory space."
play sound "ENTITY_VILLAGER_NO" at player
else:
send "&cYou do not have the suffcient funds."
play sound "ENTITY_VILLAGER_NO" at player
command /shop [<text>]:
trigger:
if arg 1 is "blocks":
open virtual chest with size 5 named "&2Blocks" to player
set {_slot} to 0
loop 45 times:
format a gui slot {_slot} of player with dark gray stained glass pane named "&f" to do nothing
add 1 to {_slot}
format a gui slot 10 of player with {@AMOUNT_Grass} grass block named "&2Grass Block" with lore "&a$%{@AMOUNT_Grass}*{@SINGLE_Grass}%"
format a gui slot 11 of player with {@AMOUNT_Dirt} dirt block named "&2Dirt" with lore "&a$%{@AMOUNT_Dirt}*{@SINGLE_Dirt}%"
format a gui slot 40 of player with barrier named "&cBack" to run player command "/shop"
if arg 1 is "redstone":
open virtual chest with size 5 named "&2Redstone" to player
set {_slot} to 0
loop 45 times:
format a gui slot {_slot} of player with dark gray stained glass pane named "&f" to do nothing
format a gui slot 10 of player with {@AMOUNT_Redstone} redstone item named "&2Redstone" with lore "&a$%{@AMOUNT_Redstone}*{@SINGLE_Redstone}%"
format a gui slot 40 of player with barrier named "&cBack" to run player command "/shop"
add 1 to {_slot}
if arg 1 is not set:
open chest with 1 row named "&2Shop" to player
format a gui slot 0 of player with grass block named "&2Blocks" to run player command "/shop blocks"
format a gui slot 1 of player with redstone item named "&2Redstone" to run player command "/shop redstone"
on inventory click:
setShop(10, player, 8, grass block, {@BUY_Redstone}, blocks)
on inventory click:
set {_click} to clicked slot
set {_click2} to clicked item
broadcast "%{_click}%"
broadcast "%{_click2}%"
Errors on reload:
https://ibb.co/gvxsxh4
Addons using (including versions): Skellet , SkExtras's, SkQuery, skRayFall, Skript, TuSKe
Troubleshooting:
Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
What other methods have you tried to fix it? i searched the errors up and nothing came up