I made a automatic hat filter for my game, which deletes hats with effects & obstructive size automatically. I decided to post it here.
This doesn’t require you to constantly update the list, as it’ll detect majority of hats automatically.
If you need to manually blacklist certain hats, There is a manual blacklist function. You can find its respective table as a child of the script.
The script goes inside ServerScriptService.
I do not care for credit, however it would be nice.
UPDATE No longer deletes hats that have offending items in them, instead deletes the item inside the hat. Now checks the entire hat, and not just the things in the handle of the hat. Redid example blacklist item
This update will print more information, but you can remove said prints in the script.
local SIZE_ALLOWED = 6
game.Players.PlayerAdded:Connect(function(p)
p.CharacterAdded:Connect(function(c)
for _, accessory in c:GetChildren() do
if not accessory:IsA("Accessory") then
continue
end
local handle = accessory:FindFirstChild("Handle")
if not handle or not handle:IsA("MeshPart") then
warn("problematic accessory or hat isnt a meshpart") --enable the beta feature or the bhvr setting under workspace...
continue
end
if handle.Size.Magnitude > SIZE_ALLOWED then
accessory:Destroy()
end
end
end)
end)
it automatically deletes big accessories. the threshold may be off because i barely tested it. you need the workspace behavior (and it may still be a beta feature) enabled in order for this to work. the feature converts special meshes to meshparts which allows you to get its size.
also instead of deleting you could do something like this: handle.Size = handle.Size / 2
so the player still has the accessory but it is made smaller. this can look really odd though so use with caution.