**My name tag UI is a not working**

My script was working fine, now it’s just broken now. What it is meant to do is that if the player is in the group but is between the rank 244-248 they will get the name tag. It is not working for some reason and those who are underneath the rank 244-248 are still getting the tag.

local ServerStorage = game:GetService("ServerStorage")
local Tag = ServerStorage.Tag


game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
            wait(0.1)


        

        local CloneTag = Tag:Clone()
        local NameTag = CloneTag.NameTag
        local RankTag = CloneTag.SubRegTag
        
        local head = char:WaitForChild("Head")
        local rankta = head:FindFirstChild("Tag")
        local ranktag = rankta:FindFirstChild("SubRegTag")
        
        if player:GetRankInGroup(15323353) >= 244 or player:GetRankInGroup(15323353) <= 248  then
            ranktag.Visible = true
            ranktag.BackgroundColor = BrickColor.new("Neon orange")
            ranktag.Text = "[OTS] "..player:GetRoleInGroup(15323353)
            elseif player:GetRankInGroup(15350427) >= 245 or player:GetRankInGroup(15350427) <= 248  then
                ranktag.Visible = true
                ranktag.BackgroundColor = BrickColor.new("Teal")
            ranktag.Text = "[AIRC] "..player:GetRoleInGroup(15350427)
        
            end
    end)
end)

Change or to and, so that it checks the range of ranks able to get the nametag. The first condition is alright, but the second makes it so that even if their ranks are still below, they are able to get it.

  if player:GetRankInGroup(15323353) >= 244 and player:GetRankInGroup(15323353) <= 248  then
1 Like

You never set the parent of ranktag.

This is a sub script, the main script sets up everything.

How does your main script set the parent of ranktag?

In the script you say this:

Which says if they are above 244 or under or equal to 248 that is your issue. Fix the if they are under or equal to 248 and this issue should be fixed.

Also, this is the issue for the other if statement below it.

^ You say below or equal to 248 here too.