I think your issue is that you’re doing game.Players[player] when using the square brackets expects a string but you give it player, which is a Player Instance, just use the player instead, you alreayd have it, no need to try to retrieve it again.
Also why is the Server being responsible for changing UI? That’s normally the client’s job, so I’d recommend doing what @Benified4Life had mentioned and changing the code around to use a RemoteFunction, you pass in the string you want filtered, the server filters it and returns back the result of the filtering back to the client to then change text around
RemoteFunctions technically already do something like that, You just Invoke the Server, the server does the filtering work, and then gives back the client the filtered string, so then the client can change the text themselves
RemoteFunction.OnServerInvoke = function(player, text)
local filteredText = game:GetService("TextService"):FilterStringAsync(text.Text, player.UserId)
local filteredTextAsString = filteredText:GetNonChatStringForBroadcastAsync()
return filteredTextAsString
end
Where RemoteFunction is your RemoteFunction, in the client you just do InvokeServer, giving it the textbox, and then it returns the filtered text and you just use that return text to change the text of something
script.Parent.Submit.MouseButton1Click:Connect(function(player)
local text = game.ReplicatedStorage.Bio:InvokeServer(script.Parent.Bio.Text)
script.Parent.Submit.Text = text
end)
It doesn’t seem to be filtering. It sets the text, though.
Client:
script.Parent.Submit.MouseButton1Click:Connect(function(player)
local text = game.ReplicatedStorage.Bio:InvokeServer(script.Parent.Bio.Text)
script.Parent.Submit.Text = text
end)
Server:
function bio(player, text)
local filteredText = game:GetService("TextService"):FilterStringAsync(text, player.UserId)
local filteredTextAsString = filteredText:GetNonChatStringForBroadcastAsync()
return filteredTextAsString
end
game.ReplicatedStorage.Bio.OnServerInvoke = bio
Are you testing it from Studio or Ingame? Filtering doesn’t work from Studio
@AxeI_c That is correct as MouseButton1Click returns nothing so @OP can remove it, but it doesn’t really have any relation to what is happening here as they don’t use it anyways