How should I script a game to ensure it runs smoothly?

Hey all.

A few months ago when I was a lot newer to scripting, I created a game.
However, the game was created purely from LocalScripts, Scripts and of course RemoteEvents.

The game on minimum needed 20+ people for it to work properly, and the game was pretty simple.
However, whenever it hit 20 people, everyone’s ping would sky rocket, I’m speaking 3k - 5k ping for everyone. I came to terms it was my scripting.

What’s recommended to prevent this in the future? I heard Module scripts are useful but not entirely sure.

1 Like

so does it mean they have too much ping or too low? and yes modules are VERY very usefull

They have too much ping making the game unplayable as everyone was frozen pretty much.
In other words the game was some what ddosing itself. I used a dozen while true do loops and also had a lot of server → client communication, which in my future project have completely cut out on excessive use, however I feel like the more I add to my game it may get unstable without proper script set ups, as I still don’t touch modules and only Local’s and Servers, not even Remote Functions either now that I think about it.

hmmm, weird never happened to me. maybe its a roblox bug but try using modules!! (but idk if that will fix it)

Okay! I’ll make sure to learn Modules next, thank you! Marked as solution.
(also completely off-topic, but thanks for your comment on my portfolio too!)

lol i think you were kind thats all (oh and thanks! but idk if it did fix ur thing)

just a quick update, did it fix it?

Oh yes, the initial game which had those issues was a few months when I was also less experienced in coding, I redid the game entirely more experienced, however it hasn’t been tested with the normal 20 (where the issues would occur at).

I’m currently working on another game which in a few days would surpass 20 per server and wanted to make sure I wasn’t going to make the same mistake.

1 Like

good to hear that! chars

1 Like