Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to make a word blocker, in chat?

Asked by 5 years ago
Edited 5 years ago

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?

0
Roblox already does that for you. Why would you want to do that? DeceptiveCaster 3761 — 5y
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. DeceptiveCaster 3761 — 5y

1 answer

Log in to vote
0
Answered by
Mr_Unlucky 1085 Moderation Voter
5 years ago
Edited 5 years ago

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)
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. Mr_Unlucky 1085 — 5y
Ad

Answer this question