its only reading test and not LavaSword
local names = {"LavaSword","test"}
for i = 1,#names do
function clean()
if Player.Backpack:FindFirstChild(names[i],true) then
Player.Backpack:FindFirstChild(names[i],true):remove()
end
end
end
its only reading test and not LavaSword
local names = {"LavaSword","test"}
for i = 1,#names do
function clean()
if Player.Backpack:FindFirstChild(names[i],true) then
Player.Backpack:FindFirstChild(names[i],true):remove()
end
end
end
I'm not actually sure what you're trying to do here with that clean function.
I assume you meant to do this:
local names = {"LavaSword","test"}
function clean()
Player.Character.Humanoid:UnequipTools() --forcefully unequips all Tools, so you don't miss any in the loop.
for i = 1,#names do
if Player.Backpack:FindFirstChild(names[i],true) then
Player.Backpack:FindFirstChild(names[i],true):remove()
end
end
end
clean()
This discussion is preserved as it was. New answers, comments, and votes are closed.