I know filtering doesn’t work in studio, and I tested this in a roblox game, but it will filter no matter what you input. I even tried copy and pasting the exact same string into the chat and it wasn’t filtered, but my script says it was.
LocalScript:
local sound = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("Clans"):WaitForChild("Click")
local remote = game:GetService("ReplicatedStorage"):WaitForChild("Events"):WaitForChild("Clans"):WaitForChild("Create")
local namevalue = script.Parent.ClanName
local descriptionvalue = script.Parent.ClanDescription
local imagevalue = script.Parent.ClanImage
local textService = game:GetService("TextService")
local lightRed = Color3.fromRGB(255, 64, 67)
local lightGray = Color3.fromRGB(138, 138, 138)
local white = Color3.fromRGB(255, 255, 255)
local label = script.Parent.Parent.Error
local namestroke = script.Parent.Parent:WaitForChild("Name").TextBox.UIStroke
local descstroke = script.Parent.Parent:WaitForChild("Description").TextBox.UIStroke
local uiStroke = script.Parent.UIStroke
local button = script.Parent
local function checkValues()
if namevalue.Value == "" or descriptionvalue.Value == "" or imagevalue.Value == 0 then
return false
end
return true
end
local function updateButtonState()
local valuesAreSet = checkValues()
if valuesAreSet then
button.Interactable = true
button.TextColor3 = white
else
button.Interactable = false
button.TextColor3 = lightGray
end
end
local function filterTextAsync(player, text)
local success, filteredText = pcall(function()
return textService:FilterStringAsync(text, player.UserId):GetNonChatStringForBroadcastAsync()
end)
if success then
return filteredText
else
return nil
end
end
button.MouseButton1Click:Connect(function()
sound:Play()
if checkValues() then
local filteredName = filterTextAsync(game.Players.LocalPlayer, namevalue.Value)
local filteredDescription = filterTextAsync(game.Players.LocalPlayer, descriptionvalue.Value)
local nameFiltered = filteredName ~= nil
local descriptionFiltered = filteredDescription ~= nil
namestroke.Color = nameFiltered and lightGray or lightRed
descstroke.Color = descriptionFiltered and lightGray or lightRed
if nameFiltered and descriptionFiltered then
remote:FireServer(filteredName, filteredDescription, imagevalue.Value)
else
label.Visible = true
end
end
end)
game:GetService("RunService").RenderStepped:Connect(updateButtonState)
I’m recreating the issue, but would you mind sharing the file as an .rbxl? It would be easier for me to edit it and tell you what exactly is wrong so I can guide you on how to fix it without me needing to recreate the gui’s and stuff.
Yeah that’s perfect, only send me the stuff that the code requires, for example the RemoteEvents, the guis and that sound file doesn’t really matter as I can test code without needing that. I have some what established the issue already.
I removed pretty much all the unnecessary stuff, I left the firing of the remote event in there (but you don’t need where the remote event gets processed, that’s not necessary):
I edited the code, plus added some there’s just a bug I need to fix cause even when I test it in Roblox Studio it does the same in the client now. Only in studio it let’s anything through.
I don’t know what’s happening but it’s working and then it isn’t did you remove any image frames, values, labels or anything cause I keep need to comment and add or remove stuff from gui and code?
Yeah, I’ll breakdown the code and tell you want you need to do. Here’s an image of what I currently achieved. Tell me if this is good and i’ll proceed to write what you actually did wrong and what you need to do to solve this.