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.

How Do I make trap command? Help please!

Discussion in 'Skript' started by steveispog, Aug 30, 2022.

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

    steveispog Member

    Joined:
    Aug 30, 2022
    Messages:
    2
    Likes Received:
    0
    I want to make a trap command were you can do /trap <Player> <Time> and it puts glass all around then for a certain amount of time and then goes back to normal. I found my skript has some problems to it.

    1. If the player is jumping there is no floor because I dont know how to save block data and when the timer is up only half of the glass disapears

    2. The script is very long and anoyying to edit I asume there is a loop script to make it easier but I cant figure that out!

    My script:

    Code (Text):
    1. command /trap [<player>] [<text>]:
    2.     permission: troll.trap
    3.     permission message: &cYou dont have access!
    4.     usage: /trap <player> <seconds>
    5.     trigger:
    6.         set block 1 north of the arg-1 to glass
    7.         set block 1 block up north of the arg-1 to glass
    8.         set block 1 north of the arg-1 to glass
    9.         set block 1 block up east of the arg-1 to glass
    10.         set block 1 east of the arg-1 to glass
    11.         set block 1 block up south of the arg-1 to glass
    12.         set block 1 south of the arg-1 to glass
    13.         set block 1 block up west of the arg-1 to glass
    14.         set block 1 west of the arg-1 to glass
    15.         set block 2 blocks above the arg-1 to glass
    16.         wait "%arg-2% seconds" parsed as timespan
    17.         set block 1 north of the arg-1 to air
    18.         set block 1 block up north of the arg-1 to air
    19.         set block 1 north of the arg-1 to air
    20.         set block 1 block up east of the arg-1 to air
    21.         set block 1 east of the arg-1 to air
    22.         set block 1 block up south of the arg-1 to air
    23.         set block 1 south of the arg-1 to air
    24.         set block 1 block up west of the arg-1 to air
    25.         set block 1 west of the arg-1 to air
    26.         set block 2 blocks above the arg-1 to air
    As you can see its not ideal. Help would be awsome!
     
  2. lotzy

    lotzy Active Member

    Joined:
    Mar 15, 2022
    Messages:
    139
    Likes Received:
    22
    Code (Text):
    1. command /trap [<player>] [<number>]:
    2.   permission: troll.trap
    3.   permission message: &cYou dont have access!
    4.   usage: /trap <player> <seconds>
    5.   trigger:
    6.     set {_vecs::*} to (vector(0,-1,0)), (vector(0,2,0)), (vector(1,0,0)), (vector(-1,0,0)), (vector(0,0,1)), (vector(0,0,-1)), (vector(1,1,0)), (vector(-1,1,0)), (vector(0,1,1)), (vector(0,1,-1))
    7.     set {_loc} to location of block at arg-1
    8.     teleport arg-1 to {_loc}
    9.     loop {_vecs::*}:
    10.       set {_vecs::%loop-index%} to {_loc} ~ loop-value
    11.       set {_blocks::%loop-index%} to type of block at {_vecs::%loop-index%}
    12.       set block at {_vecs::%loop-index%} to glass
    13.     loop arg-2 times:
    14.       wait 1 second
    15.     loop {_vecs::*}:
    16.       set block at loop-value to {_blocks::%loop-index%}
     
    #2 lotzy, Sep 5, 2022
    Last edited: Sep 5, 2022
    • Like Like x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...