1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Player Locations GUI

Discussion in 'Requests' started by SparrowPlayzSkript, Sep 13, 2017.

  1. SparrowPlayzSkript

    Joined:
    Aug 18, 2017
    Messages:
    1
    Likes Received:
    0
    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]
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    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 (Skript):
    1. command /cploc [<text=1>] [<text>] [<text>]:
    2.     permission: default
    3.     trigger:
    4.         if arg-1 is "create":
    5.             if arg-2 is set:
    6.                 if player don't have permission "bypass":
    7.                     if size of {CPLOC::PLY::%player%::*} is more than or equal to 3:    #If player got already 3 Warps set. will cancelt.
    8.                         send "&cYou got already maxed CPL!"
    9.                         stop
    10.                 if {CPLOC::GUI::%arg-2%} is set:    #If a name exists.
    11.                     send "&cSorry, this name already exsits, use another name."
    12.                 else:
    13.                     set {CPLOC::GUI::%arg-2%} to location of player
    14.                     set {CPLOC::CRE::%arg-2%} to player
    15.                     set {CPLOC::PLY::%player%::%arg-2%} to true
    16.                     send "&aSucessfull create warp. Please short desc? ""/cploc desc %arg-2% <text>""."
    17.             else:
    18.                 send "&cName missing, enter a name."
    19.         else if arg-1 is "desc":
    20.             if arg-2 is set:
    21.                 if arg-3 is set:
    22.                     if {CPLOC::PLY::%player%::%arg-2%} is set:
    23.                         set {CPLOC::DES::%arg-2%} to "%arg-3%"
    24.                         send "Sucessfull. Desc created"
    25.                     else:
    26.                         send "Youre may not the owner, or wrong names?"
    27.                 else:
    28.                     send "&cEmpty Desc"
    29.             else:
    30.                 send "&cEmpty Name"
    31.         else if arg-1 is "delete":
    32.             if arg-2 is set:
    33.                 if {CPLOC::PLY::%player%::%arg-2%} is set:
    34.                     delete {CPLOC::GUI::%arg-2%}
    35.                     delete {CPLOC::CRE::%arg-2%}
    36.                     delete {CPLOC::DES::%arg-2%}
    37.                     delete {CPLOC::PLY::%player%::%arg-2%}
    38.                     send "Sucessfull deleted."
    39.                 else:
    40.                     send "Youre may not the owner or wrong name?"
    41.             else:
    42.                 send "Empty Name"
    43.         else if arg-1 is "admin":
    44.             if player has permission "admin":
    45.                 if arg-2 is "remove":
    46.                     if arg-3 is set:
    47.                         if {CPLOC::GUI::%arg-3%} is set:
    48.                             delete {CPLOC::PLY::%{CPLOC::CRE::%arg-3%}%::%arg-3%}
    49.                             delete {CPLOC::GUI::%arg-3%}
    50.                             delete {CPLOC::CRE::%arg-3%}
    51.                             delete {CPLOC::DES::%arg-3%}
    52.                             send "%arg-3% sucessfull deleted!"
    53.                         else:
    54.                             send "This name doesn't exists"
    55.                     else:
    56.                         send "Empty name?"
    57.                 else:
    58.                     send "Only exists admin commands: Remove"
    59.             else:
    60.                 send "You don't have permission"
    61.         else:
    62.             set {_i} to arg-1 parsed as integer
    63.             if {_i} is set:
    64.                 set {_p} to 1
    65.                 set {_s} to 0
    66.                 loop {CPLOC::GUI::*}:
    67.                     set {_Name::%{_p}%::%{_s}%} to "%loop-index%"
    68.                     set {_Cre::%{_p}%::%{_s}%} to "%{CPLOC::CRE::%loop-index%}%"
    69.                     if {CPLOC::DES::%loop-index%} is set:
    70.                         set {_Des::%{_p}%::%{_s}%} to "%{CPLOC::DES::%loop-index%}%"
    71.                     else:
    72.                         set {_Des::%{_p}%::%{_s}%} to ""
    73.                     add 1 to {_s}
    74.                     if {_s} is 53:
    75.                         set {_s} to 0
    76.                         add 1 to {_p}
    77.                        
    78.                 if {_Name::%{_i}%::*} is not set:
    79.                     send "&cThis page doesn't exists!"
    80.                     stop              
    81.                
    82.                 open chest with 6 rows named "&6CPLOC GUI" to player
    83.                 set {_s} to 0
    84.                 loop {_Name::%{_i}%::*}:
    85.                     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%}%"
    86.                     add 1 to {_s}
    87.                     if {_s} is 53:
    88.                         add 1 to {_i}
    89.                         if {_Name::%{_i}%::*} is set:
    90.                             set slot 53 of player's current inventory to book named "Next Page!" with lore "%{_i}%"
    91.                         stop loop
    92.                    
    93. on inventory click:
    94.     if name of player's current inventory is "&6CPLOC GUI":
    95.         cancel event
    96.         if clicked item is not air:
    97.             if clicked item is not book:
    98.                 teleport player to {CPLOC::GUI::%name of clicked item%}
    99.                 send "You teleported to %name of clicked item%"
    100.             else:
    101.                 make player execute command "/cploc %uncolored lore of clicked item%"            
     

Share This Page

Loading...