Script breaks when adding multiple names?
Asked by
8 years ago Edited 8 years ago
Edit: Sorry for the strange/bad title, I had to pass the "Your title should be specific! Describe your problem concisely." problem ASAP.
So, I've a model called "Model6" and all parts/unions in it are called "Toro". I've made this so when a player joins the game, all the parts/unions in the model disappear(using CanCollide and Transparency properties).
1 | modelOfBricks = game.Workspace.Model 6 |
4 | for i,v in pairs (modelOfBricks:GetChildren()) do |
5 | if v.Name = = nameOfBricks then |
However, when changing the name of one of the parts/unions in Model6 to "Toro2" and then adding "Toro2" to the line nameOfBricks =
the works properly and makes all parts/unions disappear except the one with the name "Toro2", here is the :
1 | modelOfBricks = game.Workspace.Model 6 |
2 | nameOfBricks = "Toro" , "Toro2" |
4 | for i,v in pairs (modelOfBricks:GetChildren()) do |
5 | if v.Name = = nameOfBricks then |
I also tried writing "Toro, Toro2"
instead, but it didn't work. Output says nothing.