Prefix (Expression) — skript-luckperms

Addon: skript-luckperms · Category: Expression · Since: 1.0

Syntax

[the] [luckperm[s]] prefix[es] of group %luckpermsgroup%

Description

Returns the primary prefix of a user/group. If `prefixes` is used it will return a sorted list of all prefixes of the user/group. Use `ExprChatMetaPriority` to get priority of a prefix.

Examples

function get(p: offlineplayer):
    set {_lp} to luckperms user from {_p}
    set {_prefix} to formatted luckperms prefix of {_lp}
    set {_prefixes::*} to luckperms prefixes of {_lp}
    if {_p} is online:
         send "Your prefix: %{_prefix}%" to {_p}
         send "You have %size of {_prefixes::*}% prefixes!" to {_p}
         loop {_prefixes::*}:
              set {_prefix} to formatted loop-value
              send "Priority: %prefix priority of loop-value% Prefix: %{_prefix}%" to {_p}
function get(group: string):
    set {_prefix} to formatted luckperms prefix of {_group}
    set {_prefixes::*} to luckperms prefixes of {_group}
    broadcast "%{_group}%'s primary prefix: %{_prefix}%"
    broadcast "Amount of all prefixes: %size of {_prefixes::*}%x"
    broadcast "All:"
         loop {_prefixes::*}:
              set {_prefix} to formatted loop-value
              broadcast "Priority: %prefix priority of loop-value% Prefix: %{_prefix}%"

View source