1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

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

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Simple Illegals Script

Discussion in 'Skript' started by JDButter, Jun 9, 2020.

Thread Status:
Not open for further replies.
  1. JDButter

    JDButter Member

    Joined:
    Jun 9, 2020
    Messages:
    4
    Likes Received:
    0
    Hi, I'm fairly new to Skripting and my code doesn't seem to work, I simply want a script that removes any Bedrock, Barriers, Command Blocks, Etc. Heres my messy code if you care to look through it.

    if players has a structure void or barrier or bedrock:
    wait 4 ticks
    remove all structure voids from the player
    remove all barriers from the player
    remove all bedrock from the player
    play sound "item.totem.use" with volume 10 to the player
    message "&6You cannot use those items and thus they have been replaced with different items."​
     
  2. Ubya

    Ubya Member

    Joined:
    Jun 15, 2020
    Messages:
    10
    Likes Received:
    0
    well your skript doesn't even have an event.

    i made a skript that does that, what i do is, on inventory open loop all items in the inventory, if the loop item is one of the items in an illegal items lost variable, remove that item.
     
  3. made an example:
    Code (Text):
    1. every tick:
    2.     loop all players:
    3.         if loop-player has structure void or barrier or bedrock:
    4.             remove all structure voids from the loop-player
    5.             remove all barriers from the loop-player
    6.             remove all bedrock from the loop-player
    7.             send "&cYour nice message." to loop-player
    not tested
    ~Paul
     
  4. Nikd0

    Nikd0 Active Member

    Joined:
    May 30, 2020
    Messages:
    208
    Likes Received:
    20
    Surely, this will work, but every tick event lag server so much! I would rather use multiple events:
    Code (Text):
    1. on inventory click:
    2.     if event-item is bedrock:
    3.         remove all of event-item from player
    4.     #etc...
    5. on drop:
    6.     #do the same
    7. on pickup:
    8.     #do the same
    Test it :emoji_wink:
     
    • Agree Agree x 1
  5. JDButter

    JDButter Member

    Joined:
    Jun 9, 2020
    Messages:
    4
    Likes Received:
    0
    Hi, Sorry for the late reply, This Script does not work. And gives 2 Errors.

    "Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line to start a section. (illegals.sk, line5: on drop:')"
    And
    "'of event-item' can't be removed from a player because the former is neither a potion nor an item type (illegals.sk line 3: remove all of event-item from player')
     
  6. Hypenexy

    Hypenexy New Member

    Joined:
    Jan 23, 2020
    Messages:
    7
    Likes Received:
    1
    It says empty configuration because you don't have an action at the end of something.
    Have you replaced "#do the same" with your action?
    Edit: also this isn't an error it's a warning
     
    • Like Like x 1
  7. JDButter

    JDButter Member

    Joined:
    Jun 9, 2020
    Messages:
    4
    Likes Received:
    0
    I've done that now, The same warning happens.
     
  8. Nikd0

    Nikd0 Active Member

    Joined:
    May 30, 2020
    Messages:
    208
    Likes Received:
    20
    Empty configuration section: Send us ur code, are you sure you've done everything right?
    Second error: Try replacing remove all of event-item from player with
    Code (Text):
    1. remove all event-item from player
    or something like this...
     
    • Like Like x 1
  9. JDButter

    JDButter Member

    Joined:
    Jun 9, 2020
    Messages:
    4
    Likes Received:
    0
    Heres my code:

    on inventory click:
    if event-item is bedrock:
    remove all of event-item from player
    send "&cPlaceholder..." to player
    on drop:
    if event-item is bedrock:
    remove all event-item from player
    on pickup:
    if event-item is bedrock:
    remove all event-item from player

    And I added that you said to add, It sorta works but leaves 1 piece of bedrock when being picked up, dropped, etc.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...