Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I need help making a filtering system?

Asked by 3 years ago

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

0
What do you mean by a filtering system? thecelestialcube 123 — 3y
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. Ziffixture 6913 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

You gotta put the chat/string through a roblox filter string format

0
Hpw BuildBiggerGames -2 — 3y
0
How*? BuildBiggerGames -2 — 3y
Ad

Answer this question