I have this lag reduce script I'm working on. No errors appear in output, but it doesn't work. Help please?
local items = workspace:GetChildren() function reduce() local num = 0 for i = 1, #items do if items[i].ClassName == "Hat" then num = num + 1 items[i]:remove() end end local hint = Instance.new("Hint",workspace) hint.Text = "Entity Remover has removed "..num.." items!" wait(1) hint:remove() end while wait(30) do reduce() end
You have to place line 1 inside the function, your getting the number of items in the workspace, it hasn't updated so its assuming theres nothing in it.