Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Does disconnect functions help with server lag?

Title says most of it. Basically my game suffers from server lag cause of the effects of it, would disconnecting every function in my scripts help?

4 comments

0

what do you mean by disconnecting every function? not sure what you mean

0

Like for example there's a function called "healingFunction" then I would do healingFunction:Disconnect() So would disconnecting all my functions when im done with them gonna help the server lag

0

Definitely would help. I believe there's a tab in the developer console that allows you to pinpoint where your lag is coming from, or you could use profilebegin/profileend.

0

You mean disconnecting events? I haven't heard of a disconnect on functions before

1 answer

✓ Accepted answer

The "disconnect()" feature on ROBLOX is useful in many ways. For example, if you want to disconnect a function that has been running for a great amount of time, you can easily use the :disconnect() after that function name to disconnect the function from the ROBLOX game server. However, if your server has lag all the time, I suggest looking more into the scripts then just the functions in them.

3 comments

0

i had no idea about the disconnect feature! i'll have to keep that in mind

0

The thing is when there is a lot of effects in the workspace, it starts lagging, is there any way to prevent this?

0

If you are cloning these effects into Workspace, it will eventually cause lag. However, there is a fix to this problem. Their is a a part of game service called "Debris." Once you use Debris, you can get rid of every effect that you don't need after a while. Simply type, and example, "game:GetService("Debris"):AddItem(ObjectHere, SetAmountOfTimeBeforeObjectIsDeleted)

This discussion is preserved as it was. New answers, comments, and votes are closed.