I have a function that when I click the teleport button I want it to fade the character away then teleport them, then fade back it, but for some reason it teleports the player, fades each part out and in one by one, i.e. The torso fades out then fades in, then the left arm fades out and in...
player = script.Parent.Parent.Parent
script.Parent.TP1.TextButton.MouseButton1Click:connect(function()
for _, child in ipairs(player.Character:GetChildren()) do
if child:IsA("BasePart") then
child.Transparency = .1
wait(.1)
child.Transparency = .2
wait(.1)
child.Transparency = .3
wait(.1)
child.Transparency = .4
wait(.1)
child.Transparency = .5
wait(.1)
child.Transparency = .6
wait(.1)
child.Transparency = .7
wait(.1)
child.Transparency = .8
wait(.1)
child.Transparency = .9
wait(.1)
child.Transparency = 1
wait(.1)
player.Character:MoveTo(game.Workspace.LC2.Position)
wait(.1)
child.Transparency = .9
wait(.1)
child.Transparency = .8
wait(.1)
child.Transparency = .7
wait(.1)
child.Transparency = .6
wait(.1)
child.Transparency = .5
wait(.1)
child.Transparency = .4
wait(.1)
child.Transparency = .3
wait(.1)
child.Transparency = .2
wait(.1)
child.Transparency = .1
wait(.1)
child.Transparency = 0
elseif child:IsA("Model") then
--N/A
end
end
end)

2 comments
elseif child:IsA("Model") then why is this line here ? basically it means nothing
So i dont need that, I left it in there just incase anyone said I needed it.