Jump to content

Increasing loop length?


DiSaMe

Recommended Posts

It's not about script made improperly. It's about lots of data having to be processed. It's done when resource starts, so it wouldn't cause problems such as freezing during the game. Anyway, that's just a temporary way to see how things work, and I'm going to make a better script without long loops.

Link to comment

Well how much data is lots of data? And if it's really optimised code, you should maybe break the loops up

I'm not sure if this would work, but worth a try imo

local n = 1
local steps = 20
for n,n+steps do 
--whatever you do
n = n + steps
end
for n,n+steps do
n = n+steps
end

etc.

so it would effectively do the whole loop but would be several loops so it wouldn't time out

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...