I have a script inside severscriptservice thats “supposed” to destroy everything inside a folder in the workspace. However it just doesn’t work? It is printing when the remote event is recieved btw.
game.ReplicatedStorage.SendClear.OnServerEvent:Connect(function(plr)
print("Ruz")
for i, items in pairs(game.Workspace.Dropped:GetChildren()) do
items:Destroy()
end
end)
game.ReplicatedStorage.SendClear.OnServerEvent:Connect(function(plr)
print("Ruz")
for i, items in pairs(game.Workspace.Dropped:GetChildren()) do
if items:IsA("Tool") then
items:Destroy()
end
end
end)
It doesn’t need to iterate over anything in a order right? If you’re just deleting everything you can do
game.ReplicatedStorage.SendClear.OnServerEvent:Connect(function(plr)
print("Ruz")
for i, items in workspace.Dropped:GetChildren() do
if items:IsA("Tool") then
items:Destroy()
end
end
end)