My other remover script is also not working?

So I have this remover and it does not work, I tried but its not doing anything, also no output errors, any help?

for i, obj in pairs(character:GetChildren()) do
      if obj.className=='Part' and 
          obj.Name== 'LouisVuitton' or 'Versace' or 'Gucci' then
       obj:Destroy()
    end
end

You’re not using the ‘or’ correctly, you put what you want to check in each ‘or’ instead of just putting the string. (You need to repeat for each or)

for i, obj in pairs(character:GetChildren()) do
      if obj.ClassName == "Part" and 
          obj.Name == "LouisVuitton" or obj.Name == "Versace" or obj.Name == "Gucci" then
       obj:Destroy()
    end
end

Ahh, I see. Alright thank you so much!

2 Likes

Wait, it didn’t work, I should have tested this before I accepted…

Please tell the errors if there’s any of them, that should’ve solved it, tested in workspace and worked without any problems for me.

Hm, there is no output error…

It’d be great if you posted the whole script as It might be something on it that is causing the error.

local Fendi = game.ServerStorage.Belts.Fendi
local LouisVuitton = game.ServerStorage.Belts.LouisVuitton
local Versace = game.ServerStorage.Belts.Versace
local Gucci = game.ServerStorage.Belts.Gucci
local Custom = game.ServerStorage.Belts.Custom
  
local re = Instance.new("RemoteEvent",game.ReplicatedStorage.BackpackEvents)
re.Name = "GiveFendi"

re.OnServerEvent:Connect(function(Player)
	local character = Player.Character
	local boi = character:GetChildren()
for i, obj in pairs(character:GetChildren()) do
      if obj.ClassName == "Part" and 
          obj.Name == "LouisVuitton" or obj.Name == "Versace" or obj.Name == "Gucci" then
       obj:Destroy()
    end
end
	Player:WaitForChild("leaderstats").Belts.Value = 1 
		print("FENDIII")
		wait(1)
		local newRadio = Fendi:Clone()
		newRadio.Parent = character
		newRadio.CFrame = character:WaitForChild("LowerTorso").CFrame * CFrame.Angles(0,3.14,6) -- or Torso if you use R6
		local weld = Instance.new("Weld") 
		weld.Part0 = newRadio
		weld.Part1 = character:WaitForChild("LowerTorso")
		weld.C0 =newRadio.CFrame:inverse() 
		weld.C1 = character:WaitForChild("LowerTorso").CFrame:inverse() 
		weld.Parent = newRadio	
    end)

I recommend not using the parent argument of Instance.new which is pretty bad for performance (Can read more about it here.
Are you sure that the player’s character is added correctly?
I’d change variable character to:

 Player.Character or Player.CharacterAdded:Wait() 

Also recommend debugging it if any more errors.

how about putting the or’s in brackets so the two parts of the if are treated as two parts not four as it looks wrong to me without them

Can you elaborate on this?
Which part doesn’t work? Does the script error? Does the print get printed?

Some things I’ve noticed:

  • You don’t use the boi variable
  • You’d probably want to wrap the part after and in this code into () parentheses:

if your intention is to not run the if statement if the object’s ClassName is not a part, like so:

if obj.ClassName == "Part" and (obj.Name == "LouisVuitton" or obj.Name == "Versace" or obj.Name == "Gucci") then