What I plan is to have a random code thats generated and I have pumpkins set that can be changed to whatever that code is.
However, when the code matches, it doesn't return the code as matching.
local TheCode = math.random(1,9)..math.random(1,9)..math.random(1,9)..math.random(1,9)..math.random(1,9)..math.random(1,9)..math.random(1,9)..math.random(1,9)..math.random(1,9)
for i,v in pairs(workspace.Pumpkins:GetChildren()) do
-- Finds certain Pumpkin with Number for example (Pumpkin1, Pumpkin2, etc.) and matches each one pairing with the digit placement of the code, shown as "TheCode" variable
while (workspace.Pumpkins:FindFirstChild('Pumpkin'..string.match(v.Name,"%d+")).Code.Value) == (string.sub(TheCode, (string.match(v.Name,"%d+")) , (string.match(v.Name,"%d+")))) do
print('code matched')
end
end
end
