Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Strange issue, making a loop longer causes crash?

Asked by 5 years ago

I'v created a script that creates a 10 x 10 x 10 grid of parts i then increased the size to 100 x 100 x 100 and it crashed studio any ideas on what may cause this?

0
Creating too many parts in a small amount of time? xPolarium 1388 — 5y
0
It's overloading the amount of assets that can be Created at once causing Lag, either that or your computer can't handle it Ziffixture 6913 — 5y
0
Creating instances in roblox is slow EpicMetatableMoment 1444 — 5y
0
100^3 is a lot of iterations to be done at once. Do each part in chunks to lessen the struggle the CPU has to handle. EpicMetatableMoment 1444 — 5y
View all comments (7 more)
0
Placing a wait(0) fixes the issue but takes forever to create the blocks, how do games like epic mining regen the blocks without the issue? 95jake95 14 — 5y
0
They don't regen blocks, as you mine, the blocks are generated. When the mine "collapses" all that happens is the blocks are destroyed and the mine is reset. SteamG00B 1633 — 5y
0
Sorry, Santa doesn't exist. :( LawlR 182 — 5y
0
I understand that that's what im trying to achieve the script makes the blocks waits for 300 seconds (5 mins) then removed all blocks and recreates them but with a wait 0 its slow... 95jake95 14 — 5y
0
If you're trying to create a million blocks all at once, then no, you don't understand what SteamG0D is saying. fredfishy 833 — 5y
0
What mining games will do is generate a single surface of blocks. Normally that means you'd mine through the surface in one go, but what they do is generate all the adjacent blocks when you'd otherwise reach an empty space fredfishy 833 — 5y
0
What you could do is make it so there is walls around the Mine and the Wall's CanCollide enables. You then have all the Players in the Mine teleport to the Start, allowing them not to enter the mine. Then make it so every 0.5 seconds one layer of the mine gets added. It'll be pretty quick and shouldn't take long. TheOnlySmarts 233 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

ALWAYS ADD A wait() BEFORE A LOOP

Ad

Answer this question