Help removing Items

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

Status
Not open for further replies.

GlaxFusion

Member
Feb 9, 2021
3
0
1
24
Hello, So Im trying to do something like a compressor of items.

The problem is that when It removes the cobblestone it also removes the given item, the Compressed Stone, I want to keep it and only remove the cobblestone.

(Srry for bad english)

Code:
on block break:
 if items in player's inventory contains 1 of beacon named "&a&lT1 Mineral Compressor":
  if player has 32 of cobblestone:     
   remove 32 of cobblestone from player's inventory
   give player 1 of glowing cobblestone named "&7&lCompressed Stone"
 
When removing cobblestone from the inventory of the player, Skript is not picky about whether or not the cobblestone it deletes is named "Compressed Stone" or if it is just normal cobblestone, it will simply delete the first 32 cobblestone in the player's inventory. To fix this problem, you must check whether or not the cobblestone is named "Compressed Stone" or just "Cobblestone".

To do this you will just have to remove 32 cobblestone named "cobblestone"

You can accomplish this with this skript:

Code:
on block break:
    event-block is cobblestone
    items in player's inventory contains 1 of beacon named "&a&lT1 Mineral Compressor":
    player has 32 cobblestone
    give player 1 of glowing cobblestone named "&7&lCompressed Stone"
    remove 32 of cobblestone named "Cobblestone" from player's inventory

EDIT:
This solution has an issue. The system counts compressed cobblestone towards the 32 cobblestone blocks to compress, but does not remove it. A check must be introduced when it counts the number of cobblestone in the player's inventory.
 
Last edited:
Status
Not open for further replies.