Teleporting sign

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

Famix

New Member
Jun 6, 2019
9
0
1
23
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:
on place:
    set {_l} to event-location
    loop 50 times:
        wait 1 second
        if line 1 is "sign place":
            if line 2 is set:
                set {_line} to line 2
                loop {warp::*}:
                    if {_line} is loop-value-2:
                        if player has permission "devt.admin":
                            set line 1 to "&8&lKlikni"
                            set line 2 to "&c&lTELEPORT"
                            set line 3 to "%{_line}%"
                            set line 4 to "&8&lKlikni"
                            add {_l} to {devt.sign::*}
                            send "{@prefix} &f|&7 Cedulka vytvorena"
                        else:
                            stop
on right click on sign:   
    set {_l} to event-location
    loop {devt.sign::*}:
        if {_l} is {devt.sign::*}:
            set {_w} to line 3
            teleport player to {warp.%{_w}%}

on break:
    set {_l} to event-location
    if player has permission "devt.admin":
        loop {devt.sign::*}:
            if {_l} is loop-value:
                remove loop-value from {devt.sign::*}
                send "{@prefix}&f |&7 Cedulka znicena!"
 
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:
on place:
    set {_l} to event-location
    loop 50 times:
        wait 1 second
        if line 1 is "sign place":
            if line 2 is set:
                set {_line} to line 2
                loop {warp::*}:
                    if {_line} is loop-value-2:
                        if player has permission "devt.admin":
                            set line 1 to "&8&lKlikni"
                            set line 2 to "&c&lTELEPORT"
                            set line 3 to "%{_line}%"
                            set line 4 to "&8&lKlikni"
                            add {_l} to {devt.sign::*}
                            send "{@prefix} &f|&7 Cedulka vytvorena"
                        else:
                            stop
on right click on sign:  
    set {_l} to event-location
    loop {devt.sign::*}:
        if {_l} is {devt.sign::*}:
            set {_w} to line 3
            teleport player to {warp.%{_w}%}

on break:
    set {_l} to event-location
    if player has permission "devt.admin":
        loop {devt.sign::*}:
            if {_l} is loop-value:
                remove loop-value from {devt.sign::*}
                send "{@prefix}&f |&7 Cedulka znicena!"
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
 
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?
[doublepost=1559896424,1559894494][/doublepost]
Code:
options:
    prefix : yourprefix

command /sswarp [<text>]:
    permission : warpset.sk
    trigger:
        set {warp::%arg-1%} to player's location
        message "warp %arg-1% set" to player

on sign change:
    set {_l} to event-location
    if event-player has permission "devt.admin":
        if line 1 is "sign place":
            if line 2 is set:
                set {_line2} to line 2
                loop {warp::*}:
                    if "%loop-index%" is  "%{_line2}%":
                        set line 1 to "&8&lKlikni"
                        set line 2 to "&c&lTELEPORT"
                        set line 3 to "%{_line2}%"
                        set line 4 to "&8&lKlikni"
                        add {_l} to {devt.sign::*}
                        send "{@prefix} &f|&7 Cedulka vytvorena"
                        stop

on right click on a sign:
    set {_l} to event-location
    loop {devt.sign::*}:
        if "%loop-value%" is "%{_l}%":
            set {_w} to line 3 of event-block
            teleport player to {warp::%{_w}%}

on break:
    set {_l} to event-location
    if player has permission "devt.admin":
        loop {devt.sign::*}:
            if loop-value is {_l}:
                # as you prefer
                #remove loop-value from {devt.sign::*}
                delete {devt.sign::%loop-index%}
                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!
 
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?
[doublepost=1559896424,1559894494][/doublepost]
Code:
options:
    prefix : yourprefix

command /sswarp [<text>]:
    permission : warpset.sk
    trigger:
        set {warp::%arg-1%} to player's location
        message "warp %arg-1% set" to player

on sign change:
    set {_l} to event-location
    if event-player has permission "devt.admin":
        if line 1 is "sign place":
            if line 2 is set:
                set {_line2} to line 2
                loop {warp::*}:
                    if "%loop-index%" is  "%{_line2}%":
                        set line 1 to "&8&lKlikni"
                        set line 2 to "&c&lTELEPORT"
                        set line 3 to "%{_line2}%"
                        set line 4 to "&8&lKlikni"
                        add {_l} to {devt.sign::*}
                        send "{@prefix} &f|&7 Cedulka vytvorena"
                        stop

on right click on a sign:
    set {_l} to event-location
    loop {devt.sign::*}:
        if "%loop-value%" is "%{_l}%":
            set {_w} to line 3 of event-block
            teleport player to {warp::%{_w}%}

on break:
    set {_l} to event-location
    if player has permission "devt.admin":
        loop {devt.sign::*}:
            if loop-value is {_l}:
                # as you prefer
                #remove loop-value from {devt.sign::*}
                delete {devt.sign::%loop-index%}
                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!
Thanks,
But it didnt work, i place sign write on it the text, and nothing happen. NO ERRORS
[doublepost=1559919699][/doublepost]
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
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
 
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?
[doublepost=1559920166,1559919847][/doublepost]working perfectly for me
 
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?
Try this ^
 
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?
[doublepost=1559920166,1559919847][/doublepost]working perfectly for me
My skript for warps:
Code:
command /setwarp [<Text>]:
    permission: shift.admin
    permission message: &4&lERROR! &7Nemas permisse! &8(Shift.Admin)
    trigger:
        if arg-1 is set:
            if {warp.%arg-1%} is not set:
                set {warp.%arg-1%} to player's location
                send "&c&lWARP &7Warp &a%arg-1%&7 byl nastaven!"
                add arg-1 to {warp::*}
            else:
                send "&4&lERROR! &7Warp jiz existuje!"
        else:
            send "&4&lERROR! &7Argument 1 neni nastaven!"
command /delwarp [<Text>]:
    permission: shift.admin
    permission message: &4&lERROR! &7Nemas permisse! &8(Shift.Admin)
    trigger:
        if arg 1 is set:
            if {warp.%arg-1%} is set:
                delete {warp.%arg-1%}
                send "&c&lWARP &7Warp byl odstranen!"
                remove arg-1 from {warp::*}
            else:
                send "&4&lERROR! &7Warp neni nastaven!"
        else:
            send "&4&lERROR! &7Argument 1 neni nastaven!"
command /warp [<Text>]:
    trigger:
        if {warp.%arg-1%} is set:
            teleport player to {warp.%arg-1%}
            send "&c&lWARP &7Byl jsi teleportovan!"
        if arg 1 is not set:
            make player execute command "warps"
command /warps:
    trigger:
        wait 5 ticks
        send "&c&lWARPY &7%{warp::*}%"
 
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..
[doublepost=1559941982,1559941830][/doublepost]Change in your warp system line 9..
Set {warp::%arg-1%} to player's location

Done this test my skript
 
I've made it, Thanks to all that helped me.​
Code:
on sign change:
    set {_l} to event-location
    if event-player has permission "devt.admin":
        if line 1 is "sign place":
            if line 2 is set:
                set {_line} to line 2
                if {warp.%{_line}%} is set:
                    set 1st line to "&8&lKlikni"
                    set 2nd line to "&c&lTELEPORT"
                    set 3rd line to "%{_line}%"
                    set 4th line to "&8&lKlikni"
                    add {_l} to {dev.sign::*}
                    send "{@prefix}&f | &7Cedulka vytvorena!"

on right click on sign:
    set {_line} to 3rd line
    loop {dev.sign::*}:
        if event-location is loop-value:
            teleport player to {warp.%{_line}%}

on break:
    if player has permission "devt.admin":
        if event-block is sign:
            if 1st line is "&8&lKlikni":
                loop {dev.sign::*}:
                    if event-location is loop-value:
                        remove loop-value from {dev.sign::*}
                        send "{@prefix}&f | &7Cedulka znicena!"
    else:
        cancel event
 
Status
Not open for further replies.