EDIT: Obvious fix here, I was just having a dull moment:
I have a particularly odd one here - I'm working on a custom GUI that lists a bunch of player's warps, and if one is clicked, a command is run to teleport the player there.
This isn't too complex, but I've hit a roadblock with:
The message shows up as (for example) "plwarp TestName", and if I run /plwarp TestName manually it works just fine... but the script executing the same command says that the warp does not exist.
Here's the plwarp command's code that's responsible for the teleporting:
It throws "Warp not found" every single time.
I've checked and there are no extra spaces or special characters that may be throwing it off as far as I can tell. Is there something different about item names when used as strings as opposed to a regular 'ole bit of text?
code_language.skript:
set {_warpName} to unformatted event-item's name
send "plwarp %{_warpName}%" to player
make player execute command "plwarp %{_warpName}%"
I have a particularly odd one here - I'm working on a custom GUI that lists a bunch of player's warps, and if one is clicked, a command is run to teleport the player there.
This isn't too complex, but I've hit a roadblock with:
code_language.skript:
set {_warpName} to event-item's name
send "plwarp %{_warpName}%" to player
make player execute command "plwarp %{_warpName}%"
The message shows up as (for example) "plwarp TestName", and if I run /plwarp TestName manually it works just fine... but the script executing the same command says that the warp does not exist.
Here's the plwarp command's code that's responsible for the teleporting:
code_language.skript:
if {playerWarps::*} contains arg-1:
if {playerWarps::%arg-1%::locked} is false:
send "Teleporting to %arg-1%..." to player
teleport player to {playerWarps::%arg-1%::location}
add 1 to {playerWarps::%arg-1%::visits}
else:
send "Warp not found..." to player
It throws "Warp not found" every single time.
I've checked and there are no extra spaces or special characters that may be throwing it off as far as I can tell. Is there something different about item names when used as strings as opposed to a regular 'ole bit of text?