Simple Illegals Script

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

JDButter

Member
Jun 9, 2020
4
0
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."​
 
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.
 
made an example:
Code:
every tick:
    loop all players:
        if loop-player has structure void or barrier or bedrock:
            remove all structure voids from the loop-player
            remove all barriers from the loop-player
            remove all bedrock from the loop-player
            send "&cYour nice message." to loop-player

not tested
~Paul
 
made an example:
Code:
every tick:
    loop all players:
        if loop-player has structure void or barrier or bedrock:
            remove all structure voids from the loop-player
            remove all barriers from the loop-player
            remove all bedrock from the loop-player
            send "&cYour nice message." to loop-player

not tested
~Paul
Surely, this will work, but every tick event lag server so much! I would rather use multiple events:
Code:
on inventory click:
    if event-item is bedrock:
        remove all of event-item from player
    #etc...
on drop:
    #do the same
on pickup:
    #do the same
Test it :emoji_wink:
 
Surely, this will work, but every tick event lag server so much! I would rather use multiple events:
Code:
on inventory click:
    if event-item is bedrock:
        remove all of event-item from player
    #etc...
on drop:
    #do the same
on pickup:
    #do the same
Test it :emoji_wink:
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')
 
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
Reactions: Nikd0
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
I've done that now, The same warning happens.
 
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:
remove all event-item from player
or something like this...
 
  • Like
Reactions: JDButter
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:
remove all event-item from player
or something like this...
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.
 
Status
Not open for further replies.