Solved How can i hide and reveal a player with packets from himself

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

    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.
Mar 1, 2017
109
1
18
Hello,

my Question: How can i hide and reveal a player with packets from himself

Not with reveal player from (player) or somthing else.

- Thanks for every answer :emoji_slight_smile:
 
I don't understand. Why you would want to use packets for something so simple?
Just use le normal stuff:
code_language.skript:
command /vanish:
    aliases: /v
    trigger:
        if {vanish.%player%} is not set:
            hide the player from all players
            set {vanish.%player%} to true
        else
            reveal the player from all players
            delete {vanish.%player%}
 
I don't understand. Why you would want to use packets for something so simple?
Just use le normal stuff:
code_language.skript:
command /vanish:
    aliases: /v
    trigger:
        if {vanish.%player%} is not set:
            hide the player from all players
            set {vanish.%player%} to true
        else
            reveal the player from all players
            delete {vanish.%player%}
Because i would like to hide the player from himself
 
Because i would like to hide the player from himself
You can't really do that. There are some ways you can make the client destroy its own player, but the resulting behavior is super glitchy and the player won't be able to move or look around
 
You can't really do that. There are some ways you can make the client destroy its own player, but the resulting behavior is super glitchy and the player won't be able to move or look around
I mean for the load screen a the skin change :emoji_astonished:
 
No, but you can have the syntax
code_language.skript:
displayed skin of %player% [(for %-players%|excluding %-players%)]
Its sounds funny but... I can't understand xd Can u send me a example pls? :emoji_slight_smile:
 
reverse the to skin and excluding players and it should work
How can i reverse?
[doublepost=1499287876,1499286951][/doublepost]I searched in the internet but found nothing... Can u send me 1 row pls?
[doublepost=1499288262][/doublepost]
How can i reverse?
[doublepost=1499287876,1499286951][/doublepost]I searched in the internet but found nothing... Can u send me 1 row pls?
Are you mad at me? :emoji_frowning:
[doublepost=1499288584][/doublepost]My Code:
code_language.skript:
                set {_skin} to LadeSkin("load")
                set player's displayed skin to {_skin}
                reverses player's skin
                displayed skin of player excluding player

Please help me :emoji_frowning:
 
How can i reverse?
[doublepost=1499287876,1499286951][/doublepost]I searched in the internet but found nothing... Can u send me 1 row pls?
[doublepost=1499288262][/doublepost]
Are you mad at me? :emoji_frowning:
[doublepost=1499288584][/doublepost]My Code:
code_language.skript:
                set {_skin} to LadeSkin("load")
                set player's displayed skin to {_skin}
                reverses player's skin
                displayed skin of player excluding player

Please help me :emoji_frowning:
Just reverse the word order, like
code_language.skript:
set displayed skin of player excluding player to {_skin}
 
@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
 
@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
That code is gonna be pretty prone to console errors and it also doesn't account for rate limits, it also needs skquery
 
Status
Not open for further replies.