スキンが変更されない2

TCT-plusにあやかって、妖狐の変身アイテムを実装してます
if name of clicked inventory is "TCTショップ":

else if name of clicked inventory is "変身先を選んでください":
cancel event
if {TCT_Game} is true:
if {Chosen_fox::*} contains player:
set {_p} to uncolored name of clicked item parsed as offline player
send request to "https://api.mineskin.org/generate/user/%uuid of {_p}%"
set {_res} to response
map json body of {_res} to {_json::*}
set {_value} to {_json::data::texture::value}
set {_signature} to {_json::data::texture::signature}
set {_skin} to new player skin with value {_value} signature {_signature}
set player's displayed player skin to {_skin}
if name of clicked inventory is "TCTショップ":

else if name of clicked inventory is "変身先を選んでください":
cancel event
if {TCT_Game} is true:
if {Chosen_fox::*} contains player:
set {_p} to uncolored name of clicked item parsed as offline player
send request to "https://api.mineskin.org/generate/user/%uuid of {_p}%"
set {_res} to response
map json body of {_res} to {_json::*}
set {_value} to {_json::data::texture::value}
set {_signature} to {_json::data::texture::signature}
set {_skin} to new player skin with value {_value} signature {_signature}
set player's displayed player skin to {_skin}
open chest inventory with 3 row named "変身先を選んでください" to player
set slot 0 of player's current inventory to fern named "Fyllo"
open chest inventory with 3 row named "変身先を選んでください" to player
set slot 0 of player's current inventory to fern named "Fyllo"
クリックしたアイテムからプレイヤー名をとって、そこからuuidを取得し、requestに入れてます。 {_p}もuuid of {_p}もちゃんと入っています。 変身するところも最後まで動いていますが、やはり自分のスキンに変身してしまいます。 原因がわかったら教えてほしいです。 追記: コードは https://discord.com/channels/545926404785569793/1186223535295836270 を丸パクリしました
Solution:
Reqnを使っている場合はよく一時変数がぶっ壊れて使えなくなります。 恐らく uuid of {po} などのグローバル変数にしたら治るかと...
Jump to solution
12 Replies
tanoKun
tanoKun11mo ago
pr?
gladiolus8789
gladiolus8789OP11mo ago
PR(1.12.2)です 環境書き忘れてました すいません アドオンは SkRage使ってます
tanoKun
tanoKun11mo ago
自分の目線f5では変わってないだけとかではない?
gladiolus8789
gladiolus8789OP11mo ago
command /skin [<offline player>]:
trigger:
if arg-1 is set:
send request to "https://api.mineskin.org/generate/user/%uuid of arg-1%"
set {_res} to response
map json body of {_res} to {_json::*}
set {_value} to {_json::data::texture::value}
set {_signature} to {_json::data::texture::signature}
# set {_skin} to skin with value {_value} signature {_signature}
set {_skin} to new player skin with value {_value} signature {_signature}
set player's displayed player skin to {_skin}
else:
send request to "https://api.mineskin.org/generate/user/%player's uuid%"
set {_res} to response
map json body of {_res} to {_json::*}
set {_value} to {_json::data::texture::value}
set {_signature} to {_json::data::texture::signature}
set {_skin} to new player skin with value {_value} signature {_signature}
set player's displayed player skin to {_skin}
command /skin [<offline player>]:
trigger:
if arg-1 is set:
send request to "https://api.mineskin.org/generate/user/%uuid of arg-1%"
set {_res} to response
map json body of {_res} to {_json::*}
set {_value} to {_json::data::texture::value}
set {_signature} to {_json::data::texture::signature}
# set {_skin} to skin with value {_value} signature {_signature}
set {_skin} to new player skin with value {_value} signature {_signature}
set player's displayed player skin to {_skin}
else:
send request to "https://api.mineskin.org/generate/user/%player's uuid%"
set {_res} to response
map json body of {_res} to {_json::*}
set {_value} to {_json::data::texture::value}
set {_signature} to {_json::data::texture::signature}
set {_skin} to new player skin with value {_value} signature {_signature}
set player's displayed player skin to {_skin}
こっちでやるとちゃんと変わります。(inventory click のときだけ自分視点が変わらないとかならあれですが)
tanoKun
tanoKun11mo ago
あ Offline playerとonline playerのuuid違うわ 普通に as@player じゃだめなん
gladiolus8789
gladiolus8789OP11mo ago
if {TCT_Game} is true:
if {Chosen_fox::*} contains player:
set {_p} to uncolored name of clicked item parsed as player
set {_po} to uncolored name of clicked item parsed as offline player
send "ONLINE %{_p}% %uuid of {_p}%"
send "OFFLINE %{_po}% %uuid of {_po}%"
send request to "https://api.mineskin.org/generate/user/%uuid of {_po}%"
set {_res} to response
map json body of {_res} to {_json::*}
set {_value} to {_json::data::texture::value}
set {_signature} to {_json::data::texture::signature}
set {_skin} to new player skin with value {_value} signature {_signature}
set player's displayed player skin to {_skin}
if {TCT_Game} is true:
if {Chosen_fox::*} contains player:
set {_p} to uncolored name of clicked item parsed as player
set {_po} to uncolored name of clicked item parsed as offline player
send "ONLINE %{_p}% %uuid of {_p}%"
send "OFFLINE %{_po}% %uuid of {_po}%"
send request to "https://api.mineskin.org/generate/user/%uuid of {_po}%"
set {_res} to response
map json body of {_res} to {_json::*}
set {_value} to {_json::data::texture::value}
set {_signature} to {_json::data::texture::signature}
set {_skin} to new player skin with value {_value} signature {_signature}
set player's displayed player skin to {_skin}
結果 https://gyazo.com/c4dccaa61213454861bc04aa1a26a67a
Gyazo
Gyazo
gladiolus8789
gladiolus8789OP11mo ago
自分以外にプレイヤーがいたらいけますかね? Fylloって人PRにいないので
gladiolus8789
gladiolus8789OP11mo ago
試してきました
No description
gladiolus8789
gladiolus8789OP11mo ago
だめでした uuid of {_p}のところをUUIDを直接入力してやったらうまくいきます。 send request to "https://api.mineskin.org/generate/user/84e5a069-3913-4ce6-8424-541673953066" -> OK ですが %uuid of {_po}%にした途端うまくいかなくなります。
Solution
Yeahn
Yeahn11mo ago
Reqnを使っている場合はよく一時変数がぶっ壊れて使えなくなります。 恐らく uuid of {po} などのグローバル変数にしたら治るかと
gladiolus8789
gladiolus8789OP11mo ago
グローバル変数にしたら直りました!! ありがとうございます!!
Want results from more Discord servers?
Add your server