✓ Accepted answer
GetChildren("Parts") doesnt need an argument, also what you're doing wrong is setting everything to a material and Humanoid & accessories dont have that property, so you can do this to check if something is a part (BasePart) and then change its material
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local all = char:GetDescendants()
for i,v in pairs(all) do
if v:IsA("BasePart") then
v.Material = "ForceField"
end
end
And answering your other question, "How would I make the accessories disappear then for just a while?" you can change their handle's transparency
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local all = char:GetChildren()
local time = 5
for i,v in pairs(all) do
if v:IsA("Accessory") then
pcall(function() v.Handle.Transparency = 1 end)
end
end
wait(time)
for i,v in pairs(all) do
if v:IsA("Accessory") then
pcall(function() v.Handle.Transparency = 0 end)
end
end
If this answered your question mark this as the answer :D!
6 comments
Accessories and the head don't use materials
But I can still manually change them
How would I make the accessories disappear then for just a while?
set their transparency, see if that works
It didn't work out
char:GetChildren("Parts")is dumb. GetChildren doesn't take any arguments, so why did you add it>