Solved If using named item for craft , cancel event

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

Flowy

New Member
May 29, 2020
6
0
1
24
if use item named "something" for craft , i want to cancel it
can u guys help me please?
like this:

on craft wood:
if using any log named "Something":
cancel event
 
Code:
on craft of (item):
    loop 9 times:
        if slot loop-number of event-inventory is (item) named "Name":
            cancel event
[doublepost=1590881707,1590881633][/doublepost]This is gonna work only on crafting tables.
[doublepost=1590881912][/doublepost]I think I found a way to make it work on both crafting tables and inventory craft:
Code:
on craft of (item):
    if type of player's current inventory is "WORKBENCH":
        loop 9 times:
            if slot loop-number of player's current inventory is (item) named "Name":
                cancel event
    else if type of player's current inventory is "CRAFTING":
        loop 4 times:
            if slot loop-number of player's current inventory is (item) named "Name":
                cancel event
 
Status
Not open for further replies.