Hello. I creating a game, and I made a model in which there are a lot of parts. I need make them visible one by one but i dont know how.
You can use for loops for example
`
`
for i, v in pairs
`
`
But there are many parts with the same name. How can I select them and put in this loop
Do you want them to just vanish or fade away? If you want them to fade, you can use TweenService. Here an example without TweenService (for just vanishing):
for _, child in model:GetChildren() do
child.Transparency = 1
task.wait(1)
end
Here’s an example with TweenService (for fading):
local TweenService = game:GetService("TweenService")
for _, child in model:GetChildren() do
local tweenInfo = TweenInfo.new(1) -- You can modify this more.
local tween = TweenService:Create(child, tweenInfo, {Transparency = 1})
tween:Play()
tween.Completed:Wait()
end
Also, I saw this question you asked:
All you have to use is a for loop. The script will automatically loop through the parts in order, regardless of their names.
Unless you mean you want to exclude other parts. In this case, what you can do is create a Folder and put the parts you want inside of the loop in that folder, then loop through the folder.
Thank you! I tested it and It worked!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.