So as you can see I add the InvokeServer but i got an error :
17:34:35.308 FilterMessage is not a valid member of ReplicatedStorage "ReplicatedStorage" - Client - LocalScript:9
So as you can see I add the InvokeServer but i got an error :
17:34:35.308 FilterMessage is not a valid member of ReplicatedStorage "ReplicatedStorage" - Client - LocalScript:9
You need to insert a remote event in replicatedstorage and call it FilterMessage. I fixed the code now using a remote event.
im lost haha xd what did i do xd in order ( im sorry )
Remove the variable result and remove the print because now it will return nothing.
And in the onclientevent the first parameter is the player and the second parameter is the message
And in the clone.plr.Text put:
clone.plr.Text = "[" .. plrThatSent.Name .. "]: " .. message
Also remember that the script must be in the serverscriptservice
it looks difficult but okay i will try thx !
This is better as it uses an asynchronous thread. ChatService does not meaning that you’d have to make your own function to wait until it finished running the filter.
Your never calling getTextObject or getFilteredMessage also :GetChatForUserAsync requires it to be sent to one individual user, use Broadcast if your going to do it for the full server.
woah :o you lost me xd too difficult for me i think xd
If you want to use :FireAllClients() you’ll need to use: TextFilterResult | Roblox Creator Documentation
ok but i use it where ? im lost haha
ok so i follow all the guide and i think im ok but it still doesnt work :
the local script
This is the problem:
Replace this with:
Event.OnServerEvent:Connect(onSendMessage)
i got this error …
Replace this (Line 34 of main script):
Event:FireClient(player, filteredMessage)
Also, add this to the start of the chat gui:
script:FindFirstAncestorOfClass("ScreenGui").Enabled = false
script:FindFirstAncestorOfClass("ScreenGui").Enabled = game:GetService("Chat"):CanUserChatAsync(game.Players.LocalPlayer.UserId)
This is required by Roblox as it respects parental controls.
Sorry, you should replace this with (again another Roblox requirement):
if game:GetService("Chat"):CanUsersChatAsync(sender.UserId, player.UserId) then
Event:FireClient(player, filteredMessage)
end
This is so blocked players cannot chat with each other, Roblox prohibits blocked users chatting to each other…
OKAY ! ITS WORK ! Thank you a lot man <3