How to make smooth stand disappearing?

I made a script but i want to make it disappearing smoothly so how do i do that?

if DaBounce == false and game.Workspace:WaitForChild(player.Name).Stand.StandName.Value == "HierophantGreenSeugo" then
	for i, v in pairs(game.Workspace:FindFirstChild(player.Name).Stand:GetChildren()) do
		if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") then
			v.Transparency = 1
		end
	end
	for i, v in pairs(game.Workspace:FindFirstChild(player.Name).Stand.HierophantGreen:GetChildren()) do
		if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") then
			v.Transparency = 1
		end
	end
elseif DaBounce == true and game.Workspace:WaitForChild(player.Name).Stand.StandName.Value == "HierophantGreenSeugo" then
	for i, v in pairs(game.Workspace:FindFirstChild(player.Name).Stand:GetChildren()) do
		if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") then
			v.Transparency = 0
		end
	end
	for i, v in pairs(game.Workspace:FindFirstChild(player.Name).Stand.HierophantGreen:GetChildren()) do
		if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") then
			v.Transparency = 0
		end
	end
	game.Workspace:FindFirstChild(player.Name).Stand.StandHumanoidRootPart.Transparency = 1
end

thanks for helping :flushed:

3 Likes
for i = 0,10 do
wait(0.1)
v.Transparency = v.Transparency - 0.1
end

Use something like this to make it slowly fade out.

yeah its work but i need to make all parts appear at the same time

Is the script located in the model?

no its located in serverscriptstorage

1 Like

You can use spawn() or coroutines but I would advise that you use TweenService as it grants more control of your tween and doesn’t yield (pause until it is completed) the script

2 Likes

Alright, I’m assuming that your stand is in Workspace, so try something like this:

for _,v in pairs(workspace.Stand:GetChildren()) --Change to where the model is located.
      if v:IsA("Part") then -- Add different kinds of parts if needed.
         for i = 0,10 do
         wait(0.1)
           v.Transparency = v.Transparency - 0.1
          end
      end
end

still doesnt appear at the same time

Do you want it to appear or disappear?

i need both appear and disappear

Try this:

for _,v in pairs(workspace.Stand:GetChildren()) --Change to where the model is located.
  if v:IsA("Part") then -- Add different kinds of parts if needed.
     for i = 0,10 do
     wait(0.1)
       v.Transparency = v.Transparency - 0.1
      end
        wait(2)
          for i = 0,10 do
        wait(0.1)
       v.Transparency = v.Transparency + 0.1
      end
  end
end

OP, read my post above if you want to make them disappear at the same time. @m3o0n wait() yields the script and that’ll still cause the script to wait until one part is done disappearing

1 Like

Yeah OP, his reply above is the solution. I didn’t really understand what OP was wanting.

I just copied your code and made it tween. Change the number inside TweenInfo() to change how long it takes. Not tested, of course.

local function tween(part, num)
	if part.Name ~= 'StandHumanoidRootPart' then
		return game:GetService'TweenService':Create(part, TweenInfo(0.5), {Transparency = num})
	end
end

if DaBounce == false and game.Workspace:WaitForChild(player.Name).Stand.StandName.Value == "HierophantGreenSeugo" then
	for i, v in pairs(game.Workspace:FindFirstChild(player.Name).Stand:GetChildren()) do
		if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") then
			tween(v, 1):Play()
		end
	end
	for i, v in pairs(game.Workspace:FindFirstChild(player.Name).Stand.HierophantGreen:GetChildren()) do
		if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") then
			tween(v, 1):Play()
		end
	end
elseif DaBounce == true and game.Workspace:WaitForChild(player.Name).Stand.StandName.Value == "HierophantGreenSeugo" then
	for i, v in pairs(game.Workspace:FindFirstChild(player.Name).Stand:GetChildren()) do
		if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") then
			tween(v, 0):Play()
		end
	end
	for i, v in pairs(game.Workspace:FindFirstChild(player.Name).Stand.HierophantGreen:GetChildren()) do
		if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") then
			tween(v, 0):Play()
		end
	end
end
1 Like