While likely the cause of lag, with a big game, the scripts in the game execute very slowly. Even a "wait()" will take about a half-second. It's a very unreliable script system if you script by timing. I realize this may be unsolvable, and it's just the size of the game causing the scripts to slow, but if there's a solution for the scripts to run at a more normal speed, I'd love to hear it. Other than the scripts, the game runs just fine at a nice 60fps on my computer. Really, the only thing slow are the scripts, which is odd to me.
COMMUNITY QUESTION
Scripts perform slower than written?
1 answer
If you're running on a local script and want something to happen as fast as your game's framerate can render, use
game:GetService("RunService").RenderStepped:connect(function() --RenderStepped fires every time a frame is rendered.
--do stuff!
end)
Hope this helps!
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
That sounds like a really cool trick, actually, thank you! Is it possible to do something similar for non-local scripts?
Unfortunately not. :(
A general rule of thumb is to optimize your code. Don't make the server do anything unless it absolutely has to! (i.e. making sure every other person can see a change in the game world).
Alright, thanks for the help!