Maybe Im Dumb But I need some help lol specifically line 24 - "set slot (loop-index - 1) of current inventory of player to {_item}"
full script
# On player join, give the player the Shop item in the 9th slot
on join:
if player's inventory's slot 9 is not a nether star named "&5&lShop":
set slot 9 of player's inventory to nether star named "&5&lShop"
add "Click to open the shop" to lore of player's inventory's slot 9
# Prevent moving the Shop item
on inventory click:
if clicked inventory is player's inventory:
if clicked slot is 9:
cancel event
send "&cYou cannot move the Shop item!"
# Right-click to open the shop menu
on right click:
if player's tool is a nether star named "&5&lShop":
open chest with 3 rows named "&eShop Menu" to player
wait 1 tick
loop {shopitems::*}:
set {_item} to loop-value
set {_price} to {shopitemprice::%loop-value%}
add "&ePrice: &6%{_price}% Coins" to lore of {_item}
add {_item} to player's current inventory # Use to add items to GUI menu
set slot (loop-index - 1) of current inventory of player to {_item}
# Add an item to the shop with a price
command /addshopitem <number>:
permission: op
trigger:
set {_price} to argument 1
if player's tool is not air:
add player's tool to {shopitems::*}
set {shopitemprice::%player's tool%} to {_price}
send "&aItem added to the shop with a price of &6%{_price}% coins."
# Remove all items and reset the shop
command /resetshop:
permission: op
trigger:
clear {shopitems::*}
clear {shopitemprice::*}
send "&cShop items have been reset."
# Prevent players from dropping the Shop item
on drop:
if player's tool is a nether star named "&5&lShop":
cancel event
send "&cYou cannot drop the Shop item!"
full script
# On player join, give the player the Shop item in the 9th slot
on join:
if player's inventory's slot 9 is not a nether star named "&5&lShop":
set slot 9 of player's inventory to nether star named "&5&lShop"
add "Click to open the shop" to lore of player's inventory's slot 9
# Prevent moving the Shop item
on inventory click:
if clicked inventory is player's inventory:
if clicked slot is 9:
cancel event
send "&cYou cannot move the Shop item!"
# Right-click to open the shop menu
on right click:
if player's tool is a nether star named "&5&lShop":
open chest with 3 rows named "&eShop Menu" to player
wait 1 tick
loop {shopitems::*}:
set {_item} to loop-value
set {_price} to {shopitemprice::%loop-value%}
add "&ePrice: &6%{_price}% Coins" to lore of {_item}
add {_item} to player's current inventory # Use to add items to GUI menu
set slot (loop-index - 1) of current inventory of player to {_item}
# Add an item to the shop with a price
command /addshopitem <number>:
permission: op
trigger:
set {_price} to argument 1
if player's tool is not air:
add player's tool to {shopitems::*}
set {shopitemprice::%player's tool%} to {_price}
send "&aItem added to the shop with a price of &6%{_price}% coins."
# Remove all items and reset the shop
command /resetshop:
permission: op
trigger:
clear {shopitems::*}
clear {shopitemprice::*}
send "&cShop items have been reset."
# Prevent players from dropping the Shop item
on drop:
if player's tool is a nether star named "&5&lShop":
cancel event
send "&cYou cannot drop the Shop item!"