-
I want to get 1 cube name which number that is inside the name matches with your level
-
I’m getting all of the names but I want only one. the name should have number in it that matches with your level number.
-
Not much, I don’t know what to search for or like how to word it. cause I don’t get what I want probably because how I have worded it.
current script:
local Cubes = game:GetService("ReplicatedStorage"):WaitForChild("Cubes"):GetChildren()
for i, cube in pairs(Cubes) do
if cube:IsA("Part") then
if cube.Name ~= "Main"..level.Value then
local newcube = cube:Clone()
print(newcube.Name)
newcube.Name = "Main"
newcube.Parent = Part.Parent
end
end
end
Part.Parent:Destroy()
end