What's the alternative for Collectgarbage? It says it's deprecated but I don't see any other alternatives for it

What I’m trying to do is literally what it says, collecting garbage from chat system messages removing them after a while if a certain amount of player messages aren’t sent in the chat. What’s the alternative for this if there is any and why was it deprecated because it does a great job

There isn’t one. You shouldn’t need to be forcing the GC to run.

I use it because the chat system notifications become spammy

Modify the chat system itself to have the desired behavior.

It was never possible to force a garbage collection through collectgarbage() on Roblox. The only command that worked was "count" which got how much memory was in use by Lua.

gcinfo() is the replacement.