@Auswahluhr6004 This may help; feel free to use it as it is, or as a reference.
code_language.skript:
function setSkin(playerSkin: text, player: player):
# if the desired playerSkin from a player is already online, it makes it a lot simpler
if ("%{_playerSkin}%" parsed as player) is online:
set {_desiredSkin} to skin texture of ("%{_playerSkin}%" parsed as player)
set displayed skin of {_player} for all players to {_desiredSkin}
else:
# get UUID
$ thread
set {_uuid} to text from "https://api.mojang.com/users/profiles/minecraft/%{_playerSkin}%"
# if the name given has been updated
if "%{_uuid}%" does not contain "%{_playerSkin}%":
$ thread
set {_uuid} to text from "https://api.mojang.com/users/profiles/minecraft/%{_playerSkin}%?at=0"
# splitting; the ID is {_uuidsplit::4}
# if you have skUtilities, you can also try its json value from text expression (but I had no luck)
set {_uuidsplit::*} to {_uuid} split at """"
# getting the skin textures
set {_skin} to text from "https://sessionserver.mojang.com/session/minecraft/profile/%{_uuidsplit::4}%?unsigned=false"
# splitting to obtain texture and signature
set {_skinsplit::*} to {_skin} split at """"
set displayed skin of {_player} for all players to skin texture with value "%{_skinsplit::22}%" signature "%{_skinsplit::14}%"
command /skinChange [<text="-info">] [<player=%player%>]:
trigger:
if arg 1 is "-info":
message "&9Commands for skinChange:"
message "&3Change your own skin:%nl% &b/skinChange <desiredNameOfSkin>%nl% &bExample: /skinChange Orendigo"
message "&3Change someone else's skin:%nl% &b/skinChange <desiredNameOfSkin> <playerToChange>%nl% &bExample: /skinChange CC007 Orendigo"
message "&3Reset your own skin:%nl% &b/skinChange -reset"
message "&3Reset someone else's skin:%nl% &b/skinChange -reset <playerToChange>%nl% &bExample: /skinChange -reset Orendigo"
message "&3Display this menu:%nl% &b/skinChange -info"
else if arg 1 is "-reset":
setSkin("%arg 2%", arg 2)
else:
setSkin(arg 1, arg 2)
Note: there's probably a more
efficient way to do the UUID stuff, but I went off of an older script I made a while ago.
I believe the only necessities to get it running is
MundoSK for the skin stuff, and Skript 2.2 for the functions usage