im making like a WPM calculator game like type racer. i ran into a problem. i’m trying to clone parts for each character in a word. one of my scripts selects multiple words at random from a table and sends it to the server. (selectedwords is the table that is full of randomly selected words)
in my output, it says that there are 229 characters in the table; therefore it should create 229 parts. the for loop says that it created 229 parts but when i open my folder, there are only 110 parts inside. (for some reason it caps at 110). ty guys!
character count output:
![]()
for loop count output:

parts in the folder (says 110):

code:
letterEvent.OnServerEvent:Connect(function(p, selectedWords)
--if existing letters, fillblocks exits
for _, letter in pairs(letters:GetChildren()) do
SIZEOFFSET = 0
letter:Destroy()
end
for _, fillblock in pairs(FillBlockFolder:GetChildren()) do
fillblock:Destroy()
end
-----------------------------------------------------------------------
transfer = selectedWords
local randomColor = getRandomColorFromAttribute(config)
local currentWord = config:GetAttribute("currentWord")
config:SetAttribute("currentWord", selectedWords[1])
for _, randomWord in ipairs(selectedWords) do
local randomWordLength = #randomWord
totalCharacters += randomWordLength
for l = 1, randomWordLength do
LETTER_INDEX += 1
local currentLetter = string.sub(randomWord, l, l)
local letterClone = invisibleLetter:Clone()
letterClone.Name = LETTER_INDEX
local textlabel = letterClone.SurfaceGui.TextLabel
textlabel.Text = currentLetter
letterClone.Color = randomColor
letterClone.Parent = letters
letterClone.CFrame = letterClone.CFrame * CFrame.Angles(0, math.rad(180), 0)
local GapbetweenLetters = Vector3.new(SIZEOFFSET * 1.25,0,0)
letterClone.Position = letterSpawnLocation.Position - GapbetweenLetters
SIZEOFFSET += letterClone.Size.X
if letterClone then
print("cloned letter part: ", currentLetter, LETTER_INDEX)
else
warn("failed to clone: ".. currentLetter, LETTER_INDEX)
end
end
task.wait(.1)
end
local a = 0
for i, word in ipairs(selectedWords) do
a += #word
end
print(selectedWords)
print("total Characters calculated: "..totalCharacters, "total Characters in table: "..a)
config:SetAttribute("currentCharacters", totalCharacters)
SIZEOFFSET = 0
focusCamera:FireClient(p, "focusStartBlock", CURRENT_INDEX, SIZEOFFSET)
end)
and here’s a visual representation:
