Ok so, this might seem a little confusing. Basically, there are 20 objects named "confirm" and then a number. There are 20 so they are all numbered from 1 to 20. Example. Workspace.confirm1, workspace.confirm2... ext.
So, I want to delete one based on a value that is set a number between 1 and 20 randomly.
And I want to delete the confirm object with that number without handwriting every single one.
Example.
If workspace.Value.Value == 1 then
workspace.confirm1:Destroy()
Elseif workspace.Value.Value == 2 then
workspace.confirm2:Destroy()
End
Instead, I wanted to makebit easier, so I used brackets, brackets should have worked, but didn't. I wrote this
workspace.confirm[workspace.Value.Value]:Destroy()
But the output said it couldn't find the object "confirm", so obviously, that means it didn't add what was in the brackets, instead it only looked for something named "confirm", how do I make the variable (the value in the brackets) work and add it to the name of the object I want to Destroy?

1 comment
OMG thank you so much. Finally It works