local pattern = "XX0o XXX"
local plate = ""
for i = 1, #pattern do
local c = string.sub(pattern, i, i)
if (c == "o") then
plate = plate..tostring(math.random(6,9))
elseif (c == "X") then
plate = plate..string.char(math.random(65,90))
else
plate = plate..c
end
end
for i,v in pairs(script.Parent.Plates:GetChildren()) do
v.SGUI.Identifier.Text = plate
end
script:Destroy()
It gets the normal pattern for a standard UK license plate, which is “XX00 XXX”, X being a letter and 0 being a number. Then it generates random numbers for 0 and random letters for X. Then they combine those letters together and scramble it so it is is somewhat like the pattern and then puts it inside of the plates.
If you’ve AI generated that entire script, I wouldn’t consider the entire project as “yours” necessarily, but the concept here is really cool! I’d definitely want to use this and make adjustements to match the plate format for my area.
A suggestion, though … you could potentially code a plugin where there are several settings for the plate format for different provinces within several countries, that would also be quite unique.