Loop Player Prefix with Luckperms

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

Myca26

Member
Jan 23, 2022
2
0
1
29
Hi all,

First time on this forum, because I didn't get something to work.

What I want is a tabname for every player on the server with a Luckperms Prefix.

My code:

Code:
on join:
    set {server_tps_5} to placeholder "server_tps_5"
    set {luckperms_groups} to placeholder "luckperms_groups"
    set {simpleclans_clan_color_tag} to placeholder "simpleclans_clan_color_tag"
    set {player's prefix} to placeholder "player's prefix"
    if {simpleclans_clan_color_tag} is not set:
        set the player's tablist name to "%{luckperms_prefix}%&7[%{simpleclans_clan_color_tag}%&7] &f%player%"
    else:
        set the player's tablist name to "%{luckperms_prefix}%&7[Geen] &f%player%"

every 1 second:
    loop all players:
        set loop-player's tablist name to "%{%loop-player%.luckperms_prefix}%&7[%{%loop-player%.simpleclans_clan_color_tag}%&7] &f%loop-player%"
        set tab header to "&9[VeluweSMP]%nl%%nl%&7Spelers online: &9%number of all players%%nl%%nl%&9----------------" and footer to "&9----------------%nl%%nl%&3TPS: &7%{server_tps_5}%%nl%%nl%&7Onze website: &9veluwesmp.nl" for loop-player

Thanks!
 
Last edited:
I wouldn't recommend looping players every second.

Simply, just put this code in your on join event.


Code:
on join:
    while player is online:
        set {_prefix} to player's prefix
        set {_clan} to placeholder "simpleclans_clan_color_tag"
        set {_tps} to tps from the last minute

        if {_clan} is set:
            set the player's tablist name to "%{_prefix}%&7[%{_clan}%] &f%player%"
        else:
            set the player's tablist name to "%{_prefix}%&7[Geen] &f%player%"
       
        set tab header to "&9[VeluweSMP]%nl%%nl%&7Spelers online: &9%number of all players%%nl%%nl%&9----------------" and footer to "&9----------------%nl%%nl%&3TPS: &7%{_tps}%%nl%%nl%&7Onze website: &9veluwesmp.nl" for player
        wait 1 tick


Please note this is untested. If there is any errors, please send them to me.
 
Status
Not open for further replies.