Tab issue

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

BlaxkExy

Member
Aug 21, 2022
1
0
1
19
So i recently made some skript to save for later and rn i decided to start a server but im trying to fix this and i simply cant... ik it will seem dumb but i stuck at this issue for like 3h and idk what to do

The skript is a tab skript and the rank wont show, It just shows me "member blaxkexy" even if my perm is "group.owner". You'll understand after looking below

this is the code:

every 1 second:
set all players' tab list header to "&8&l&m------------ %newline%%newline%&c&lExMines%newline%&4Custom Coded &8| &cSeason 1%newline%"

on player join:
if player has permission "group.owner":
set player's tab list name to "&4&lOwner &7%player%"
if player has permission "group.dev":
set player's tab list name to "&2&lDev &7%player%"
if player has permission "group.manager":
set player's tab list name to "&4&lManager &7%player% &3&lSTAFF"
if player has permission "group.admin":
set player's tab list name to "&c&lAdmin &7%player% &3&lSTAFF"
if player has permission "group.jradmin":
set player's tab list name to "&c&lJr. Admin &7%player% &3&lSTAFF"
if player has permission "group.moderator":
set player's tab list name to "&3&lMod &7%player% &3&lSTAFF"
if player has permission "group.helper":
set player's tab list name to "&6&lHelper &7%player% &3&lSTAFF"
if player has permission "group.trainee":
set player's tab list name to "&5&lTrainee &7%player%"
if player has permission "group.default":
set player's tab list name to "&7Member &7%player%"


and heres the pic:
basically even if i have any group. permission it keeps me as member
upload_2022-8-21_14-50-27.png
 
Because you have the perm "group.default" it can give you that rank. You should do use this:

Code:
if player has permission "group.owner":
 set player's tablist name to "&4&lOwner &7%player%"
else:
 if player has permission "group.dev":
  set player's tablist name to "&2&lDev &7%player%"
 else:

And so on.
Using else: will make sure it tests if you have owner FIRST and if you do, it won't check if you have the other ranks.
 
If you're using if on every thing, here is what the code is doing:
hm ok does this player have "group.owner" permission? oh yes the player does. then i will set the tablist name to owner
*repeat until the last line*
oh does this player have "group.default"? yes he does, here is your tablist name member

if you set else if: on the rest, it will think:
does the player have "group.owner"? yep, here is the tablist name owner
*ignores the rest of the if statements*


Code:
every 1 second:
    set all players' tab list header to "&8&l&m------------ %newline%%newline%&c&lExMines%newline%&4Custom Coded &8| &cSeason 1%newline%"

on player join:
    if player has permission "group.owner":
        set player's tab list name to "&4&lOwner &7%player%"
    else if player has permission "group.dev":
        set player's tab list name to "&2&lDev &7%player%"
    else if player has permission "group.manager":
        set player's tab list name to "&4&lManager &7%player% &3&lSTAFF"
    else if player has permission "group.admin":
        set player's tab list name to "&c&lAdmin &7%player% &3&lSTAFF"
    else if player has permission "group.jradmin":
        set player's tab list name to "&c&lJr. Admin &7%player% &3&lSTAFF"
    else if player has permission "group.moderator":
        set player's tab list name to "&3&lMod &7%player% &3&lSTAFF"
    else if player has permission "group.helper":
        set player's tab list name to "&6&lHelper &7%player% &3&lSTAFF"
    else if player has permission "group.trainee":
        set player's tab list name to "&5&lTrainee &7%player%"
    else if player has permission "group.default":
        set player's tab list name to "&7Member &7%player%"
 
Bruh just get luckperms & vault
then do /lp group <group> meta setprefix "&cBla "
and then

on join:
set player's tab list name to "%player's prefix%%player%"
 
Status
Not open for further replies.