Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Ranktags not updating text?

Asked by 2 years ago

Alright, so. I'm making this nametag system for a friend of mines; I've completed the system but the text to display the division will not change. No errors are being posted into the output, and nothing is appearing in the script. Any ideas?

local groups = {
    visitor = {
        name = "Outsider";
        teamName = "Outsiders";
    };
    main = {
        id = 10815075;
        name = "Imperium Romanum";
        teamName = "Rome"
    };
    subs = {
        [1] = {
            id = 12782082;
            name = "Julia Family";
            teamName = "Julia";
        };
        [2] = {
            id = 10815193;
            name = "Urbanae Cohortes";
            teamName = "Urbanae Cohortes";
        };
        [3] = {
            id = 12622845;
            name = "The Praetorian Guard";
            teamName = "Praetorian Guard";
        };
        [4] = {
            id = 12852424;
            name = "Lictor Guild";
            teamName = "Lictor Guild";
        };
    }
}

function convert(s)
    return "|| "..s.." ||"
end


game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
        local tags = script.BillboardGui:Clone()
        tags.u.Text = player.Name
        for _,group in pairs(groups.subs) do
            if player.Team.Name:lower() == group.teamName:lower() then
                tags.g.Text = convert(group.name)
                tags.gr.Text = convert(player:GetRoleInGroup(group.id))
                break
            end
        end
        if player.Team.Name:lower() == groups.main.teamName:lower() then
            tags.g.Text = convert(groups.main.name)
            tags.gr.Text = convert(player:GetRoleInGroup(groups.main.id))
        end
        if player.Team.Name:lower() == groups.visitor.teamName then
            tags.g.Text = convert(groups.visitor.name)
            tags.gr.Text = ""
        end
        tags.g.TextColor3 = player.Team.TeamColor.Color
        tags.gr.TextColor3 = player.Team.TeamColor.Color
        tags.Parent = char.Head
    end)
end)

Yes, I made a function for the strings as my keyboard doesn't have them and I tend to stop working on them and do something else.

Cheers!

0
shouldn't groups.visitor.teamName be groups.visitor.teamName:lower() on line 55 noob? imKirda 4491 — 2y
0
^ Never noticed. Thank you. Blxefirx 31 — 2y

Answer this question