Filter Script Not Working

Hey, I’m trying to make a sign have editable text although this error shows in the output while running.

Error:

ServerScript:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")

local EditEvent = ReplicatedStorage.Events:FindFirstChild("EditEvent")
local UpdateText = ReplicatedStorage.Events:FindFirstChild("UpdateText")

local ChatService = game:GetService("Chat")

UpdateText.OnServerEvent:Connect(function(Player, SText)
	
	if type(SText) ~= "string" then warn("signText argument not a string") end

	local FilteredText;
	pcall(function() FilteredText = ChatService:FilterStringForBroadcast(SText, Player)
	end)

	if FilteredText then
		UpdateText:FireAllClients(Player, FilteredText)
	end
end)

LocalScript:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")

local EditEvent = ReplicatedStorage.Events:FindFirstChild("EditEvent")
local UpdateText = ReplicatedStorage.Events:FindFirstChild("UpdateText")

local Sign = game.Workspace:FindFirstChild("Sign")
local SignText = Sign.Structure.Signs.TextSign.SurfaceGui:FindFirstChild("Text")
local EditPrompt = Sign.Structure.Prompt:FindFirstChild("Edit")

local EditFrame = Players.LocalPlayer.PlayerGui.Edit:FindFirstChild("Frame")

local Close = EditFrame.Buttons:FindFirstChild("Close")
local Apply = EditFrame.Buttons:FindFirstChild("Apply")
local Text = EditFrame.Buttons:FindFirstChild("Text")

EditEvent.OnClientEvent:Connect(function()
	EditFrame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "Out", "Sine", 0.5, true)
end)

Close.MouseButton1Down:Connect(function()
	EditFrame:TweenPosition(UDim2.new(0.5, 0, -1, 0), "Out", "Sine", 0.5, true)
	EditPrompt.Enabled = true
end)

Apply.MouseButton1Down:Connect(function()
	UpdateText:FireServer(Text.Text)
end)

UpdateText.OnClientEvent:Connect(function(SText)
	SignText.Text = SText
	EditFrame:TweenPosition(UDim2.new(0.5, 0, -1, 0), "Out", "Sine", 0.5, true)
	EditPrompt.Enabled = true
end)

Remove the Player argument from UpdateText:FireAllClients(Player, FilteredText)

Alright so after I did this change it doesn’t filter inappropriate text. Is is something to do with this change or was it already there to begin with since I wasn’t able to test it due to this bug.

If your testing this in studio then thats why. The Roblox filter does not work inside of studio.

Oh I see, thanks for the help.