when the player writes a message in the textbox within the screenGui, the message appears in the sign. But the problem is the msg is not filtering
could someone help me filter this message?
-- LOCAL SCRIPT --
local player = game.Players.LocalPlayer
local TextMsg = script.Parent.CreateMsg:WaitForChild("TextMsg")
TextMsg.Changed:Connect(function()
if player.Character:FindFirstChild("Sign") then
player.Character["Sign"]:WaitForChild("UpdateSign"):FireServer(TextMsg.Text)
end
end)
-- SERVER SCRIPT--
local chat = game:GetService("Chat")
script.Parent.Unequipped:Connect(function()
script.Parent.SignPart.SurfaceGui.TextLabel.Text = ""
end)
script.Parent.UpdateSign.OnServerEvent:Connect(function(player,msg)
if player.Character:FindFirstChild("Sign") then
local fithered
local success, errorMessage = pcall(function()
fithered = chat:FilterStringAsync(msg,player,player)
end)
script.Parent.SignPart.SurfaceGui.TextLabel.Text = fithered
end
end)