Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make a word blocker, in chat?

So I want to make a script that does for example, If you say like the code for twitter codes or something because I dont want people giving out codes in chat, it blocks the word and turns it into hashtags.

Any way to do that?

2 comments

0

Roblox already does that for you. Why would you want to do that?

0

Oh, you mean words. Make a table of Twitter codes and run a for loop through it and the chat log and if there is a match then turn the code to tags.

1 answer

✓ Accepted answer

Hello, even though this is not a request site, you are new to scripting so I can teach you the very basics on how you can do this.

THE GOAL What I'm assuming you want is that you want it so that if someone says a twitter code you put out it will be censored so people won't know. We'll use events such as Chatted. THE CODE

local Player = game:GetService("Players").LocalPlayer --We get the player.

local Code = "123" --The code

Player.Chatted:Connect(function(Message) --Every time the player chats we'll get the message of what he said.
	if string.match(Message,Code) then --If we find the code inside the player's message then
		--Censor the message. However, this is for you to script, not me.
	end
end)

1 comment

0

You can also do what RobloxWhizYT did where you check if a text message has been added to the chat logs and if that contains the code then you immediately censor that part of said message.

This discussion is preserved as it was. New answers, comments, and votes are closed.