Problems Listing all Existing Warps.

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

Nov 18, 2023
1
0
1
26
I'm making a public warp system for fun using chatgpt (i suck at coding)

but for some reason everytime it tries making a skript to list all existing warps it prints <none> every time.

Here's the skript:
command /setwarp <text>:
permission: warps.admin
trigger:
set {_warpName} to arg-1
set {_warpLocation} to location of player
set {warps::%{_warpName}%} to {_warpLocation}
add "{_warpName}" to {warpNames::*}
send "&3Warp &b%{_warpName}% &3has been set to your location."

command /delwarp <text>:
permission: warps.admin
trigger:
set {_warpName} to arg-1
if {warps::%{_warpName}%} is set:
delete {warps::%{_warpName}%}
remove "{_warpName}" from {warpNames::*}
send "&3Warp &b%{_warpName}% &3has been removed."
else:
send "&3Warp &b%{_warpName}% &3does not exist."

-- the problem:

command /warps:
permission: warps.admin
trigger:
send "&3Existing Warps:"
set {_existingWarps} to ""
loop {warpNames::*}:
add "%loop-value%" to {_existingWarps}
if {_existingWarps} is "":
send "&bNone"
else:
send "&bExisting Warps: {_existingWarps}"

--------------------------------------------------------------------
any help is greatly appreciated! thanks!
 
You can try this:
Code:
command /warps:
    permission: warps.admin
    trigger:
        send "&3Existing Warps:"
        loop {warpNames::*}:
            add loop-value to {existingWarps::*}
        if size of {existingWarps::*} is more than 0:
            send "&bExisting Warps: %{existingWarps::*}%"
        else:
            send "&bNone" to player