Player Vanish

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

Status
Not open for further replies.
Apr 9, 2017
28
1
0
36
Skript Version:
Skript Author:
Minecraft Version:

---
Full Code:
Note: If the code is too large, feel free to use a pasting website (Pastebin or hastebin)
Note: If a variable is being set in another script, but not shown, please explain how they are being set


code_language.skript:
function settingsSystem(p: player , t: number) :: number:
    if {_t} is 1:
        if {cubecraft.settings.pv.%{_p}%} is 2:
            set {cubecraft.settings.pv.%{_p}%} to 1
            hide all players from {_p}
        else if {cubecraft.settings.pv.%{_p}%} is 1:
            set {cubecraft.settings.pv.%{_p}%} to 3
            hide all players from {_p}
        else:
            if {cubecraft.settings.pv.%{_p}%} is 3:
                set {cubecraft.settings.pv.%{_p}%} to 2
            reveal all players from {_p}

Errors on Reload:

code_language.skript:
None

Console Errors: (if applicable)

code_language.skript:
None

Other Useful Info:

Don't know how to do this but I want it so that if players have a permission it hides everyone but the people with the permission. So I will have a friend command soon and it will give them something like friend.%player% and so the permission that it will not hide players will be that. Also, can you update a chest gui without having to close it?

Addons using (including versions):
ADDONS HERE

Troubleshooting:

Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
 
Last edited:
code_language.skript:
loop all players:
    loop-player doesn't have permission "blabla"
    add loop-player to {_p::*}
hide {_p::*} from {_p}

You can update a GUI without closing it.
 
Awesome, thanks @Duetro And how would I update it?
 
Last edited by a moderator:
@Duetro The items. What I have now is when I click the item it closes and when you open it back up it the item is different and want it to change the item and keep the GUI open
 
@LimeGlass
code_language.skript:
#Settings

function settingsSystem(p: player , t: number) :: number:
    if {_t} is 1:
        if {cubecraft.settings.pv.%{_p}%} is 3:
            set {cubecraft.settings.pv.%{_p}%} to 2
            set {_p} to player
            loop all players:
                loop-player doesn't have permission ""
                add loop-player to {_p::*}
                hide {_p::*} from {_p}
        else if {cubecraft.settings.pv.%{_p}%} is 2:
            set {cubecraft.settings.pv.%{_p}%} to 1
            hide all players from {_p}
        else:
            if {cubecraft.settings.pv.%{_p}%} is 1:
                set {cubecraft.settings.pv.%{_p}%} to 3
            reveal all players from {_p}
    else if {_t} is 2:
        if {cubecraft.pref.pc.%{_p}%} is true:
            set {cubecraft.pref.pc.%{_p}%} to false
        else:
            set {cubecraft.pref.pc.%{_p}%} to true
    else if {_t} is 3:
        if {cubecraft.pref.pm.%{_p}%} is true:
            set {cubecraft.pref.pm.%{_p}%} to false
        else:
            set {cubecraft.pref.pm.%{_p}%} to true
    else if {_t} is 4:
        if {cubecraft.pref.gwen.%{_p}%} is true:
            set {cubecraft.pref.gwen.%{_p}%} to false
        else:
            set {cubecraft.pref.gwen.%{_p}%} to true
    else if {_t} is 5:
        if {cubecraft.pref.report.%{_p}%} is true:
            set {cubecraft.pref.report.%{_p}%} to false
        else:
            set {cubecraft.pref.report.%{_p}%} to true
    else if {_t} is 6:
        if {cubecraft.pref.ff.%{_p}%} is true:
            set {cubecraft.pref.ff.%{_p}%} to false
        else:
            set {cubecraft.pref.ff.%{_p}%} to true
    else if {_t} is 7:
        if {cubecraft.ff.%{_p}%} is true:
            set {cubecraft.ff.%{_p}%} to false
            delete {cubecraft.ff.list::%{_p}%}
        else:
            set {cubecraft.ff.%{_p}%} to true
            set {cubecraft.ff.list::%{_p}%} to true


command /settings:
    trigger:
        set {_s} to "Steve" parsed as offline player
        open chest with 5 rows named "         &nUser Preferences" to player
        wait 1 tick
        #Visibility
        if {cubecraft.settings.pv.%player%} is 3:
            format slot 1 of player with eye of ender named "&aPlayer visibility - EVERYONE" with lore "&7Toggle who you can see in lobbies.||&6Click to toggle!" to close then run [settingsSystem(player, 1)]
        else if {cubecraft.settings.pv.%player%} is 2:
            format slot 1 of player with eye of ender named "&6Player visibility - FRIENDS + PARTY" with lore "&7Toggle who you can see in lobbies.||&6Click to toggle!" to close then run [settingsSystem(player, 1)]
        else if {cubecraft.settings.pv.%player%} is 1:
            format slot 1 of player with eye of ender named "&4Player visibility - NOBODY" with lore "&7Toggle who you can see in lobbies.||&6Click to toggle!" to close then run [settingsSystem(player, 1)]
        if {cubecraft.settings.pv.%player%} is 3:
            format slot 10 of player with green stained glass pane named "&aPlayer visibility - EVERYONE" with lore "&7Toggle who you can see in lobbies.||&6Click to toggle!" to close then run [settingsSystem(player, 1)]
        else if {cubecraft.settings.pv.%player%} is 2:
            format slot 10 of player with orange stained glass pane named "&6Player visibility - FRIENDS + PARTY" with lore "&7Toggle who you can see in lobbies.||&6Click to toggle!" to close then run [settingsSystem(player, 1)]
        else if {cubecraft.settings.pv.%player%} is 1:
            format slot 10 of player with red stained glass pane named "&4Player visibility - NOBODY" with lore "&7Toggle who you can see in lobbies.||&6Click to toggle!" to close then run [settingsSystem(player, 1)]

 #Chat
        if {cubecraft.pref.pc.%player%} is true:
            format slot 5 of player with paper named "&aReceive chat - ALLOWED" with lore "&7Receive chat in the lobbies.||&6Click to deny" to close then run [settingsSystem(player, 2)]
        else:
            format slot 5 of player with paper named "&aReceive chat - DENIED" with lore "&7Receive chat in the lobbies.||&6Click to allow" to close then run [settingsSystem(player, 2)]
        if {cubecraft.pref.pc.%player%} is true:
            format slot 14 of player with lime stained glass pane named "&aReceive chat - ALLOWED" with lore "&7Receive chat in the lobbies.||&6Click to deny" to close then run [settingsSystem(player, 2)]
        else:
            format slot 14 of player with red stained glass pane named "&aReceive chat - DENIED" with lore "&7Receive chat in the lobbies.||&6Click to allow" to close then run [settingsSystem(player, 2)] 
        
on right click:
    if name of player's tool is "&6&kii&5&lSettings&6&kii":
        execute player command "/settings"
command /setsettings <string> [<string>]:
    usage: &9Do /setsettings <settings> <number>
    permission: op
    permission message: &9Permissions> &7This requires Permission Rank [&9OP&7].
    trigger:
        if argument 1 is "pv":
            if argument 2 is "1":
                set {cubecraft.settings.pv.%player%} to 1
                send "&9Chat> &7PV set to 1."
            else if argument 2 is "2":
                set {cubecraft.settings.pv.%player%} to 2
                send "&9Chat> &7PV set to 2."
            else:
                if argument 2 is "3":
                    set {cubecraft.settings.pv.%player%} to 3
                    send "&9Chat> &7PV set to 3."
 
What exactly do you want to happen when you do what?

You can format the slots everywhere, not just after a open chest effect. To clear the inventory, just set every slot to air, and then format the slots again.
 
@Duetro When I click on the item in the chest gui it will run the function then it will change the item to something else
 
Try this:

code_language.skript:
#Settings
 
function settingsSystem(p: player , t: number) :: number:
    if {_t} is 1:
        if {cubecraft.settings.pv.%{_p}%} is 3:
            set {cubecraft.settings.pv.%{_p}%} to 2
            loop all players:
                loop-player doesn't have permission ""
                add loop-player to {_p::*}
                hide {_p::*} from {_p}
        else if {cubecraft.settings.pv.%{_p}%} is 2:
            set {cubecraft.settings.pv.%{_p}%} to 1
            hide all players from {_p}
        else:
            if {cubecraft.settings.pv.%{_p}%} is 1:
                set {cubecraft.settings.pv.%{_p}%} to 3
            reveal all players from {_p}
    else if {_t} is 2:
        if {cubecraft.pref.pc.%{_p}%} is true:
            set {cubecraft.pref.pc.%{_p}%} to false
        else:
            set {cubecraft.pref.pc.%{_p}%} to true
    else if {_t} is 3:
        if {cubecraft.pref.pm.%{_p}%} is true:
            set {cubecraft.pref.pm.%{_p}%} to false
        else:
            set {cubecraft.pref.pm.%{_p}%} to true
    else if {_t} is 4:
        if {cubecraft.pref.gwen.%{_p}%} is true:
            set {cubecraft.pref.gwen.%{_p}%} to false
        else:
            set {cubecraft.pref.gwen.%{_p}%} to true
    else if {_t} is 5:
        if {cubecraft.pref.report.%{_p}%} is true:
            set {cubecraft.pref.report.%{_p}%} to false
        else:
            set {cubecraft.pref.report.%{_p}%} to true
    else if {_t} is 6:
        if {cubecraft.pref.ff.%{_p}%} is true:
            set {cubecraft.pref.ff.%{_p}%} to false
        else:
            set {cubecraft.pref.ff.%{_p}%} to true
    else if {_t} is 7:
        if {cubecraft.ff.%{_p}%} is true:
            set {cubecraft.ff.%{_p}%} to false
            delete {cubecraft.ff.list::%{_p}%}
        else:
            set {cubecraft.ff.%{_p}%} to true
            set {cubecraft.ff.list::%{_p}%} to true
 
    formatSettings({_p}, false)
 
 
 
command /settings:
    trigger:
        formatSettings(player)
        
        
function formatSettings(p: player, chest: boolean = true)
    if {_chest} is true:
        open chest with 5 rows named "         &nUser Preferences" to {_p}
        wait a tick
        
    #Visibility
    if {cubecraft.settings.pv.%{_p}%} is 3:
        format slot 1 of {_p} with eye of ender named "&aPlayer visibility - EVERYONE" with lore "&7Toggle who you can see in lobbies.||&6Click to toggle!" to close then run [settingsSystem(player, 1)]
    else if {cubecraft.settings.pv.%{_p}%} is 2:
        format slot 1 of {_p} with eye of ender named "&6Player visibility - FRIENDS + PARTY" with lore "&7Toggle who you can see in lobbies.||&6Click to toggle!" to close then run [settingsSystem(player, 1)]
    else if {cubecraft.settings.pv.%{_p}%} is 1:
        format slot 1 of {_p} with eye of ender named "&4Player visibility - NOBODY" with lore "&7Toggle who you can see in lobbies.||&6Click to toggle!" to close then run [settingsSystem(player, 1)]
    if {cubecraft.settings.pv.%{_p}%} is 3:
        format slot 10 of {_p} with green stained glass pane named "&aPlayer visibility - EVERYONE" with lore "&7Toggle who you can see in lobbies.||&6Click to toggle!" to close then run [settingsSystem(player, 1)]
    else if {cubecraft.settings.pv.%{_p}%} is 2:
        format slot 10 of {_p} with orange stained glass pane named "&6Player visibility - FRIENDS + PARTY" with lore "&7Toggle who you can see in lobbies.||&6Click to toggle!" to close then run [settingsSystem(player, 1)]
    else if {cubecraft.settings.pv.%{_p}%} is 1:
        format slot 10 of {_p} with red stained glass pane named "&4Player visibility - NOBODY" with lore "&7Toggle who you can see in lobbies.||&6Click to toggle!" to close then run [settingsSystem(player, 1)]

#Chat
    if {cubecraft.pref.pc.%{_p}%} is true:
        format slot 5 of {_p} with paper named "&aReceive chat - ALLOWED" with lore "&7Receive chat in the lobbies.||&6Click to deny" to close then run [settingsSystem(player, 2)]
    else:
        format slot 5 of {_p} with paper named "&aReceive chat - DENIED" with lore "&7Receive chat in the lobbies.||&6Click to allow" to close then run [settingsSystem(player, 2)]
    if {cubecraft.pref.pc.%{_p}%} is true:
        format slot 14 of {_p} with lime stained glass pane named "&aReceive chat - ALLOWED" with lore "&7Receive chat in the lobbies.||&6Click to deny" to close then run [settingsSystem(player, 2)]
    else:
        format slot 14 of {_p} with red stained glass pane named "&aReceive chat - DENIED" with lore "&7Receive chat in the lobbies.||&6Click to allow" to close then run [settingsSystem(player, 2)]
  
      
      
      
on right click:
    if name of player's tool is "&6&kii&5&lSettings&6&kii":
        execute player command "/settings"
command /setsettings <string> [<string>]:
    usage: &9Do /setsettings <settings> <number>
    permission: op
    permission message: &9Permissions> &7This requires Permission Rank [&9OP&7].
    trigger:
        if argument 1 is "pv":
            if argument 2 is "1":
                set {cubecraft.settings.pv.%player%} to 1
                send "&9Chat> &7PV set to 1."
            else if argument 2 is "2":
                set {cubecraft.settings.pv.%player%} to 2
                send "&9Chat> &7PV set to 2."
            else:
                if argument 2 is "3":
                    set {cubecraft.settings.pv.%player%} to 3
                    send "&9Chat> &7PV set to 3."
 
Status
Not open for further replies.