Worried about random word generator

So basically i made a script that puts random letters into text label. The problem is that it’s random word generator and there’s a change it’ll generate a swear. In that case will i be banned? And how to fix generator to forbid it from making swears
The code itself:

local alphabet = {
	a = 1,
	b = 2,
	c = 3,
	d = 4,
	e = 5,
	f = 6,
	g = 7,
	h = 8,
	i = 9,
	j = 10,
	k = 11,
	l = 12,
	m = 13,
	n = 14,
	o = 15,
	p = 16,
	q = 17,
	r = 18,
	s = 19,
	t = 20,
	u = 21,
	v = 22,
	w = 23,
	x = 24,
	y = 25,
	z = 26
}
local label = script.Parent
while wait(0.05) do
	local rn1 = math.random(1, 27)
	for i,v in alphabet do
		if rn1 == v then
			label.Text = label.Text..i
		end
	end
	if rn1 == 27 then
		label.Text = label.Text.."4"
	end
	local lettersInText = string.len(label.Text)
	if lettersInText >= 1000 then
		label.Text = ""
	end
end

I mean you could do something like:

if text == "Swear word" or "Swear word"  then ---- do multiple 
     text = ""
end

This could work if you put it in your system of course by modifying it etc.

How I made a random code generator for my project is this script here:

local function generateCode()
	local code = ""
    --All of the characters it can use to generate.
	local characters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()" --72

    --Change the length of it here
	local length = 10

	for i = 1, length do
		local randomIndex = math.random(1, #characters)
		code = code .. string.sub(characters, randomIndex, randomIndex)
	end

	return code
end

and if you didn’t want any swears to come out of that, I recommend checking out String Filtering.

Ps: If your running this in a local script you could do a little something like this:

game:GetService("Chat"):FilterStringAsync("generated code", game:GetService("Players").LocalPlayer, game:GetService("Players").LocalPlayer)```
1 Like

Yeah string filtering would be a lot better than my idea where you have to manually add them.

Oops! I read it as “random world generation” and got excited, well nevermind.

Anyway, you should check out this documentation for string filtering:
Text Filtering

Thank you all for your suggestions but I believe there’s a misunderstanding between us. My code doesn’t generate words as you would think it would. Instead it makes a giant wall of random letters and numbers four:
robloxapp-20240101-1256143.wmv (161.7 KB)

oh and sorry for 4k ultra hd quality. I used built-in Roblox recorder to record the video

So it’s not a word generator, it’s a random letter generator? Since that’s the case, you don’t really have much to worry about as the chances of it generating a swear word are small at best. But as @TheTeslaModelXFan mentioned, look into Text Filtering | Documentation - Roblox Creator Hub. If you are that worried about it generating a random swear word.