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

Can alot of printing be a source of lag?

Asked by
royee354 129
6 years ago
Edited 6 years ago

I am having a bunch of scripts in a tool that do alot of printing, when I equip the tool the printing happens and there is a bit of lag, each script atleast prints more than 2 prints per equip, there is something like 20 scripts, could the printing be the source of lag?

2 answers

Log in to vote
0
Answered by 6 years ago

Printing itself shouldn't cause noticeable lag unless your printing about 200 times a second in a while true do loop and you got about 20 copies of that script.

Lag is a noticeable delay between the actions of the players such as input and the output what the game does. There are many possible sources of lag, one of the most common ones is probably the script quality or too many parts and textures. In development though, sometimes lag is something that can be fixed and sometimes it's just unchangeable. For Instance, when you create a new game with some sort of scripting function, it may cause lag even though there are 2 people.

So how do I reduce lag?

When it comes to playing the game yourself unable to change the scripts or game. You can reduce the graphics level. But when you are making a game there are tons of things you can do such as avoiding Unions, avoid decals on parts and other scripting things such as reducing the number of lines and also avoiding global variables.

There are so many things that are possible that even Roblox decided that they should make an article.

http://robloxdev.com/articles/Fighting-Against-Lag

This article will show you all the ways to reduce lag for builders to scripters.

Hopefully, this helped.

Best of luck developer!

Side Note: Avoid using loops if you don't know when you should use them. Especially infinite loops.

Ad
Log in to vote
0
Answered by
tobhyyy 26
6 years ago

No, printing this amount wont have any effect on the game unless you have 50 people spamming equip and unequip.

Answer this question