I've never made a chat system before, thought just looking up the developer page would be easy. I'm certain my server script probably looks atrocious, so I appreciate any help.
Error message in the console.
15:29:53.262 - Script 'Players.Yokaoritu.PlayerGui.MessagingSystem.Frame.MainScript', Line 7
15:29:53.263 - Stack End
nil
15:29:53.264 - Players.Yokaoritu.PlayerGui.MessagingSystem.Frame.TS.LocalScript:3: bad argument #3 to 'Value' (string expected, got nil)
15:29:53.264 - Stack Begin
15:29:53.265 - Script 'Players.Yokaoritu.PlayerGui.MessagingSystem.Frame.TS.LocalScript', Line 3
Main Server Script
local TextService = game:GetService("TextService")
local filteredText = ""
game.ReplicatedStorage.onFilter.OnServerEvent:Connect(function(player, msg, rec, send, senderId)
local TextService = game:GetService("TextService")
local success, errorMessage = pcall(function()
local filteredMessage = TextService:FilterStringAsync(msg, senderId)
game.ReplicatedStorage.onFilter:FireAllClients(filteredMessage, send, rec, player)
--msg = filteredMessage?
--return?
end)
if not success then
warn("Error filtering text:", msg, ":", errorMessage)
-- Filter Failed
end
end)
Local Script that's supposed to be getting the message, it's getting Nil
game.ReplicatedStorage.onFilter.OnClientEvent:Connect(function(filteredMessage)
print(filteredMessage)
script.Parent.Value = filteredMessage --------- <----- This is the problem
if script.Parent.Value == nil then
print("Server Filter Returned Nil, There was an error.")
end
end)

1 comment
Thanks, I'll try to use this for now, I definitely gotta look into how other custom chats are filtered.