Custom chat GetRankInGroup not working

My custom chat does write the messages, But does not assign the correct tags.

Script
local event = game.ReplicatedStorage.PublicChatEvent
local Group_ID = 7997013
local Players = game:GetService("Players")
local TS = game:GetService("TweenService")
function FilterMessage(msg, plr)
	return game:GetService("TextService"):FilterStringAsync(msg, plr.UserId):GetNonChatStringForUserAsync(plr.UserId)
end
event.OnServerEvent:Connect(function(plr, message: string)
	if message~="" then
		if Players[plr.Name]:IsInGroup(Group_ID) then
			local label = script.Parent.PlaceHoldersFrame:Clone()
			local filteredmessage = FilterMessage(message, plr)
			label.Visible=true
			label.Parent=script.Parent
			label.PlaceHolder.Text= "["..plr.DisplayName.."]: "..filteredmessage
			label.PlaceHolder:TweenPosition(UDim2.new(0,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 0.3)
			--label.MaxVisibleGraphemes=1+#plr.DisplayName+3
			if plr.AccountAge<=10 and plr.UserId~=133840022 then
				label.PlaceHolder.Text="[NEW PLAYER]["..plr.DisplayName.."]: "..filteredmessage
				--	label.MaxVisibleGraphemes=13+#plr.DisplayName+3
			elseif plr.AccountAge>=100 and plr.AccountAge<199 then
				label.PlaceHolder.TextColor3 = Color3.new(0.780392, 1, 0.733333)
			elseif plr.AccountAge>=200 and plr.AccountAge<299 then
				label.PlaceHolder.TextColor3=Color3.new(0.580392, 0.588235, 1)
			elseif plr.AccountAge>=300 and plr.AccountAge<=364 then
				label.PlaceHolder.TextColor3=Color3.new(1, 0.447059, 0.454902)
			elseif plr.AccountAge>365 then
				label.PlaceHolder.TextColor3=BrickColor.new("Gold").Color
				label.PlaceHolder.Text="[VETERAN]["..plr.DisplayName.."]: "..filteredmessage
				--label.MaxVisibleGraphemes=10+#plr.DisplayName+3
			elseif Players[plr.Name]:GetRankInGroup(Group_ID)==25 then
				label.PlaceHolder.TextColor3=Color3.new(0.490196, 1, 1)
				label.PlaceHolder.Text="[ADMIN]["..plr.DisplayName.."]: "..message
			elseif Players[plr.Name]:GetRankInGroup(Group_ID)==26 then
				label.PlaceHolder.Text="[DEV]["..plr.DisplayName.."]: "..message
				--label.MaxVisibleGraphemes=8+#plr.DisplayName+3
				local val = Instance.new("Color3Value")
				val.Parent=label
				val.Value=Color3.new(1,0,0)
				label.PlaceHolder.UIGradient.Color=ColorSequence.new(val.Value)
				val.Changed:Connect(function()
					label.PlaceHolder.UIGradient.Color=ColorSequence.new(val.Value)
				end)
				while true do 
					local wait1 = 0.7
					local wait2=0.8
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(255,0,0)}):Play() 
					wait(wait2)
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(75, 0, 0)}):Play() 
					wait(wait2)
				end 
			elseif Players[plr.Name]:GetRankInGroup(Group_ID)==30 then
				label.PlaceHolder.Text="[TRUSTED DEV]["..plr.DisplayName.."]: "..message
				--label.MaxVisibleGraphemes=8+#plr.DisplayName+3
				local val = Instance.new("Color3Value")
				val.Parent=label
				val.Value=Color3.new(1,0,0)
				label.PlaceHolder.UIGradient.Color=ColorSequence.new(val.Value)
				val.Changed:Connect(function()
					label.PlaceHolder.UIGradient.Color=ColorSequence.new(val.Value)
				end)
				while true do 
					local wait1 = 0.7
					local wait2=0.8
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(255,0,0)}):Play() 
					wait(wait2)
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(0, 255, 0)}):Play() 
					wait(wait2)
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(0, 0, 255)}):Play() 
					wait(wait2)
				end 
			elseif Players[plr.Name]:GetRankInGroup(Group_ID)==253 then
				label.PlaceHolder.Text="[OWNER]["..plr.DisplayName.."]: "..message
				--label.MaxVisibleGraphemes=8+#plr.DisplayName+3
				local val = Instance.new("Color3Value")
				val.Parent=label
				val.Value=Color3.new(1,0,0)
				label.PlaceHolder.UIGradient.Color=ColorSequence.new(val.Value)
				val.Changed:Connect(function()
					label.PlaceHolder.UIGradient.Color=ColorSequence.new(val.Value)
				end)
				while true do 
					local wait1 = 0.7
					local wait2=0.8
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(255,0,0)}):Play() 
					wait(wait2)
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(255, 150, 0)}):Play() 
					wait(wait2)
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(255, 255, 0)}):Play() 
					wait(wait2)
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(0, 255, 0)}):Play() 
					wait(wait2)
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(0, 255, 255)}):Play() 
					wait(wait2)
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(0, 150, 255)}):Play() 
					wait(wait2)
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(255, 0, 255)}):Play() 
					wait(wait2)
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(255, 0, 150)}):Play() 
					wait(wait2)
				end 
			end
		end
	end
	--[[local size = label.TextBounds
	if label.TextFits==false then
		repeat
			label.Size=UDim2.new(1,0,0,200)
			task.wait()
			label.Size=UDim2.new(1, 0, 0, size.Y)
		until label.Size==UDim2.new(1, 0, 0, size.Y)
	end
	label.Size=UDim2.new(1, 0, 0, size.Y)--]]
	--TS:Create(label, TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut),{MaxVisibleGraphemes=#label.Text}):Play()
end)

Help is appreciated because i am making this custom chat for a game which i am a developer of

I also added a print, But it won’t print. (new ver)

Please add print() statements in the whole section, post the scritp and say which print() statements don’t run and which do

local event = game.ReplicatedStorage.PublicChatEvent
local Group_ID = 7997013
local Players = game:GetService("Players")
local TS = game:GetService("TweenService")
function FilterMessage(msg, plr)
	return game:GetService("TextService"):FilterStringAsync(msg, plr.UserId):GetNonChatStringForUserAsync(plr.UserId)
end
event.OnServerEvent:Connect(function(plr, message: string)
	if message~="" then
		if Players[plr.Name]:IsInGroup(Group_ID) then
			print(plr.Name)
			local label = script.Parent.PlaceHoldersFrame:Clone()
			local filteredmessage = FilterMessage(message, plr)
			label.Visible=true
			label.Parent=script.Parent
			label.PlaceHolder.Text= "["..plr.DisplayName.."]: "..filteredmessage
			label.PlaceHolder:TweenPosition(UDim2.new(0,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 0.3)
			--label.MaxVisibleGraphemes=1+#plr.DisplayName+3
			if plr.AccountAge<=10 and plr.UserId~=133840022 then
				label.PlaceHolder.Text="[NEW PLAYER]["..plr.DisplayName.."]: "..filteredmessage
				--	label.MaxVisibleGraphemes=13+#plr.DisplayName+3
			elseif plr.AccountAge>=100 and plr.AccountAge<199 then
				label.PlaceHolder.TextColor3 = Color3.new(0.780392, 1, 0.733333)
			elseif plr.AccountAge>=200 and plr.AccountAge<299 then
				label.PlaceHolder.TextColor3=Color3.new(0.580392, 0.588235, 1)
			elseif plr.AccountAge>=300 and plr.AccountAge<=364 then
				label.PlaceHolder.TextColor3=Color3.new(1, 0.447059, 0.454902)
			elseif plr.AccountAge>365 then
				label.PlaceHolder.TextColor3=BrickColor.new("Gold").Color
				label.PlaceHolder.Text="[VETERAN]["..plr.DisplayName.."]: "..filteredmessage
				--label.MaxVisibleGraphemes=10+#plr.DisplayName+3
			end
			
			
			if plr:GetRankInGroup(Group_ID)==25 then
				label.PlaceHolder.TextColor3=Color3.new(0.490196, 1, 1)
				label.PlaceHolder.Text="[ADMIN]["..plr.DisplayName.."]: "..message
			elseif plr:GetRankInGroup(Group_ID)==26 then
				label.PlaceHolder.Text="[DEV]["..plr.DisplayName.."]: "..message
				--label.MaxVisibleGraphemes=8+#plr.DisplayName+3
				print(plr.Name, "The Dev Chatted!")
				local val = Instance.new("Color3Value")
				val.Parent=label
				val.Value=Color3.new(1,0,0)
				label.PlaceHolder.UIGradient.Color=ColorSequence.new(val.Value)
				val.Changed:Connect(function()
					label.PlaceHolder.UIGradient.Color=ColorSequence.new(val.Value)
				end)
				while true do 
					local wait1 = 0.7
					local wait2=0.8
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(255,0,0)}):Play() 
					wait(wait2)
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(75, 0, 0)}):Play() 
					wait(wait2)
				end 
			elseif plr:GetRankInGroup(Group_ID)==30 then
				label.PlaceHolder.Text="[TRUSTED DEV]["..plr.DisplayName.."]: "..message
				--label.MaxVisibleGraphemes=8+#plr.DisplayName+3
				local val = Instance.new("Color3Value")
				val.Parent=label
				val.Value=Color3.new(1,0,0)
				label.PlaceHolder.UIGradient.Color=ColorSequence.new(val.Value)
				val.Changed:Connect(function()
					label.PlaceHolder.UIGradient.Color=ColorSequence.new(val.Value)
				end)
				while true do 
					local wait1 = 0.7
					local wait2=0.8
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(255,0,0)}):Play() 
					wait(wait2)
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(0, 255, 0)}):Play() 
					wait(wait2)
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(0, 0, 255)}):Play() 
					wait(wait2)
				end 
			elseif plr.UserId==292794842 then
				label.PlaceHolder.Text="[OWNER]["..plr.DisplayName.."]: "..message
				--label.MaxVisibleGraphemes=8+#plr.DisplayName+3
				local val = Instance.new("Color3Value")
				val.Parent=label
				val.Value=Color3.new(1,0,0)
				label.PlaceHolder.UIGradient.Color=ColorSequence.new(val.Value)
				val.Changed:Connect(function()
					label.PlaceHolder.UIGradient.Color=ColorSequence.new(val.Value)
				end)
				while true do 
					local wait1 = 0.7
					local wait2=0.8
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(255,0,0)}):Play() 
					wait(wait2)
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(255, 150, 0)}):Play() 
					wait(wait2)
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(255, 255, 0)}):Play() 
					wait(wait2)
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(0, 255, 0)}):Play() 
					wait(wait2)
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(0, 255, 255)}):Play() 
					wait(wait2)
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(0, 150, 255)}):Play() 
					wait(wait2)
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(255, 0, 255)}):Play() 
					wait(wait2)
					TS:Create(val,TweenInfo.new(wait1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),
					{Value = Color3.fromRGB(255, 0, 150)}):Play() 
					wait(wait2)
				end 
			end
		end
	end
	--[[local size = label.TextBounds
	if label.TextFits==false then
		repeat
			label.Size=UDim2.new(1,0,0,200)
			task.wait()
			label.Size=UDim2.new(1, 0, 0, size.Y)
		until label.Size==UDim2.new(1, 0, 0, size.Y)
	end
	label.Size=UDim2.new(1, 0, 0, size.Y)--]]
	--TS:Create(label, TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut),{MaxVisibleGraphemes=#label.Text}):Play()
end)

new ver, still doesnt print dev chatted.

nvm new ver works (characterlimitmoment)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.