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

I need help making a filtering system?

Ive tried this many times before, but i never understood it. Can somebody help me make a filtering system?

Ive read posts here, and on the documentation but I don't get it.

-- Remote:

local rs = game:GetService("ReplicatedStorage")
local Receive = rs.Receive
local Send = rs.Send

Send.OnServerEvent:Connect(function(player, input)
	local function getFilteredBCMessage(textObject)
		local filteredMessage
		local success, errorMessage = pcall(function()
			filteredMessage = textObject:GetNonChatStringForBroadcastAsync()
			end)
		if success then
			return filteredMessage
		    end
		return false
	end
end)
-- Localscript:

local debounce = false

local rs = game:GetService("ReplicatedStorage")
local Receive = rs.Receive
local Send = rs.Send

local button = script.Parent
local inputi = script.Parent.Parent.TextBox
local outputi = script.Parent.Parent.TextLabel

local input = ""

button.MouseButton1Click:Connect(function()
	if not debounce then
	debounce = true
	outputi.Text = "Calculating..."
	input = inputi.Text
		Send:FireServer(input)
		Receive.OnClientEvent:Connect(function(player, outputdone)
			outputi.Text = outputdone
			debounce = false
		end)
	end
end)

I tried to do something but I cant come further

2 comments

0

What do you mean by a filtering system?

0

You never fire back to the Client, nor do you send back the filtered string. That, and the function 'getFilteredBCMessage' is never executed, nor does it receive a TextFilterResult Object.

1 answer

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