This lag spike occurs when a player claims a tycoon.
Once claimed, the saved tycoon model is just cloned into workspace. Since server scripts cannot run in serverstorage, the whole tycoon is loaded and whatever the player never bought, it removes it. This causes a huge lag spike because the tycoon is big.
Create a new empty model in workspace, then iterate through the model’s children and clone them individually with a small time interval in-between. Place each cloned child into the new model you’ve made. This will reduce lag but make the cloning take a bit longer.
I see how you’re going with this, but I can’t quite understand how to implement it into my system.
This is what I originally had:
if button:FindFirstChild("Object") and purchases:FindFirstChild(button.Object.Value) then
object = purchases[button.Object.Value]
objects[object.Name] = object:Clone()
object:Destroy()
end