Why does one thing turn invisible, while the other doesn't? Both of these come from the same script

Is this a bug? I made a script to make both the baseplate and my stand invisible, but it only makes the baseplate invisible, not the stand. This is a server script.

Here’s what it looks like: https://gyazo.com/a8a2e0f39f155621837aa5208d6a1f0a

Players = game:GetService("Players")

script.Parent.OnServerEvent:Connect(function(Player)
	local StandModel = Player.Character:FindFirstChild("Stand")
	if StandModel.Values.Summoned.Value == false then return end
		local Shout = Instance.new("Sound", Player.Character.Head)
		Shout.Name = "Shout"
		Shout.SoundId = "rbxassetid://3084495179"
		Shout.Volume = 2		
		Shout:Play()
		local Info = TweenInfo.new(0.5)
		local CCE = game:GetService("TweenService"):Create(game.Lighting:FindFirstChild("ColorCorrectEffect"),Info,{Saturation = -2})	
		local DoF = game:GetService("TweenService"):Create(game.Lighting:FindFirstChild("DepthOfField"),Info,{FarIntensity = 1})
		CCE:Play()	
		DoF:Play()
		game.Workspace.Values:FindFirstChild("TS").Value = true
		game.ReplicatedStorage.FX_RE:FindFirstChild("Timestop"):FireClient(Player)
		for i,v in pairs(Player.Character.Stand:GetDescendants()) do -- Make stand invisible
			if (v:IsA("MeshPart") or v:IsA("BasePart")) then
				v.Transparency = 1
			end
		end
		game.Workspace.BetterBasePlates.Transparency = 1 -- Make baseplate invisible

Short answer: if it’s not doing what you want it to, then it’s a bug. The real question is whether the engine or your code has the bug, and it’s likely your code.

Long answer: You need to isolate the problem in your code. You’ve got a ton of stuff going on in the lines you posted; you need to test things individually, and verify what parts of your code are running. Use print, the Output, maybe even the debugger if you’re really desperate. See Debugging Tools for what tools you have available in studio for this.

1 Like

Alright ill just break down the scripts section by section and try to find out what’s wrong

Minor nit-pick, but what’s the point of checking for a MeshPart when you’re already checking for BaseParts?

When using the function, you don’t need to check if it’s anything other than a BasePart.
You can just do,

if v:IsA("BasePart") then
    -- code
end

You don’t need to check if it’s a mesh part, or whatever.

1 Like

Oh I didn’t know about this, thanks for saying. It will make it so much easier.