I’m working on a script to generate random license plates for vehicles when you spawn a vehicle.
The pattern is AAAXAXX (A = letter, X = number)
I have done this script so far:
local attempt = 0
local TextService = game:GetService("TextService")
local ok = false
repeat
local plate = GeneratePlate('mercosul') -- Returns a random string in the format AAAXAXX
local filteredTextResult = nil
local success, TextFilterResult = pcall(function()
return TextService:FilterStringAsync(plate, game.Players.LocalPlayer.UserId)
end)
attempt = attempt+1
if success then
local FilteredText = TextFilterResult:GetNonChatStringForBroadcastAsync()
ok = true
print("[Attemp: "..attempt..'] '..plate..' passed the filter.')
break
else
warn("[Attemp: "..attempt..'] '..plate..' was censored. Retrying...')
end
task.wait(.1)
until ok == true
However, EVERY plate is getting censored. I left the script running for a while and the loop repeated over than 2,500 times and didn’t get an uncesored string.
Why is this happening and what can I do to avoid sending too many requests and get a quick response? (without the need to create my own database with plates that won’t be randomly generated and will just be taken from an array or something like that)
Or maybe my script is wrong?