Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to detect every single part in-game?

I basically want to make cast shadow of every single part in-game false with the command bar. Issue is there are parts in models, and there are many models in even more models.

I do know the basics and I'm aware that this won't work:

for i,v in pairs(game.Workspace:GetChildren()) do 
if v.className == "Part" then 
v.CastShadow = false
end 
end 

Any way to execute this with the command bar?

1 answer

✓ Accepted answer
for i,v in pairs(workspace:GetDescendants()) do
	if v.ClassName == "Part" then
		v.CastShadow = false
	end
end

GetDescendants gets the model with their children and it keeps getting the children till there are no children left

2 comments

0

is that neil the great the great

0

is that starmaQ the babby man :o

This discussion is preserved as it was. New answers, comments, and votes are closed.