I am trying to make a chat system...
Server Code:
game.ReplicatedStorage.Remote.Event.Chat.OnServerEvent:Connect(function(plr,txt)
local TextService = game:GetService("TextService")
local filteredText = "[ERROR WITH FILTERING]"
local success, errorMessage = pcall(function()
filteredText = TextService :FilterStringAsync(txt,plr.userId)
end)
if success then
end
game.ReplicatedStorage.Remote.Event.Chat:FireAllClients(plr,filteredText)
end)
Client Code:
game.ReplicatedStorage.Remote.Event.Chat.OnClientEvent:Connect(function(playr,txt)
print(txt) -- returns nil?
local Text
pcall(function()
Text = txt:GetChatForUserAsync(Player.userId)
end)
renderMsg(playr,(Text or txt) or "[ERROR WITH FILTERING]")
end)
In the server code, [txt] is an Instance, which is what is supposed to happen, but when I shoot the instance over to the client, it says that [txt] is nil
