local numberOfPartsToDelete = 5000 local Map = script.Parent
local function has_value (tab, val) for index, value in ipairs(tab) do if value == val then return true end end
return false
end
game.Players.PlayerAdded:Connect(function(player) player.Chatted:Connect(function(raw_msg) local msg = raw_msg:lower()
if msg == "delete" then
local randomNumbers = {}
for i = 1, numberOfPartsToDelete do
table.insert(randomNumbers, math.random(1, #Map:GetChildren()))
end
for i,v in pairs(Map:GetChildren()) do
if v:IsA("Model") or v:IsA("BasePart") then
if has_value(randomNumbers, i) then
v.anchored = false
end
end
end
end
end)
end)

1 comment
local numberOfPartsToDelete = 5000 local Map = script.Parent local function has_value (tab, val) for index, value in ipairs(tab) do if value == val then return true end end return false end game.Players.PlayerAdded:Connect(function(player) player.Chatted:Connect(function(raw_msg) local msg = raw_msg:lower() if msg == "delete" then local randomNumbers = {} for i