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.

Locations and coordinates/teleport

Discussion in 'Skript' started by Congraz, Oct 28, 2018.

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

    Congraz Member

    Joined:
    Oct 26, 2018
    Messages:
    45
    Likes Received:
    0
    Hallo!

    I'm having trouble with scripts. Some Locations and Coordinates / Teleport Scripts that I've been using. Would like a parkour that I have made can be put on some specific coordinates. So the blocks are being set at the coordinates. So when you write / event parkour the blocks will be put. After 5 minutes they will be removed again.
    It is a parkour with many blocks, so i hope that if i can right click with a string and then the coordinates will be add.
    Hope you can help.
    --
    on right click holding a string:
    set location of {pot.middle1} of player
    if {pot.middle1} is set:
    set location of {potmiddle2} of player

    command /event parkour:
    trigger:
    set block at location at {pot.middle1} of stone
    wait 1 seconds
    set block at location at {pot.middle2} of stone
    --- Double Post Merged, Oct 28, 2018, Original Post Date: Oct 28, 2018 ---
    Please help
    I Really need!
    --- Double Post Merged, Oct 29, 2018 ---
    Please can someone please answer! I really need this!
     
  2. Andalmere

    Andalmere Active Member

    Joined:
    Jan 28, 2017
    Messages:
    63
    Likes Received:
    11
    I am unsure that I understand you fully but I am posting this to help you.
    Code (Skript):
    1. on right click holding a string:
    2.     if {pot.tempvar} is not set:
    3.         set {pot.tempvar} to 1
    4.     loop {pot.middle::*}:
    5.         if loop-value is set:
    6.             stop
    7.     if {pot.middle::%{pot.tempvar}%} is not set:
    8.         set {pot.middle::%{pot.tempvar}%} to location of player
    9.  
    10. on command /event [<text>] [<text>]:
    11.     trigger:
    12.         if arg-1 is "parkour":
    13.             if arg-2 is "stop":
    14.                 delete {pot.spamprevent}
    15.                 send "The parkour event has ended."
    16.                 stop
    17.             if {pot.spamprevent} is set:
    18.                 send "Please don't spam /event parkour"
    19.                 stop
    20.             if {pot.spamprevent} is not set:
    21.                 set {pot.spamprevent} to true
    22.             loop {pot.middle::*}:
    23.                 set block at loop-value to stone
    24.                 wait 1 second
    25.             wait 5 minutes
    26.             if {pot.spamprevent} is set:
    27.                 loop {pot.middle::*}:
    28.                     set block at loop-value to air
    29.                     wait 1 second
    30.             delete {pot.spamprevent}
    Please be aware that this code is not tested and you must do this on a test server to see if it works. Poke me if you need further assistance.
     
  3. Congraz

    Congraz Member

    Joined:
    Oct 26, 2018
    Messages:
    45
    Likes Received:
    0
    Hallo Andalmere, and thanks for support. Ehem the scripts is working, but not the way i want it exacly. Ehmm i want it to. When i right click with string i add a location to the block i right click at. And there is like 44 blocks i need to do it with, but i can only with 1 here. I need to do it with more block, if that is possible. And then if i write /event parkour then the block spawn at the locations, and when the 5 minuts is over the blocks will automatic remove themself, and restor the same places again after 10 minuts.

    I really appreciate your support and help!
    Please if you can help me with this, that could be cool (;!
    Sorry for my english.
     
  4. Andalmere

    Andalmere Active Member

    Joined:
    Jan 28, 2017
    Messages:
    63
    Likes Received:
    11
    You can right click as many blocks as you can with my code. Anyways I changed the code according to your likings and this is what it looks like right now.
    Code (Skript):
    1. on right click holding a string:
    2.     if {pot.tempvar} is not set:
    3.         set {pot.tempvar} to 1
    4.     loop {pot.middle::*}:
    5.         if loop-value is set:
    6.             delete {pot.middle::%loop-index%}
    7.             send "&cSuccessfully removed the block from the parkour."
    8.     if {pot.middle::%{pot.tempvar}%} is not set:
    9.         set {pot.middle::%{pot.tempvar}%} to location of player
    10.         send "&aSuccessfully added the block from the parkour."
    11.        
    12. function parkour(t: text):
    13.     if {pot.spamprevent} is not set:
    14.         set {pot.spamprevent} to true
    15.     loop {pot.middle::*}:
    16.         set block at loop-value to stone
    17.         wait 1 second
    18.     wait 5 minutes
    19.     if {pot.spamprevent} is set:
    20.         loop {pot.middle::*}:
    21.             set block at loop-value to air
    22.             wait 1 second
    23.     wait 10 minutes
    24.     if {pot.spamprevent} is set:
    25.         parkour(terawevawevweav)
    26.        
    27. on command /event [<text>] [<text>]:
    28.     trigger:
    29.         if arg-1 is "parkour":
    30.             if arg-2 is "stop":
    31.                 delete {pot.spamprevent}
    32.                 send "The parkour event has ended."
    33.                 stop
    34.             if {pot.spamprevent} is set:
    35.                 send "Please don't spam /event parkour"
    36.                 stop
    37.             parkour(terawevawevweav)
    Again, the code is not tested and feel free to modify it. Also, it may require addons so make sure to download those.
     
  5. Congraz

    Congraz Member

    Joined:
    Oct 26, 2018
    Messages:
    45
    Likes Received:
    0
    Hallo again! and thanks for support once more! Ehmm but there was 2 fail ): upload_2018-10-30_16-56-1.png
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    put the text in quotes
    parkour("terawevawevweav")
     
    • Agree Agree x 1
  7. Congraz

    Congraz Member

    Joined:
    Oct 26, 2018
    Messages:
    45
    Likes Received:
    0
    Thanks for support everyone and help!

    But there is still a issue/fail with this skript. When you add a location you can still only add 1 location where the block is going to spawn, i need it too add more then 1 block. And when i right click with the string then it add the players location, I need it to add the location of the block i right click at.
    Once more, thanks for fast support, really nice!
     
  8. Andalmere

    Andalmere Active Member

    Joined:
    Jan 28, 2017
    Messages:
    63
    Likes Received:
    11
    I fixed that error from your screenshot and I added "stop" at line 8. Make sure to use "/event reset" without the quotes before trying this code again.
    Code (Skript):
    1. on right click holding a string:
    2.     if {pot.tempvar} is not set:
    3.         set {pot.tempvar} to 1
    4.     loop {pot.middle::*}:
    5.         if loop-value is set:
    6.             delete {pot.middle::%loop-index%}
    7.             send "&cSuccessfully removed the block from the parkour."
    8.             stop
    9.     if {pot.middle::%{pot.tempvar}%} is not set:
    10.         set {pot.middle::%{pot.tempvar}%} to location of player
    11.         send "&aSuccessfully added the block from the parkour."
    12.      
    13. function parkour(t: text):
    14.     if {pot.spamprevent} is not set:
    15.         set {pot.spamprevent} to true
    16.     loop {pot.middle::*}:
    17.         set block at loop-value to stone
    18.         wait 1 second
    19.     wait 5 minutes
    20.     if {pot.spamprevent} is set:
    21.         loop {pot.middle::*}:
    22.             set block at loop-value to air
    23.             wait 1 second
    24.     wait 10 minutes
    25.     if {pot.spamprevent} is set:
    26.         parkour("terawevawevweav")
    27.      
    28. on command /event [<text>] [<text>]:
    29.     trigger:
    30.         if arg-1 is "parkour":
    31.             if arg-2 is "stop":
    32.                 delete {pot.spamprevent}
    33.                 send "The parkour event has ended."
    34.                 stop
    35.             if {pot.spamprevent} is set:
    36.                 send "Please don't spam /event parkour"
    37.                 stop
    38.             parkour("terawevawevweav")
    39.         if arg-1 is "reset":
    40.             delete {pot.tempvar}
    41.             delete {pot.middle::*}
    42.             delete {pot.spamprevent}
    43.             send "Try to do it again and see if it works Congraz :)"
     
  9. Congraz

    Congraz Member

    Joined:
    Oct 26, 2018
    Messages:
    45
    Likes Received:
    0
    Hallo and thanks for help again!

    Bit it is still not working, when i set a location with the string, its only add 1 location, always the last location i set.
    --- Double Post Merged, Oct 31, 2018, Original Post Date: Oct 31, 2018 ---
    And 1 more thing, when i /sk reload events, then it is saying that it cant read "on command line 28" So i remove "on" so it was only command /event [<text>] [<text>]" i dont know if that is the reason o:
     
  10. Andalmere

    Andalmere Active Member

    Joined:
    Jan 28, 2017
    Messages:
    63
    Likes Received:
    11
    Lmao silly me sorry. I think this will now work.
    Code (Skript):
    1. on right click holding a string:
    2.     if {pot.tempvar} is not set:
    3.         set {pot.tempvar} to 1
    4.     loop {pot.middle::*}:
    5.         if loop-value is set:
    6.             delete {pot.middle::%loop-index%}
    7.             send "&cSuccessfully removed the block from the parkour."
    8.             stop
    9.     if {pot.middle::%{pot.tempvar}%} is not set:
    10.         set {pot.middle::%{pot.tempvar}%} to location of player
    11.         send "&aSuccessfully added the block from the parkour."
    12.         add 1 to {pot.tempvar}
    13.    
    14. function parkour(t: text):
    15.     if {pot.spamprevent} is not set:
    16.         set {pot.spamprevent} to true
    17.     loop {pot.middle::*}:
    18.         set block at loop-value to stone
    19.         wait 1 second
    20.     wait 5 minutes
    21.     if {pot.spamprevent} is set:
    22.         loop {pot.middle::*}:
    23.             set block at loop-value to air
    24.             wait 1 second
    25.     wait 10 minutes
    26.     if {pot.spamprevent} is set:
    27.         parkour("terawevawevweav")
    28.    
    29. command /event [<text>] [<text>]:
    30.     trigger:
    31.         if arg-1 is "parkour":
    32.             if arg-2 is "stop":
    33.                 delete {pot.spamprevent}
    34.                 send "The parkour event has ended."
    35.                 stop
    36.             if {pot.spamprevent} is set:
    37.                 send "Please don't spam /event parkour"
    38.                 stop
    39.             parkour("terawevawevweav")
    40.         if arg-1 is "reset":
    41.             delete {pot.tempvar}
    42.             delete {pot.middle::*}
    43.             delete {pot.spamprevent}
    44.             send "Try to do it again and see if it works Congraz :)"
    Just repeat the method above :emoji_slight_smile:
     
  11. Congraz

    Congraz Member

    Joined:
    Oct 26, 2018
    Messages:
    45
    Likes Received:
    0
    It dont know what i shald repeat above, and not o: So i can have more blocks

    And thanks for help again
     
  12. Andalmere

    Andalmere Active Member

    Joined:
    Jan 28, 2017
    Messages:
    63
    Likes Received:
    11
    Do /event reset, then try to add more blocks now using a string.
     
  13. Congraz

    Congraz Member

    Joined:
    Oct 26, 2018
    Messages:
    45
    Likes Received:
    0
    Hallo again!

    Ehm when i do it, the first is okay but if i right click at the next block, then it says "Deleted coordinate" and if i click again it says add, and if i /event parkour then it still only set 1 block at the last location i set.

    Again thanks for support and help!
     
  14. Andalmere

    Andalmere Active Member

    Joined:
    Jan 28, 2017
    Messages:
    63
    Likes Received:
    11
    Code (Skript):
    1. on right click holding a string:
    2.     if {pot.tempvar} is not set:
    3.         set {pot.tempvar} to 1
    4.     loop {pot.middle::*}:
    5.         if "%loop-value%" is "%location at event-block%":
    6.             delete {pot.middle::%loop-index%}
    7.             send "&cSuccessfully removed the block from the parkour."
    8.             stop
    9.     if {pot.middle::%{pot.tempvar}%} is not set:
    10.         set {pot.middle::%{pot.tempvar}%} to location of player
    11.         send "&aSuccessfully added the block from the parkour."
    12.         add 1 to {pot.tempvar}
    13.  
    14. function parkour(t: text):
    15.     if {pot.spamprevent} is not set:
    16.         set {pot.spamprevent} to true
    17.     loop {pot.middle::*}:
    18.         set block at loop-value to stone
    19.         wait 1 second
    20.     wait 5 minutes
    21.     if {pot.spamprevent} is set:
    22.         loop {pot.middle::*}:
    23.             set block at loop-value to air
    24.             wait 1 second
    25.     wait 10 minutes
    26.     if {pot.spamprevent} is set:
    27.         parkour("terawevawevweav")
    28.  
    29. command /event [<text>] [<text>]:
    30.     trigger:
    31.         if arg-1 is "parkour":
    32.             if arg-2 is "stop":
    33.                 delete {pot.spamprevent}
    34.                 send "The parkour event has ended."
    35.                 stop
    36.             if {pot.spamprevent} is set:
    37.                 send "Please don't spam /event parkour"
    38.                 stop
    39.             parkour("terawevawevweav")
    40.         if arg-1 is "reset":
    41.             delete {pot.tempvar}
    42.             delete {pot.middle::*}
    43.             delete {pot.spamprevent}
    44.             send "Try to do it again and see if it works Congraz :)"
    Do the /event reset and add blocks again.
     
  15. Congraz

    Congraz Member

    Joined:
    Oct 26, 2018
    Messages:
    45
    Likes Received:
    0
    Thanks for help again, and its working exacly what i want it to do, but there is a litte problem. Ehmm in the parkour we have more diffrence blocks, like ladder, and slap. Is it possible to add difrence blocks to the event
     
  16. Andalmere

    Andalmere Active Member

    Joined:
    Jan 28, 2017
    Messages:
    63
    Likes Received:
    11
    Yes, just make sure to right click the block first where the ladder is attached.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...