Player Locations GUI

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

Aug 18, 2017
1
0
0
28
Category: Skript

Suggested name: Player Locations GUI

What I want:
Ok so I need this for my Server, so a player types /cploc and it opens a menu with 6 rows, and when you type /cploc create it will put their head in the menu with the name of their "Warp", the description, and the coords.
Also a limit of how many a player could create with permissions and pages would be nice.

Ideas for commands:
/cploc - Main Command
/cploc create [name] - Creates a Head in the menu
/cploc desc [name] [description] - Sets a description for their "Warp"
/cploc delete - Deletes a head from the menu


Admin Commands:
/cploc admin remove [name] - Removes a head forcefully.


Ideas for permissions:
cploc.admin - All permissions
cploc.default - Basic Permissions
cploc.bypass - Have unlimited heads


When I'd like it by: 9/22/17

Extra:

Also, I'm not entirely sure if all of this is actually possible in Skript, if it's not just try to make something close to it. Thanks! [Im a noob lol]
 
I got bored. and i have time. so i did it. I hope you are NOT noob to change/add colors/text... :emoji_grinning:


code_language.skript:
command /cploc [<text=1>] [<text>] [<text>]:
    permission: default
    trigger:
        if arg-1 is "create":
            if arg-2 is set:
                if player don't have permission "bypass":
                    if size of {CPLOC::PLY::%player%::*} is more than or equal to 3:    #If player got already 3 Warps set. will cancelt.
                        send "&cYou got already maxed CPL!"
                        stop
                if {CPLOC::GUI::%arg-2%} is set:    #If a name exists.
                    send "&cSorry, this name already exsits, use another name."
                else:
                    set {CPLOC::GUI::%arg-2%} to location of player
                    set {CPLOC::CRE::%arg-2%} to player
                    set {CPLOC::PLY::%player%::%arg-2%} to true
                    send "&aSucessfull create warp. Please short desc? ""/cploc desc %arg-2% <text>""."
            else:
                send "&cName missing, enter a name."
        else if arg-1 is "desc":
            if arg-2 is set:
                if arg-3 is set:
                    if {CPLOC::PLY::%player%::%arg-2%} is set:
                        set {CPLOC::DES::%arg-2%} to "%arg-3%"
                        send "Sucessfull. Desc created"
                    else:
                        send "Youre may not the owner, or wrong names?"
                else:
                    send "&cEmpty Desc"
            else:
                send "&cEmpty Name"
        else if arg-1 is "delete":
            if arg-2 is set:
                if {CPLOC::PLY::%player%::%arg-2%} is set:
                    delete {CPLOC::GUI::%arg-2%}
                    delete {CPLOC::CRE::%arg-2%}
                    delete {CPLOC::DES::%arg-2%}
                    delete {CPLOC::PLY::%player%::%arg-2%}
                    send "Sucessfull deleted."
                else:
                    send "Youre may not the owner or wrong name?"
            else:
                send "Empty Name"
        else if arg-1 is "admin":
            if player has permission "admin":
                if arg-2 is "remove":
                    if arg-3 is set:
                        if {CPLOC::GUI::%arg-3%} is set:
                            delete {CPLOC::PLY::%{CPLOC::CRE::%arg-3%}%::%arg-3%}
                            delete {CPLOC::GUI::%arg-3%}
                            delete {CPLOC::CRE::%arg-3%}
                            delete {CPLOC::DES::%arg-3%}
                            send "%arg-3% sucessfull deleted!"
                        else:
                            send "This name doesn't exists"
                    else:
                        send "Empty name?"
                else:
                    send "Only exists admin commands: Remove"
            else:
                send "You don't have permission"
        else:
            set {_i} to arg-1 parsed as integer
            if {_i} is set:
                set {_p} to 1
                set {_s} to 0
                loop {CPLOC::GUI::*}:
                    set {_Name::%{_p}%::%{_s}%} to "%loop-index%"
                    set {_Cre::%{_p}%::%{_s}%} to "%{CPLOC::CRE::%loop-index%}%"
                    if {CPLOC::DES::%loop-index%} is set:
                        set {_Des::%{_p}%::%{_s}%} to "%{CPLOC::DES::%loop-index%}%"
                    else:
                        set {_Des::%{_p}%::%{_s}%} to ""
                    add 1 to {_s}
                    if {_s} is 53:
                        set {_s} to 0
                        add 1 to {_p}
                        
                if {_Name::%{_i}%::*} is not set:
                    send "&cThis page doesn't exists!"
                    stop               
                
                open chest with 6 rows named "&6CPLOC GUI" to player
                set {_s} to 0
                loop {_Name::%{_i}%::*}:
                    set slot {_s} of player's current inventory to stone named "%loop-value%" with lore "&rCreator: %{_Cre::%{_i}%::%loop-index%}%||&r%{_Des::%{_i}%::%loop-index%}%"
                    add 1 to {_s}
                    if {_s} is 53:
                        add 1 to {_i}
                        if {_Name::%{_i}%::*} is set:
                            set slot 53 of player's current inventory to book named "Next Page!" with lore "%{_i}%"
                        stop loop
                    
on inventory click:
    if name of player's current inventory is "&6CPLOC GUI":
        cancel event
        if clicked item is not air:
            if clicked item is not book:
                teleport player to {CPLOC::GUI::%name of clicked item%}
                send "You teleported to %name of clicked item%"
            else:
                make player execute command "/cploc %uncolored lore of clicked item%"