I've tried this so far:
local plr = game.Players.LocalPlayer local char = plr.Character or plr.CharacterAdded:Wait() local all = char:GetChildren("Parts") for i=1, #all do all[i].Material = Enum.Material.ForceField end
This only changes the body materials, without changing the head or accessories.
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() --// replace to get children if you dont want it to change every part material to force field for i,v in pairs(all) do --// easier than doing table[i] 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!