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

Why doesn't this script filter the text correctly and display on the status bar?

-- JoshTheDarkOne --

local button = script.Parent
local textbox = button.Parent.EnterShout
local shout = game:GetService("ReplicatedStorage"):WaitForChild("Shout")
local TextService = game:GetService("TextService")

for i,v in pairs(game.Players:GetPlayers()) do
	player = v.userId
end

button.MouseButton1Click:connect(function()
	local filteredText = TextService:FilterStringAsync(textbox.Text, player)
	filteredText = shout.Value
end)

The status bar is working and I have proved that by changing the value!

1 comment

0

yay terrible game security

1 answer

button.MouseButton1Click:connect(function()
    local filteredText = TextService:FilterStringAsync(textbox.Text, player)
    	filteredText = shout.Value
end)

You are attempting to change filteredText to the shout.Value, and not the other way round. As well as this, it seems TextService filtering requires the user id, so just change (textbox.Text, player) to (textbox.Text, player.UserId). Just something to note, I can see this is from a GUI. If you're not filtering-enabled (Experimental Mode on), just make sure the script is a server script and not a local script. If it is a 'normal game', you'll need to send to a server script using a RemoteEvent/RemoteFunction to be able to use TextService.

If you require any more assistance, let me know.

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