Solved Is There Any way to correct this without any addons for script or do i need a addon or something?

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Sep 23, 2024
1
0
1
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!"