Item Restrictions

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

Status
Not open for further replies.

MintyToes

Member
Jun 13, 2021
1
0
1
I am a complete begginer to skript and theres a few problems with my skript I would like to figure out
The on drop section doesn't remove all of the banned items in the inventory
The on tool change section does remove items but only if there is a singular one, so if there is a stack of a banned item then it will not detect it
the on click section doesnt get the item that the player clicked on and instead gets the item thats in their hand
Thanks to anyone that can help

Options:
Ban List: dragon egg, or monster spawners, or spawn eggs, or bedrock, or barriers, or command blocks
Extra Inventory Check: true
Item Removed Message: A Banned Item from your Inventory has been removed!

on load:
set {banneditems::*} to {@Ban List}

on drop:
loop {banneditems::*}:
remove event-item from player's inventory

on tool change:
if {banneditems::*} contains player's held item:
remove 64 of tool from player's tool
send action bar "{@Item Removed Message}" to player

on click:
if {banneditems::*} contains player's held item:
remove 64 of tool from player's tool
send action bar "{@Item Removed Message}" to player
 
There are multiple issues with your skript, this version should work and for future threads please format your code.

Code:
Options:
  ItemRemovedMessage: A Banned Item from your Inventory has been removed!

on load:
  clear {banneditems::*}
  add dragon egg to {banneditems::*}
  add barrier to {banneditems::*}
  #and so on

on drop:
  if {banneditems::*} contains event-item:
    cancel event
    remove event-item from player's inventory
    send action bar "{@ItemRemovedMessage}" to player

on tool change:
  if {banneditems::*} contains player's held item:
    set player's tool to air
    send action bar "{@ItemRemovedMessage}" to player

on click:
  if {banneditems::*} contains clicked item:
    set clicked item to air
    send action bar "{@ItemRemovedMessage}" to player
 
Status
Not open for further replies.