Help With 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.

jackass

Member
Nov 8, 2017
16
0
0
23
Hello! I will try to make this quick. So I have this skript, I will let it speak for itself.

on right click:
if faction at player is set:
if name of held item is "&b&l<> &9UNDETECTABLE &1&LBLOCK &b&l<>":
set block under player to bedrock
wait 5 seconds
set block to air
else:
cancel event
send "&d&l* &7You must be in a &dClaimed &7Land to place this!"

in the part

set block under player to bedrock
wait 5 seconds
set block to air

The "set block to air" does not work, as it does not affect the block that was set. I am looking for this to set the same block that was placed under the player, to air. If I changed it to "set block under player to air", than if the player moved it would set the block that is under the player after 5 seconds, rather than the block that was placed earlier in the sequence.
 
You need to define which block to set to air, such as event-block or the block under the player
[doublepost=1520052816,1520051597][/doublepost]OH... i think i figured this out for you

try this
code_language.skript:
on right click:
    if faction at player is set:
        if name of held item is "&b&l<> &9UNDETECTABLE &1&LBLOCK &b&l<>":
            set {_block} to location of block under player
            set block at location {_block} to bedrock
            wait 5 seconds
            set block at location {_block} to air
    else:
        cancel event
        send "&d&l* &7You must be in a &dClaimed &7Land to place this!"

##EDIT##
try this code instead
code_language.skript:
on right click:
    if faction at player is set:
        if name of held item is "&b&l<> &9UNDETECTABLE &1&LBLOCK &b&l<>":
            set {_block.loc} to location under player
            set block at {_block.loc} to bedrock
            wait 5 seconds
            set block at {_block.loc} to air
    else:
        cancel event
        send "&d&l* &7You must be in a &dClaimed &7Land to place this!"
 
Last edited:
Status
Not open for further replies.