i want all the bodyparts to fade away at once instead of one by one as shown in the video robloxapp-20200809-2340212.wmv (153.8 KB)
this is the code
local Mob = workspace.Dummy
local Children = Mob:GetChildren()
for i, Child in ipairs(Children) do
if Child.ClassName == "Part" or Child.ClassName == "MeshPart" then
for i = 0,1,0.1 do
Child.Transparency = i
wait()
end
Child:Destroy()
end
end
The reason why it does each part one at a time is because of how your code is written. It runs as it’s written. So it loops over the parts and then does one part, completes that and then goes to the next part.
local TweenService = game:GetService("TweenService")
for i, v in ipairs(Children) do
if v.ClassName == "Part" or v.ClassName == "MeshPart" then
local tweeninfo = TweenInfo.new(0.5) -- how long you want them to take
local Goal = {}
Goal.Transparency = 1
local tween = TweenService:Create(v, tweenInfo, Goal)
tween:Play()
delay(0.5, function()
v:Destroy()
end)
end
end