Basically, my script to filter a message is not working. Instead of printing out the filtered text, it just prints “Instance”. Here is all of my code.
Script inside TextBox:
local http = game:GetService("HttpService")
local cooldown = false
local rem1 = game.ReplicatedStorage:WaitForChild("Server")
local rem2 = game.ReplicatedStorage:WaitForChild("Client")
script.Parent.Parent.Parent.Send.SendGui.TextButton.MouseButton1Click:Connect(function()
rem1:FireAllClients()
print("client fired")
rem2.OnServerEvent:Connect(function(player, message)
print(message)
local Data = {
["content"] = message
}
Data = http:JSONEncode(Data)
print(Data)
http:PostAsync("https://webhook.lewisakura.moe/api/webhooks/yummyyummydonttakemytokenlol", Data)
cooldown = true
wait(60)
cooldown = false
end)
end)
LocalScript in startergui:
local rem = game.ReplicatedStorage:WaitForChild("Server")
local rem2 = game.ReplicatedStorage:WaitForChild("Client")
local TextService = game:GetService("TextService")
local textbox = game.Workspace:WaitForChild("Part").SurfaceGui.TextBox
local player = game.Players.LocalPlayer
local userid = player.UserId
local filter1 = game.ReplicatedStorage:WaitForChild("FilterServer")
local filter2 = game.ReplicatedStorage:WaitForChild("FilterClient")
local earlymessage = ""
local message = ""
textbox.FocusLost:Connect(function(inputObj)
earlymessage = textbox.Text
print(earlymessage)
filter1:FireServer(userid, earlymessage)
filter2.OnClientEvent:Connect(function(msg)
message = msg
end)
end)
rem.OnClientEvent:Connect(function()
rem2:FireServer(message)
print("server fired")
end)
Server Script for filtering in sss:
local rem = game.ReplicatedStorage:WaitForChild("FilterServer")
local rem2 = game.ReplicatedStorage:WaitForChild("FilterClient")
local TextService = game:GetService("TextService")
rem.OnServerEvent:Connect(function(userid, startmessage)
local success, errorMessage = pcall(function()
local finalmessage = TextService:FilterStringAsync(userid, startmessage):GetNonChatStringForBroadcastAsync()
rem2:FireAllClients(finalmessage)
print(finalmessage)
end)
if not success then
warn("Error filtering text:", errorMessage)
end
end)
The error is in the last script, it just prints instance and does not send anything to the discord.