Loop not working properly in command bar

So i’m trying to make these little hamster tunnels a little less transparent, so I run a loop in the command bar and it wont update the transparency whatsoever.

Here is the little bit of code i wrote in 30 seconds that wont detect or change these parts with exactly .8 transparency.

for i,v in workspace:GetDescendants() do 	
	if not v:IsA("BasePart") then continue end 
	if v.Transparency == .8 then 		
		v.Transparency = .3 
                print(v.Transparency)
	end 
	
	
end

So i solved this really quickly and I think this may be a roblox bug but I assumed the number wasn’t EXACTLY .8, but it was rounded by roblox. Even though under the transparency it says exactly .8
image

so i just got any numbers between .7 and .9

task.wait(8)
print("changed")
for i,v in workspace:GetDescendants() do 	
	if not v:IsA("BasePart") then continue end 
	if v.Transparency >= 0.7 and v.Transparency <= .9 then 		
		v.Transparency = .3 	

		print(v.Transparency)
	end 

end

very annoying

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.