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.

Script TitleCombination 1.0

combine your title with GUI

  1. iRegalia
    Contributors:
    iRegalia
    Supported Minecraft Versions:
    • 1.9, 1.10
    Title-Combination.png
    Permission
    • All can set by yourself in config.yml
    Commands
    • /admintitle [remove / add] [player] [prefix/middle/suffix]
      Add Title to player / remove title from player
      - Aliases: /at
    • /playertitle
      Open TitleGUI
      - Aliases: /pt
    Depenceny
    • TusKe for GUI
    • skRayfall [Optional] for Citizen Support
    • Skellet [Optional] for MySQL Support
    • skUtilities or Skquery for Yaml Support
    Video


    Code (Skript):
    1.  
    2. config:
    3.   gui:
    4.     display_name: '{P} - Title' #Gui Name {P} = Player
    5.     integration:
    6.       citizen: true   #Support Citizen
    7.       citizen-name: -- Title -- #Citizen Name For Detect Click Open GUI
    8.       command: true #Commands [/pt]
    9.       command-permission: playertitle.player #/pt command permission
    10.   title:
    11.     prefix: Prefix #prefix (Change watever u want)
    12.     middle: Middle #middle (Change watever u want)
    13.     suffix: Suffix #suffix (Change watever u want)
    14.     splitter: ',' (Splitter cant be added to commands , you can & ? | and much more for detection in database)
    15.   unlocker:
    16.     item: true
    17.     item-id: '276'
    18.     item-prefix-detection: §6{type} §f- {title} # Item for unlocking name , {type} = prefix/middle/suffix , {title} = the title , etc &6Prefix &f- &eFront&bTitle
    19.     command: true #command unlocking for admin
    20.     command-permission: playertitle.admin
    21.   chat:
    22.     replace: false
    23.     replace-format: '{T}{P}: {MSG}' # {T} = title , {P} = player name , {MSG} = message sent by player
    24.     add-to-current: true  # support with other plugins , u can just put {T} in the chat message
    25.     replace-display-name: false # display name will repalce with etc [Prefix/Middle/Suffix] iRegalia
    26.     replace-display-format: '{T} {P}'
    27.   message:
    28.     title-claimed: §fYou already have the title
    29.     title-unlock: §fYou unlocked new title
    30.     last-pages: §fYou already at last pages
    31.     first-pages: §fYou already at first pages
    32.     admin-add-title: §fYou added title to specify player
    33.     admin-remove-title: §fYou removed title from specify player[/B]
    34.  
    Code (Skript):
    1.  
    2. config:
    3.   mysql: #database mysql setting
    4.     ip: 127.0.0.1
    5.     port: '3306'
    6.     username: root
    7.     password: ''
    8.     database: test
    9.   gui:
    10.     display_name: '{P} - Title' #Gui Name {P} = Player
    11.     integration:
    12.       citizen: true   #Support Citizen
    13.       citizen-name: -- Title -- #Citizen Name For Detect Click Open GUI
    14.       command: true #Commands [/pt]
    15.       command-permission: playertitle.player #/pt command permission
    16.   title:
    17.     prefix: Prefix #prefix (Change watever u want)
    18.     middle: Middle #middle (Change watever u want)
    19.     suffix: Suffix #suffix (Change watever u want)
    20.     splitter: ',' #(Splitter cant be added to commands , you can & ? | and much more for detection in database)
    21.   unlocker:
    22.     item: true
    23.     item-id: '276'
    24.     item-prefix-detection: §6{type} §f- {title} # Item for unlocking name , {type} = prefix/middle/suffix , {title} = the title , etc &6Prefix &f- &eFront&bTitle
    25.     command: true #command unlocking for admin
    26.     command-permission: playertitle.admin
    27.   chat:
    28.     replace: false
    29.     replace-format: '{T}{P}: {MSG}' # {T} = title , {P} = player name , {MSG} = message sent by player
    30.     add-to-current: true  # support with other plugins , u can just put {T} in the chat message
    31.     replace-display-name: false # display name will repalce with etc [Prefix/Middle/Suffix] iRegalia
    32.     replace-display-format: '{T} {P}'
    33.   message:
    34.     title-claimed: §fYou already have the title
    35.     title-unlock: §fYou unlocked new title
    36.     last-pages: §fYou already at last pages
    37.     first-pages: §fYou already at first pages
    38.     admin-add-title: §fYou added title to specify player
    39.     admin-remove-title: §fYou removed title from specify player[/B]
    40.  
    Database Setup
    upload_2017-5-17_15-40-24.png

    • UUID = player's uuid
    • TITLE = using title
    • PREFIX = prefix that player have
    • MIDDLE = middle that player have
    • SUFFIX = suffix that player have
    • Get the all prefix player have u can read from database and split by "Splitter" in config
    • Skript Function (You can see at skript all the function)
      Code (Skript):
      1. getPlayerTitle(player, prefix/middle/suffix) #for get player title (return text/string)
      2. function getPlayerTitle(p: player, t: text) :: text:
      3.     set {_sql} to "SELECT * FROM playertitle WHERE uuid='%{_p}'s uuid%'"
      4.     connect mysql
      5.     set {_title} to mysql result of query {_sql}
      6.     set {_result::*} to mysql string "%{_t}%" in {_title}
      7.     disconnect mysql
      8.     return {_result::1}

    Images

    1. upload_2017-5-17_15-41-49.png