I don’t understand where the error is here
The script works, but I get this error and the game lags
The script should check if the player has a certain head size and then destroy the module
local Part = script.Parent
local EntireModel = script.Parent:GetDescendants()
local Modle = script.Parent
local db = true
for i,v in pairs(EntireModel) do
if v:IsA("BasePart") then
v.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if db == true then
db = false
if humanoid.HeadScale.Value == 3 then
db = true
Modle:Destroy()
end
end
end)
end
end