I was wondering if there’s a healthier/more efficient method for this big block of elseif’s that will hand out identical output.
This looks really bad and I’ve been trying to find alternatives but faild to do so.
The point of the script is to check which rank the player has in a specific group, and change the variables rankText and rankColor to then use them in changing a headtitle.
This is a 1:1 replica of the code but changed to hide it’s original contents:
local Rank = player:GetRoleInGroup(1)
if Rank == "Specific Rank1" then
rankText = "Specific Rank1"
rankColor = Color3.fromRGB(255, 255, 255)
elseif Rank == "Officer" then
rankText = "Officer"
rankColor = Color3.fromRGB(254, 254, 254)
elseif Rank == "Sergeant" then
rankText = "Sergeant"
rankColor = Color3.fromRGB(253, 253, 253)
end