so i made this admingui for a game where you can make a message, so i put FilterStringForBroadcast
so it wouldnt go under review but it does work, though the message only says "filter" as the variable name for the FilterStringForBroadcast
. It works perfectly ingame and solo mode but its not filtering or getting the message right.
local script:
local button = script.Parent local player = game.Players.LocalPlayer local typing = script.Parent.Type local cantype = false button.MouseButton1Click:Connect(function() if cantype == false then cantype = true local message = game.ReplicatedStorage.message:Clone() game.ReplicatedStorage.Remotes.AdminMenu:FireServer(player, "filter", script.Parent.Type.Text, player.Name) game.ReplicatedStorage.Remotes.AdminMenu.OnClientEvent:Connect(function(filteredstring) message.Parent = script.Parent.Parent.Parent message.text.Text = player.Name..": "..filteredstring message.text.Font = Enum.Font[script.Parent.Parent.MessageAdvanced.SignFont.FontChanger.Text] wait(2.5) message:Destroy() wait(.5) cantype = false end) end end)
server script:
game.ReplicatedStorage.Remotes.AdminMenu.OnServerEvent:Connect(function(player, filtering, text, name) local filter = game:GetService("Chat"):FilterStringForBroadcast(text, player) print(filter) game.ReplicatedStorage.Remotes.AdminMenu:FireClient(player, filter) end)
theres no errors, but the problem is in the server script prob, bc i put a print and it prints "filter" still as the variable name. Is there anything that im doing wrong bc i checked on wiki and videos and it looks alike and they work but not for me. I just started doing this custom filtering stuf so i dunno wut im doing wrong.