Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is it possible to use concatenations in hierarchies?[CLOSED]

I've toyed around with this before, but I don't think I ever got it to work. I just want to know if something like this is possible, and if so how to go about doing it.

Say I have 10 parts in Workspace named part1, part2, part3 and so on. Is it possible to use something like the following code to reference one of the parts?

game.Players.PlayerAdded:connect(function()
	random = math.random(1, 10)
	Workspace[part..random]:Destroy()
end)

edited for spelling

1 answer

✓ Accepted answer

As long as 'part' is a variable, otherwise you need to make it a string.

This discussion is preserved as it was. New answers, comments, and votes are closed.