I had a loop while task.wait(0.1)
with 5 for _, loops and other checks and it really lagged the game.
‘The Loop basically gathers all of the player data and checks if an action can be done’
The loop is because the data can update, but a downside is the lag ,which is pretty obvious. But is there a way to optimize loops without making an event for everything changing (its hard to explain here)
while task.wait(0.1) do
--for example
for _, in pairs(data) do
for _, folder in pairs(storage) do
if data then
end
end
end
end