You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
Find the length of a table without this happening /
What is the issue? Include screenshots / videos if possible!
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried to look for solutions and haven’t found one yet
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
for i in NumberRange(1, #Keys) do
local clonedObject = clone:Clone()
clone.Parent = Keys[i]
clone.Run.Enabled = true
end
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
EDIT There’s nothing wrong with the table in question if you were going to say that, it simply uses the GetChildren method.
You need to make sure that you one, use a basic for loop, and two
it should be “clonedObject” not “clone” or it would be passing in only one of whatever you wanted to clone.
for i = 1, #Keys do
local clonedObject = clone:Clone()
clonedObject.Parent = Keys[i]
clonedObject.Run.Enabled = true
end
Hey OP, just letting you know that this could possibly be AI-generated code - the things that throw me off are the weird reference to a Run property (which no Instance has as a property, if I’m not mistaken) (if it was an attribute you’d use the set attribute method) and the incorrect use of the NumberRange object.
If it was your doing, it’s usually not a good idea to trust AI-generated code, especially for an IDE with a unique language such as ROBLOX. Instead, use references to the documentation or the DevForum in order to figure out how and why things work.
Run is a script, so it has to be enabled after the object gets cloned. Also, I’m not too experienced with for loops because sometimes I do python and for that, the for loop is structured: