function CleanChar()
local list = torso:GetChildren()
for i = 1,#list do
if list[i].ClassName == "Motor6D" then
list[i]:Destroy()
end
end
end
How do i remove everything but not the neck?
function CleanChar()
local list = torso:GetChildren()
for i = 1,#list do
if list[i].ClassName == "Motor6D" then
list[i]:Destroy()
end
end
end
How do i remove everything but not the neck?
Just check if the name isn't neck
for i,v in pairs(torso:GetChildren()) do
if v.ClassName == "Motor6D" and v.Name ~= "Neck" then
v:Destroy()
end
end
why people using ~= not ==?
" == " means that if something equals something while " ~= " mean that if somethings does not equal something. I dont know how to explain it to you but some people may.
^ or comparison.
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
is the neck another Motor6D or a basepart?
just check if the thing's name is equal to "Neck" or whatever with using an "and"
if list[i].ClassName == "Motor6D" and list[i].Name == "Neck" then
no, i wanna clear all motor6ds and leave the neck (dont remove neck)