there is an example of filter system.
Search DAF in google
Its a truck company
The system is so strict, you cannot make a plateâŚ
ohhh
-_- character limit again?
local Filter = {
"Inappropriate",
"Inappropriate2"
}
local function RandomString()
local Return = ""
for Index = 1, 3 do
Return = Return .. string.char(65, 98)
end
return Return
end
local TextLabel = ...
TextLabel:GetPropertyChangedSignal("Text"):Connect(function()
local Text = TextLabel.Text
for _, String in pairs(Filter) do
if string.match(string.lower(Text), String) then
TextLabel.Text = RandomString()
end
end
end)
then i suggest doing what empereans said and make ur own filter system as there arent many bad things within the range of 6 letters
i created a system that i tested and works although ur gonna have to fill out the filter
local characters = {}
for i = 65, 90 do
table.insert(characters, string.char(i))
end
for i = 0, 9 do
table.insert(characters, i)
end
local function generateRandomCharacter()
return characters[math.random(1, #characters)]
end
local filter = {
"69";
"420";
"sex";
--create all the bad stuff as this is just a few
--make sure all of the things r equal to or under 6 digits
}
local function filterCheck(plate)
for _, word in ipairs(filter) do
if string.find(plate:lower(),word) ~= nil then
return true
end
end
return false
end
local function createRandomPlate()
local plate = ""
for _ = 1, 6 do
plate = plate..generateRandomCharacter()
end
print(plate)
if filterCheck(plate) == true then
return createRandomPlate() --recurse
else
return plate
end
end
local plate = createRandomPlate()
for i = 1, 6 do
--make sure u name the textlabels 1,2,3,4,5,6
frame[tostring(i)].Text = plate:sub(i,i)
end
hope this helped
Hey, whenever youâre showing random characters or user inputs in your game, itâs a smart move to filter those strings, especially if other players can see them. Itâs on us, the devs, to make sure everythingâs clean. Good news is, Roblox has got our backs with a filtering system. Now, I get it â a lot of random strings can get flagged by this system. But a simple trick is to just keep trying until you get a string that passes the filter. In the code below, I also added a check history, ensuring no two plates are ever the same. Stick with it, and you wonât have to stress about bans. Remember, if you skip the filtering step, youâre kinda asking for trouble with Roblox moderation. And about setting up a manual library check? Well, there are so many words and variations to account for that youâd essentially be recreating Robloxâs own filter, which theyâve already provided!
-- Server
local TextService = game:GetService("TextService")
local Players = game:GetService("Players")
local assignedPlates = {} -- Table to store already assigned plates
local function generateNumberPlate()
local numberPart = math.random(100, 999) -- random 3-digit number
local charPart = string.char(
math.random(65, 90), -- random uppercase letter
math.random(65, 90),
math.random(65, 90)
)
return tostring(numberPart) .. " " .. charPart
end
local function isPlateUnique(plate)
return not assignedPlates[plate]
end
local function filterPlate(plate, player)
local filteredText = TextService:FilterStringAsync(plate, player.UserId)
return filteredText:GetChatForUserAsync(player.UserId)
end
local function getUniqueFilteredPlate(player)
local plate
local filteredPlate
repeat
plate = generateNumberPlate()
filteredPlate = filterPlate(plate, player)
until plate == filteredPlate and isPlateUnique(plate)
assignedPlates[plate] = true
return plate
end
-- Example usage
Players.PlayerAdded:Connect(function(player)
local plate = getUniqueFilteredPlate(player)
print(plate) -- Here you can assign the plate to the player or do anything else with it.
end)
roblox is very strick abt this though
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.