Ad
Log in to vote
0

How do I make an anti lag script?

Asked by 7 years ago

My game is awfully lagging a lot and I need a script that makes it less laggy. Cann someone help please?

4 answers

Log in to vote
0
Answered by 7 years ago

Make a script that cleans hats. That's undoing lag.

0
Also try making a script that cleans unlocked parts. Lem0nzz 5 — 7y
Ad
Log in to vote
0
Answered by 7 years ago

Clean up all Debris or Hats so:

for _,ch in ipairs(Workspace:GetChildren()) do
if ch.className == 'Hat' then
ch:remove()
end
if ch.className == 'Debris' then
ch:remove()
end
end

This script does not completely eliminate lag, it just reduces it. Also, if you don't want either Debris or Hats to be removed when dropped, it wont work.

Log in to vote
0
Answered by 7 years ago

There is no way to definitely make an 'Anti-Lag' script. While you are able to keep the Workspace neat and tidy to eliminate tiny (and mostly unseen) amounts of lag, the most efficient way you can ensure a place does not lag is by keeping scripts nice and tidy.

For example, don't leave any infinitely running loops where there doesn't need to be - and definitely not if they're constantly creating a new instance. (That lags so much, in fact, that it is also used to crash players (if used locally) or servers).

Another great way to eliminate lag caused by scripts is to make sure they're doing things in the most efficient way possible and aren't taking up more memory than is actually needed.

Log in to vote
0
Answered by 7 years ago

Thank you

Answer this question