I need help fixing this script

Hi, I was developing with my team, and we were making a “chat tags” but this becomes an error. I am the owner of the progress, and this script works perfectly fine with other roles, but when I tried it out, it didn’t show my tag.

Script:

	wait(1)
	local tags = Instance.new("Folder",plr)
	tags.Name = "Tags";
	if plr:GetRankInGroup(6988508) == 2 then -- Player Name
		local newTag = Instance.new("IntValue",tags);local chatColor = Instance.new("Color3Value",newTag);local tagColor = Instance.new("Color3Value",newTag);chatColor.Name = "ChatColor";tagColor.Name = "TagColor"
		--EDIT BELOW
        newTag.Name = "VIP" -- Tag Name
        chatColor.Value = Color3.fromRGB(255, 255, 0) -- Chat Color (default is 255,255,255)
        tagColor.Value = Color3.fromRGB(255, 255, 0) -- Tag Color
	elseif plr:GetRankInGroup(6988508) == 3 then -- Player Name
		local newTag = Instance.new("IntValue",tags);local chatColor = Instance.new("Color3Value",newTag);local tagColor = Instance.new("Color3Value",newTag);chatColor.Name = "ChatColor";tagColor.Name = "TagColor"
		--EDIT BELOW
        newTag.Name = "Epic Gamer" -- Tag Name
        chatColor.Value = Color3.fromRGB(255, 255, 0) -- Chat Color (default is 255,255,255)
        tagColor.Value = Color3.fromRGB(0, 255, 255) -- Tag Color
	elseif plr:GetRankInGroup(6988508) == 4 then -- Player Name
		local newTag = Instance.new("IntValue",tags);local chatColor = Instance.new("Color3Value",newTag);local tagColor = Instance.new("Color3Value",newTag);chatColor.Name = "ChatColor";tagColor.Name = "TagColor"
		--EDIT BELOW
        newTag.Name = "Developer" -- Tag Name
        chatColor.Value = Color3.fromRGB(255, 255, 0) -- Chat Color (default is 255,255,255)
        tagColor.Value = Color3.fromRGB(255, 0, 0) -- Tag Color
	elseif plr:GetRankInGroup(6988508) == 5 then -- Player Name
		local newTag = Instance.new("IntValue",tags);local chatColor = Instance.new("Color3Value",newTag);local tagColor = Instance.new("Color3Value",newTag);chatColor.Name = "ChatColor";tagColor.Name = "TagColor"
		--EDIT BELOW
        newTag.Name = "Owner" -- Tag Name
        chatColor.Value = Color3.fromRGB(255, 255, 0) -- Chat Color (default is 255,255,255)
		tagColor.Value = Color3.fromRGB(255, 0, 0) -- Tag Color
	
		
	end
end)

Every other role has a tag in chat if they type, but “owner” doesn’t show? any help?

1 Like

Please edit this post and add ```lua in front of it, return one line and do the same at the bottom. :smiley:

Oh, ok. Thanks for the advice, I really need the answer tho.

Still never added the codeblock it looks like a paragraph more than code…

1 Like

How do you do it, I added the ```

Hi, I was developing with my team, and we were making a “chat tags” but this becomes an error. I am the owner of the progress, and this script works perfectly fine with other roles, but when I tried it out, it didn’t show my tag.

Script: game.Players.PlayerAdded:connect(function(plr) wait(1) local tags = Instance.new("Folder",plr) tags.Name = "Tags"; if plr:GetRankInGroup(6988508) == 2 then -- Player Name local newTag = Instance.new("IntValue",tags);local chatColor = Instance.new("Color3Value",newTag);local tagColor = Instance.new("Color3Value",newTag);chatColor.Name = "ChatColor";tagColor.Name = "TagColor" --EDIT BELOW newTag.Name = "VIP" -- Tag Name chatColor.Value = Color3.fromRGB(255, 255, 0) -- Chat Color (default is 255,255,255) tagColor.Value = Color3.fromRGB(255, 255, 0) -- Tag Color elseif plr:GetRankInGroup(6988508) == 3 then -- Player Name local newTag = Instance.new("IntValue",tags);local chatColor = Instance.new("Color3Value",newTag);local tagColor = Instance.new("Color3Value",newTag);chatColor.Name = "ChatColor";tagColor.Name = "TagColor" --EDIT BELOW newTag.Name = "Epic Gamer" -- Tag Name chatColor.Value = Color3.fromRGB(255, 255, 0) -- Chat Color (default is 255,255,255) tagColor.Value = Color3.fromRGB(0, 255, 255) -- Tag Color elseif plr:GetRankInGroup(6988508) == 4 then -- Player Name local newTag = Instance.new("IntValue",tags);local chatColor = Instance.new("Color3Value",newTag);local tagColor = Instance.new("Color3Value",newTag);chatColor.Name = "ChatColor";tagColor.Name = "TagColor" --EDIT BELOW newTag.Name = "Developer" -- Tag Name chatColor.Value = Color3.fromRGB(255, 255, 0) -- Chat Color (default is 255,255,255) tagColor.Value = Color3.fromRGB(255, 0, 0) -- Tag Color elseif plr:GetRankInGroup(6988508) == 5 then -- Player Name local newTag = Instance.new("IntValue",tags);local chatColor = Instance.new("Color3Value",newTag);local tagColor = Instance.new("Color3Value",newTag);chatColor.Name = "ChatColor";tagColor.Name = "TagColor" --EDIT BELOW newTag.Name = "Owner" -- Tag Name chatColor.Value = Color3.fromRGB(255, 255, 0) -- Chat Color (default is 255,255,255) tagColor.Value = Color3.fromRGB(255, 0, 0) -- Tag Color

end
end)

It is all in one line…? Could you copy and paste it directly from Studio so we can read it please? XD

print("Hello world.")

Quote this message to see how it is done haha.

Yeah i agree lol i can’t even read that its all on one line

Uh, I will try my best. Thanks.

Sorry if I sounded harsh earlier, I am only requesting for you to do this so that me (and other developers) can read it haha! :smiley:

Wait, so do and comments here and then again?

Here it is.

	wait(1)
	local tags = Instance.new("Folder",plr)
	tags.Name = "Tags";
	if plr:GetRankInGroup(6988508) == 2 then -- Player Name
		local newTag = Instance.new("IntValue",tags);local chatColor = Instance.new("Color3Value",newTag);local tagColor = Instance.new("Color3Value",newTag);chatColor.Name = "ChatColor";tagColor.Name = "TagColor"
		--EDIT BELOW
        newTag.Name = "VIP" -- Tag Name
        chatColor.Value = Color3.fromRGB(255, 255, 0) -- Chat Color (default is 255,255,255)
        tagColor.Value = Color3.fromRGB(255, 255, 0) -- Tag Color
	elseif plr:GetRankInGroup(6988508) == 3 then -- Player Name
		local newTag = Instance.new("IntValue",tags);local chatColor = Instance.new("Color3Value",newTag);local tagColor = Instance.new("Color3Value",newTag);chatColor.Name = "ChatColor";tagColor.Name = "TagColor"
		--EDIT BELOW
        newTag.Name = "Epic Gamer" -- Tag Name
        chatColor.Value = Color3.fromRGB(255, 255, 0) -- Chat Color (default is 255,255,255)
        tagColor.Value = Color3.fromRGB(0, 255, 255) -- Tag Color
	elseif plr:GetRankInGroup(6988508) == 4 then -- Player Name
		local newTag = Instance.new("IntValue",tags);local chatColor = Instance.new("Color3Value",newTag);local tagColor = Instance.new("Color3Value",newTag);chatColor.Name = "ChatColor";tagColor.Name = "TagColor"
		--EDIT BELOW
        newTag.Name = "Developer" -- Tag Name
        chatColor.Value = Color3.fromRGB(255, 255, 0) -- Chat Color (default is 255,255,255)
        tagColor.Value = Color3.fromRGB(255, 0, 0) -- Tag Color
	elseif plr:GetRankInGroup(6988508) == 5 then -- Player Name
		local newTag = Instance.new("IntValue",tags);local chatColor = Instance.new("Color3Value",newTag);local tagColor = Instance.new("Color3Value",newTag);chatColor.Name = "ChatColor";tagColor.Name = "TagColor"
		--EDIT BELOW
        newTag.Name = "Owner" -- Tag Name
        chatColor.Value = Color3.fromRGB(255, 255, 0) -- Chat Color (default is 255,255,255)
		tagColor.Value = Color3.fromRGB(255, 0, 0) -- Tag Color
	
		
	end
end)

There I have fixed, it hope you can help me, thanks!

Your rank in the group is 255 I am assuming, so you should either do

if plr:GetRankInGroup(6988508) >= 5 then --More than or equals to.

at the end or have your own tag:

if plr:GetRankInGroup(6988508) == 255 then --Equals to.

Unless your rank in the group is 5…?

Ok, I will see what’s next. Thanks!

Okay! Just in case you misunderstood I have edited it accordingly, this should work:

	wait(1)
	local tags = Instance.new("Folder",plr)
	tags.Name = "Tags";
	if plr:GetRankInGroup(6988508) == 2 then -- Player Name
		local newTag = Instance.new("IntValue",tags);local chatColor = Instance.new("Color3Value",newTag);local tagColor = Instance.new("Color3Value",newTag);chatColor.Name = "ChatColor";tagColor.Name = "TagColor"
		--EDIT BELOW
        newTag.Name = "VIP" -- Tag Name
        chatColor.Value = Color3.fromRGB(255, 255, 0) -- Chat Color (default is 255,255,255)
        tagColor.Value = Color3.fromRGB(255, 255, 0) -- Tag Color
	elseif plr:GetRankInGroup(6988508) == 3 then -- Player Name
		local newTag = Instance.new("IntValue",tags);local chatColor = Instance.new("Color3Value",newTag);local tagColor = Instance.new("Color3Value",newTag);chatColor.Name = "ChatColor";tagColor.Name = "TagColor"
		--EDIT BELOW
        newTag.Name = "Epic Gamer" -- Tag Name
        chatColor.Value = Color3.fromRGB(255, 255, 0) -- Chat Color (default is 255,255,255)
        tagColor.Value = Color3.fromRGB(0, 255, 255) -- Tag Color
	elseif plr:GetRankInGroup(6988508) == 4 then -- Player Name
		local newTag = Instance.new("IntValue",tags);local chatColor = Instance.new("Color3Value",newTag);local tagColor = Instance.new("Color3Value",newTag);chatColor.Name = "ChatColor";tagColor.Name = "TagColor"
		--EDIT BELOW
        newTag.Name = "Developer" -- Tag Name
        chatColor.Value = Color3.fromRGB(255, 255, 0) -- Chat Color (default is 255,255,255)
        tagColor.Value = Color3.fromRGB(255, 0, 0) -- Tag Color
	elseif plr:GetRankInGroup(6988508) >= 5 then -- Player Name
		local newTag = Instance.new("IntValue",tags);local chatColor = Instance.new("Color3Value",newTag);local tagColor = Instance.new("Color3Value",newTag);chatColor.Name = "ChatColor";tagColor.Name = "TagColor"
		--EDIT BELOW
        newTag.Name = "Owner" -- Tag Name
        chatColor.Value = Color3.fromRGB(255, 255, 0) -- Chat Color (default is 255,255,255)
		tagColor.Value = Color3.fromRGB(255, 0, 0) -- Tag Color
	
		
	end
end)

Do I make a new tag, like local newtag or what?

Do all the other roles’ tags work?

Yes, Developer tag works as well.

Yep, then just use the most recent code I posted above. The only thing changed was stating that the player had to be equals to or greater than the rank of 5, which you are. So just from == 5 to >= 5.