I made a lootbox but people can place it on the ground, anyone know how to fix this (the item is a chest)

  • 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 skUnity Downloads for downloads and any other information about Skript!

zysw

New Member
Oct 31, 2023
6
0
1
im having problems making it so people cant place it on the ground

code:

on join:
add diamond to {items::*}
add diamond sword to {items::*}
on right click:
if player is holding a chest named "lootbox":
give player random element out of {items::*}
remove 1 chest named "lootbox" from player's inventory
command /lootbox:
trigger:
give 1 chest named "lootbox" to player
 
Code:
on load:
    add diamond to {items::*}
    add diamond sword to {items::*}
    set {lootbox} to chest named "lootbox"

on right click:
    if player's held item is {lootbox}:
        cancel event

command /lootbox:
    trigger:
        give 1 of {lootbox} to player
 
Last edited:
Code:
on load:
    add diamond to {items::*}
    add diamond sword to {items::*}
    set {lootbox} to chest named "lootbox"

on place:
    if player's held item is {lootbox}:
        cancel event

command /lootbox:
    trigger:
        give 1 of {lootbox} to player
no errors, but doesn't work