#Help with memory optimization
1 messages · Page 1 of 1 (latest)
local part = Instance.new("Part")
part.Parent = workspace
-- later in the game
part:Destroy()
This destroys unused objechts
** You are now Level 3! **
local connection = part.Touched:Connect(function(hit)
print("Something touched me")
end)
-- later
connection:Disconnect()
It disconnects event listeners
table.remove(myTable, index)
This cleans up table
while true do
task.wait(1)
print("Still running safely")
end
And this controls loops
I hope this will help you