Problem with Tags

Ok, so I’ve tried making a tag system with @xuefei123’s tutorial. for some reason plr:GetRoleInGroup won’t work properly for me.

What’s wrong with this script?

	local tags = Instance.new("Folder",plr)
	tags.Name = "Tags"
	if	plr.Name == "Welliux" then
			local newTag = Instance.new("IntValue",tags)
			newTag.Name = "HEAD-DEV"
			local chatColor = Instance.new("Color3Value", newTag)
			chatColor.Name = "ChatColor"
			chatColor.Value = BrickColor.new("White").Color
			local tagColor = Instance.new("Color3Value",newTag)
			tagColor.Name = "TagColor"
			tagColor.Value = Color3.fromRGB(245,205,48)
	-- Devs
	elseif plr:IsInGroup(4946111) and plr:GetRoleInGroup(254) then
	local newTag = Instance.new("IntValue",tags)
	newTag.Name = "DEV"
	local chatColor = Instance.new("Color3Value", newTag)
	chatColor.Name = "ChatColor"
	chatColor.Value = BrickColor.new("White").Color
	local tagColor = Instance.new("Color3Value",newTag)
	tagColor.Name = "TagColor"
	tagColor.Value = Color3.fromRGB(245,205,48)
	-- Administration Team
	elseif plr:IsInGroup(4946111) and plr:GetRoleInGroup(5) then
	local newTag = Instance.new("IntValue",tags)
	newTag.Name = "Admin"
	local chatColor = Instance.new("Color3Value", newTag)
	chatColor.Name = "ChatColor"
	chatColor.Value = BrickColor.new("White").Color
	local tagColor = Instance.new("Color3Value",newTag)
	tagColor.Name = "TagColor"
	tagColor.Value = Color3.fromRGB(117,0,0)
	-- Moderation Team
	elseif plr:IsInGroup(4946111) and plr:GetRoleInGroup(4) then
	local newTag = Instance.new("IntValue",tags)
	newTag.Name = "Moderator"
	local chatColor = Instance.new("Color3Value", newTag)
	chatColor.Name = "ChatColor"
	chatColor.Value = BrickColor.new("White").Color
	local tagColor = Instance.new("Color3Value",newTag)
	tagColor.Name = "TagColor"
	tagColor.Value = Color3.fromRGB(255,89,89)
	-- Contributor
	elseif plr:IsInGroup(4946111) and plr:GetRoleInGroup(3) then
	local newTag = Instance.new("IntValue",tags)
	newTag.Name = "Contributor"
	local chatColor = Instance.new("Color3Value", newTag)
	chatColor.Name = "ChatColor"
	chatColor.Value = BrickColor.new("White").Color
	local tagColor = Instance.new("Color3Value",newTag)
	tagColor.Name = "TagColor"
	tagColor.Value = Color3.fromRGB(226,155,64)
	-- Influcener
	elseif plr:IsInGroup(4946111) and plr:GetRoleInGroup(2) then
	local newTag = Instance.new("IntValue",tags)
	newTag.Name = "Influencer"
	local chatColor = Instance.new("Color3Value", newTag)
	chatColor.Name = "ChatColor"
	chatColor.Value = BrickColor.new("White").Color
	local tagColor = Instance.new("Color3Value",newTag)
	tagColor.Name = "TagColor"
	tagColor.Value = Color3.fromRGB(255,89,89)
	-- Supporter
	elseif plr:IsInGroup(4946111) and plr:GetRoleInGroup(1) then
	local newTag = Instance.new("IntValue",tags)
	newTag.Name = "Supporter"
	local chatColor = Instance.new("Color3Value", newTag)
	chatColor.Name = "ChatColor"
	chatColor.Value = BrickColor.new("White").Color
	local tagColor = Instance.new("Color3Value",newTag)
	tagColor.Name = "TagColor"
	tagColor.Value = Color3.fromRGB(4,175,236)
	
	end 
end)`
1 Like

Hey, can you put all you scripts into a blocking by using ``
Example:
hi

1 Like

@ScytheSlayin There we go, Fixed.

1 Like

According to the wiki, GetRoleInGroup, needs the group ID as it’s parameter, not the role numerical value. It also returns the name of the role as a string.

So for example you would do this:

if plr.UserId == 1046851536 then --future proofing, in case you change your username
    --head dev stuff
elseif plr:GetRoleInGroup(4946111) == "Developer" then --since this can also return "Guest" for guests, there is no need to use IsInGroup()
    --dev stuff
elseif plr:GetRoleInGroup(4946111) == "Admin" then
    --admin stuff
--elseif...etc.
end

You could also use GetRankInGroup, which returns the rank numerical value instead of the rank string.

Example:

if plr:GetRankInGroup(4946111) == 254 then
    --dev stuff
end
1 Like