This script is supposed to check Workspace for newly inserted objects, see if those objects are within the parameters of an array, and to check if that newly created object is a player's character, if not either of those things, to remove it.
However, regardless of whether or not that object is within the parameters of the array, the script still deletes it.
Can someone please help?
Here's the script:
local allowed = {"Handle", "Bullet", "Rocket", "Camera", "Bomb", "Explosion", "Humanoid", "Part", "Missile", "Grenade", "Flashbang"}
workspace.ChildAdded:connect(function(item)
Check(item)
end)
function Check(item)
for i,v in pairs(allowed) do
if v[i] == item.Name or item:FindFirstChild("Humanoid") then
print('good')
else
item:Destroy()
end
end
end

2 comments
This works, thank you so much!
No problem