Inventory skript problem

  • 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 comminuty!

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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Noonigertom

Member
Sep 16, 2023
1
0
1
33
when i click the second slot of "&4&lMenu" its executing the "/warp dungeon" command. Pls Help me!

code:

command /menu:
trigger:
open chest inventory with 1 rows named "&4&lMenu" to player
set slot 0 of player's current inventory to book named "&c&lRules"
set slot 1 of player's current inventory to ender pearl named "&5&lWarps"
set slot 2 of player's current inventory to note block named "&6&lGet a Voicechat Link"
set slot 3 of player's current inventory to diamond named "&3diamond"
set slot 4 of player's current inventory to diamond named "&3diamond"
set slot 5 of player's current inventory to diamond named "&3diamond"
set slot 6 of player's current inventory to diamond named "&3diamond"
set slot 7 of player's current inventory to diamond named "&3diamond"
set slot 8 of player's current inventory to diamond named "&3diamond"
set slot 9 of player's current inventory to diamond named "&3diamond"

on inventory click:
if player's current inventory's name is "&4&lMenu":
cancel event

if clicked slot is 0:
close player's inventory
send message "&c&lRules"
send message "&e&l1.No cheating"
send message "&e&l2.No swearing"
if clicked slot is 1:
open chest inventory with 1 rows named "&1&lWarps" to player
set slot 0 of player's current inventory to bedrock named "&a&lspawn"
set slot 1 of player's current inventory to mossy stone bricks named "&a&lDungeon (Warp in work)"
set slot 2 of player's current inventory to iron bars named "&a&ljailwatch"
if clicked slot is 2:
close player's inventory
make player execute command "/audio"

if player's current inventory's name is "&1&lWarps":
cancel event

if clicked slot is 0:
close player's inventory
make player execute command "/spawn"
if clicked slot is 1:
close player's inventory
make player execute command "/warp dungeon"
if clicked slot is 2:
close player's inventory
make player execute command "/warp jailwatch"
 
Hi. In the future, please place your code within code blocks (they're in the formatting bar at the top of the text box), as they allow you to display indentations when necessary.

At the bottom of the inventory click event, you're running "/warp dungeon" when the clicked slot has id 1 (the second slot, because slots start from 0). Modify that section to make the behavior you were originally anticipating.

Hope this helps. Ask me if you need anything else.