Hi, I'm a beginner scripter and I'm trying to write a script that deletes an object in a model if the model already has more than 10 of the object in it. Here is my script:
if script.Parent:GetChildren() > 10 then
local object = script.Parent:FindFirstChild("Object")
object:Destroy()
end
Thanks

1 comment
"Object" is pretty ambigious. So lets instead say, if each item was called "Part" you would replace "Object" with "Part". Also, make sure you indent youre code