Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Help with my lag reduce?

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

2 comments

0

Wat's It supposed to do?

0

NOTE that you might wanna update the "Items" table every time you run the function.

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.