How can I run some text through roblox's filter?

So I made a random code generator but Im scarred its gonna make a word that is totally against roblox’s TOS so how can I run the word through roblox’s filter? My code RN if you need it

local function GenerateLobbyCode()
	local code = ''
	
	for i = 0,math.random(MinDigits,maxDigits),1 do
		local digit = Digits[math.random(1,total)]
		
		if digit then
			code = code..digit
		end
	end
	warn(code)
	
	return code
end

When you filter your text, your codes are likely going to be tagged either way, even if they aren’t inappropriate words. What I would use is something like HttpService:GenerateGUID(false) which periodically generates numbers in between characters, which will be the best you can do to limit bad words.

Code:

local HttpService = game:GetService("HttpService")

local function GenerateLobbyCode()
	return HttpService:GenerateGUID(false):sub(1, 8)
end

I added :sub to only get the starting 8 characters in the GUID for readability purposes since the original GUID will be fairly long.

I would also recommend adding a check to make sure the lobby code isn’t in use, but since most of your code is omitted, I can’t do it.

By the way, even if the word is inappropriate, your game won’t be taken down or punished for it unless it was intentional. Roblox won’t just see one ID from your game and ban you lol.

So does the GUID generate random codes? If so this is great! Thank you!

Yep, more info on it:

1 Like

TextService

Thank you! Ill use this if I ever need it!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.