block breaking stopper skript

  • 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.
Oct 28, 2019
24
0
1
the allowing of blocks doesn't work but I can't figure out why
Code:
on break:
  if player does not have permission "break.all.block":
    if {%event-block%.lol} is not event-block:
      cancel event
command /allow [<text>]:
  permission: skript.staff
  trigger:
    if arg-1 is not set:
      send "&8correct usage:&7 /allow (block)"
    else:
      if {%arg-1%.lol} is set:
        send "&8%arg-1% &8not set as is already set"
      else:
        set {%arg-1%.lol} to arg-1
        send "&8%arg-1% &8is set" to player

command /delete [<text>]:
  permission: skript.staff
  trigger:
    if arg-1 is not set:
      send "&8correct usage:&7 /delete (block)"
    else:
      if {%arg-1%.lol} is set:
        delete {%arg-1%.lol}
      else:
        send "&8%arg-1% &8not deleted as is not set"
there is no errors but nothing changes when i add something to the allow list do i have to add another argument?
 
Based on your code (EXAMPLE)
code_language.skript:
on break:
    set {_b} to "%event-block%"
    if {%{_b}%.lol} is set:
        cancel event

# OR

on break:
    set {_b} to "%event-block%"
    if {%{_b}%.lol} is {_b}:
        cancel event
You need to change event-block to a string to be able to compare it with your checker.

I would also recommend that you use a list for this instead of setting separate variables per block.
 
Last edited:
You're doing it wrong in so many ways...

code_language.skript:
command /allow [<text>]:
    trigger:
        if player has permission "staff.allow.blocks":
            set {block} to arg-1

on break:
    if {block} is not event-block:
        cancel event
Actually you did it wrong lol. The way you have it, it wouldn't work because you cannot compare a string with event-block unless you made event-block a string. You also made it to where he can only use it for one block type. I am assuming he wants multiple types so he has to set a unique variable for each block hence why he named part of the variable arg 1.
 
Status
Not open for further replies.