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

Teleporting sign

Discussion in 'Skript' started by Famix, Jun 6, 2019.

Tags:
Thread Status:
Not open for further replies.
  1. Famix

    Famix Member

    Joined:
    Jun 6, 2019
    Messages:
    5
    Likes Received:
    0
    Hello!
    I need help,
    When i create 1 sign it is working, but when i create second it dont work. In console and on reload errors didnt appear.​
    Code (Text):
    1. on place:
    2.     set {_l} to event-location
    3.     loop 50 times:
    4.         wait 1 second
    5.         if line 1 is "sign place":
    6.             if line 2 is set:
    7.                 set {_line} to line 2
    8.                 loop {warp::*}:
    9.                     if {_line} is loop-value-2:
    10.                         if player has permission "devt.admin":
    11.                             set line 1 to "&8&lKlikni"
    12.                             set line 2 to "&c&lTELEPORT"
    13.                             set line 3 to "%{_line}%"
    14.                             set line 4 to "&8&lKlikni"
    15.                             add {_l} to {devt.sign::*}
    16.                             send "{@prefix} &f|&7 Cedulka vytvorena"
    17.                         else:
    18.                             stop
    19. on right click on sign:  
    20.     set {_l} to event-location
    21.     loop {devt.sign::*}:
    22.         if {_l} is {devt.sign::*}:
    23.             set {_w} to line 3
    24.             teleport player to {warp.%{_w}%}
    25.  
    26. on break:
    27.     set {_l} to event-location
    28.     if player has permission "devt.admin":
    29.         loop {devt.sign::*}:
    30.             if {_l} is loop-value:
    31.                 remove loop-value from {devt.sign::*}
    32.                 send "{@prefix}&f |&7 Cedulka znicena!"
     
  2. TPGamesNL

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    1,311
    Likes Received:
    73
    Medals:
    Explain `it don't work`. Which part doesn't work? Does it format the sign correctly? Can you click the sign? Does it teleport you? Add debug messages to see which parts are working and which aren't
     
  3. BowYard

    BowYard Active Member

    Joined:
    Nov 2, 2017
    Messages:
    40
    Likes Received:
    0
    Uhm.. you're looping a list (line 21) and after you compare {_l} (the location of the clicked sign) with the entire list.
    Could be this the problem?
    --- Double Post Merged, Jun 7, 2019, Original Post Date: Jun 7, 2019 ---
    Code (Text):
    1. options:
    2.     prefix : yourprefix
    3.  
    4. command /sswarp [<text>]:
    5.     permission : warpset.sk
    6.     trigger:
    7.         set {warp::%arg-1%} to player's location
    8.         message "warp %arg-1% set" to player
    9.  
    10. on sign change:
    11.     set {_l} to event-location
    12.     if event-player has permission "devt.admin":
    13.         if line 1 is "sign place":
    14.             if line 2 is set:
    15.                 set {_line2} to line 2
    16.                 loop {warp::*}:
    17.                     if "%loop-index%" is  "%{_line2}%":
    18.                         set line 1 to "&8&lKlikni"
    19.                         set line 2 to "&c&lTELEPORT"
    20.                         set line 3 to "%{_line2}%"
    21.                         set line 4 to "&8&lKlikni"
    22.                         add {_l} to {devt.sign::*}
    23.                         send "{@prefix} &f|&7 Cedulka vytvorena"
    24.                         stop
    25.  
    26. on right click on a sign:
    27.     set {_l} to event-location
    28.     loop {devt.sign::*}:
    29.         if "%loop-value%" is "%{_l}%":
    30.             set {_w} to line 3 of event-block
    31.             teleport player to {warp::%{_w}%}
    32.  
    33. on break:
    34.     set {_l} to event-location
    35.     if player has permission "devt.admin":
    36.         loop {devt.sign::*}:
    37.             if loop-value is {_l}:
    38.                 # as you prefer
    39.                 #remove loop-value from {devt.sign::*}
    40.                 delete {devt.sign::%loop-index%}
    41.                 send "{@prefix}&f |&7 Cedulka znicena!"
    so this is my code.
    there was many errors in this skript..
    starting from the creation...
    you loops 50 times... WHY? use the sign change event. because when you place a sign and write some text you're changing it.
    the other error...
    this is your warp's list :
    {warp::NAME OF WARP} (value = warp's location)..
    so why at line 9 you compare the 2nd line of the sign with the loop value?? you need to compare with the loop-index, that is the name of the warp, and not the location.
    other error at line 24.. your is a list of warp, not a variable.. you had put "teleport player to {warp.%{_w}%}" and not "to {warp::%{_w}%}".
    hope you understand something!
     
  4. Famix

    Famix Member

    Joined:
    Jun 6, 2019
    Messages:
    5
    Likes Received:
    0
    Thanks,
    But it didnt work, i place sign write on it the text, and nothing happen. NO ERRORS
    --- Double Post Merged, Jun 7, 2019 ---
    Thanks for reply,

    When i create one sign its normal, teleports you. Views the text i wrote, but when i create second sign the firt stop working and second too. It dont teleports you but shows the text
     
  5. BowYard

    BowYard Active Member

    Joined:
    Nov 2, 2017
    Messages:
    40
    Likes Received:
    0
    Can i get your command that sets the warp?

    You have to set the warp and on a sign:
    Line one = sign place
    Line 2 = name of warp
    Right?
    --- Double Post Merged, Jun 7, 2019, Original Post Date: Jun 7, 2019 ---
    working perfectly for me
     
  6. TPGamesNL

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    1,311
    Likes Received:
    73
    Medals:
    Try this ^
     
  7. Famix

    Famix Member

    Joined:
    Jun 6, 2019
    Messages:
    5
    Likes Received:
    0
    My skript for warps:
    Code (Text):
    1. command /setwarp [<Text>]:
    2.     permission: shift.admin
    3.     permission message: &4&lERROR! &7Nemas permisse! &8(Shift.Admin)
    4.     trigger:
    5.         if arg-1 is set:
    6.             if {warp.%arg-1%} is not set:
    7.                 set {warp.%arg-1%} to player's location
    8.                 send "&c&lWARP &7Warp &a%arg-1%&7 byl nastaven!"
    9.                 add arg-1 to {warp::*}
    10.             else:
    11.                 send "&4&lERROR! &7Warp jiz existuje!"
    12.         else:
    13.             send "&4&lERROR! &7Argument 1 neni nastaven!"
    14. command /delwarp [<Text>]:
    15.     permission: shift.admin
    16.     permission message: &4&lERROR! &7Nemas permisse! &8(Shift.Admin)
    17.     trigger:
    18.         if arg 1 is set:
    19.             if {warp.%arg-1%} is set:
    20.                 delete {warp.%arg-1%}
    21.                 send "&c&lWARP &7Warp byl odstranen!"
    22.                 remove arg-1 from {warp::*}
    23.             else:
    24.                 send "&4&lERROR! &7Warp neni nastaven!"
    25.         else:
    26.             send "&4&lERROR! &7Argument 1 neni nastaven!"
    27. command /warp [<Text>]:
    28.     trigger:
    29.         if {warp.%arg-1%} is set:
    30.             teleport player to {warp.%arg-1%}
    31.             send "&c&lWARP &7Byl jsi teleportovan!"
    32.         if arg 1 is not set:
    33.             make player execute command "warps"
    34. command /warps:
    35.     trigger:
    36.         wait 5 ticks
    37.         send "&c&lWARPY &7%{warp::*}%"
    38.  
     
  8. BowYard

    BowYard Active Member

    Joined:
    Nov 2, 2017
    Messages:
    40
    Likes Received:
    0
    Oh ok..
    I've done my skript with a list that have
    Index = name of warp
    Value = warp's location...
    Idk why you create a variable for the warp and create also an instance in a list..
    --- Double Post Merged, Jun 7, 2019, Original Post Date: Jun 7, 2019 ---
    Change in your warp system line 9..
    Set {warp::%arg-1%} to player's location

    Done this test my skript
     
  9. Famix

    Famix Member

    Joined:
    Jun 6, 2019
    Messages:
    5
    Likes Received:
    0
    I've made it, Thanks to all that helped me.​
    Code (Text):
    1. on sign change:
    2.     set {_l} to event-location
    3.     if event-player has permission "devt.admin":
    4.         if line 1 is "sign place":
    5.             if line 2 is set:
    6.                 set {_line} to line 2
    7.                 if {warp.%{_line}%} is set:
    8.                     set 1st line to "&8&lKlikni"
    9.                     set 2nd line to "&c&lTELEPORT"
    10.                     set 3rd line to "%{_line}%"
    11.                     set 4th line to "&8&lKlikni"
    12.                     add {_l} to {dev.sign::*}
    13.                     send "{@prefix}&f | &7Cedulka vytvorena!"
    14.  
    15. on right click on sign:
    16.     set {_line} to 3rd line
    17.     loop {dev.sign::*}:
    18.         if event-location is loop-value:
    19.             teleport player to {warp.%{_line}%}
    20.  
    21. on break:
    22.     if player has permission "devt.admin":
    23.         if event-block is sign:
    24.             if 1st line is "&8&lKlikni":
    25.                 loop {dev.sign::*}:
    26.                     if event-location is loop-value:
    27.                         remove loop-value from {dev.sign::*}
    28.                         send "{@prefix}&f | &7Cedulka znicena!"
    29.     else:
    30.         cancel event
    31.  
     
Thread Status:
Not open for further replies.
Loading...