Returning true instead of filtering message

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I am making a booth system.
  2. What is the issue? Include screenshots / videos if possible!
    When filtered, it just says the word true.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub? I tried using Chat Service, but same thing…

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

local textS = game:GetService("TextService")


game.ReplicatedStorage.EditEvent.OnServerEvent:Connect(function(player, text, isImageIdBlank, imageId)
	local claimedBooth = player:WaitForChild("Booth").Value
	if isImageIdBlank == true then
		claimedBooth.Sign.SurfaceGui:WaitForChild("ImageLabel").Image = game.Players:GetUserThumbnailAsync(player.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)
	end
	if isImageIdBlank == false then
		claimedBooth.Sign.SurfaceGui:WaitForChild("ImageLabel").Image = "rbxassetid://"..imageId
	end
	local filter = textS:FilterStringAsync(text, player.UserId, Enum.TextFilterContext.PublicChat)
	local filteredMessage = filter:GetNonChatStringForBroadcastAsync()
	
   
	claimedBooth.Sign.SurfaceGui:WaitForChild("TextLabel").Text = filteredMessage
end)

No errors appears on output. Footage of me testing:
robloxapp-20231212-0837528.wmv (2.3 MB)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

Although it isn’t mentioned in the documentation, it is possible that it is returning 2 values - whether it was successful, and the text itself.

Try replacing

local filteredMessage = filter:GetNonChatStringForBroadcastAsync()

with

local _, filteredMessage = filter:GetNonChatStringForBroadcastAsync()

If my hypothesis is correct, it would resolve the issue/

It says Unable to assign property Text. string expected, got nil in the output (when playing in the actual game, not studio)