Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why does FilterStringAsync() cause a delay?

Okay, so I am the developer of a custom chat and in order for it to be safe for everyone on ROBLOX, I must include FilterStringAsync, which looks a little like this in a SERVER script.

local MessageToFilter = "Hello, how are you?"
local ChatService = game:GetService("Chat")
local PlayerSentFrom = game.Players.takecover
-- Loop all the players and filter string individually for each player
for _,v in ipairs(game.Players:GetPlayers()) do
	local FilteredMessage = ChatService:FilterStringAsync(MessageToFilter, PlayerSentFrom, v)
	print(FilteredMessage)
end
-- I don't know if that would work, I wrote it in this forum.

I was just wondering, when using the chat why there was a short delay for this function. Does anyone have any information about this?

1 answer

✓ Accepted answer

FilterStringAsync is a YieldFunction

This means that it will pause the script until it gets a response from roblox

2 comments

0

yield*

0

Ahhh, thanks for this.

This discussion is preserved as it was. New answers, comments, and votes are closed.