Im making a custom chat, and one thing i cant figure out how to make older messages delete automatically after 50 messages are sent
For example the default roblox chat deletes messages that cant fit in the latest 50 messages.
Where it says “Chat ‘/?’ or ‘/help’ for a list of chat commands.”, in 50 messages and that message is at the top of the scrolling frame, it would be removed.
Then you can automatically remove them after a certain period of time with the Debris service
Example:
local DebrisService = game:GetService("Debris")
local AutomatedRemoveTime = 40
local MsgBox = --whatever
DebrisService:AddItem(MsgBox,AutomatedRemoveTime) -- Will not yield the script and will automatically remove the msg after the period of time has elapsed
In that case you can create a IntValue that updates after a msg is added, It will hold the total amount of msgs that was sent, then from there you can add a listener for the IntValue that will check if the amount of msgs that you would want has been reached.