i am doing a building game but every time someone regens the stand the parts cloned from that spawn also get removed becouse they stay in the same folder, any help? this is what i got when i searched clone
function CloneSelection()
-- Clones selected parts
-- Make sure that there are items in the selection
if #Selection.Items == 0 then
return;
end;
-- Send the cloning request to the server
local Clones = SyncAPI:Invoke('Clone', Selection.Items, GetHighestParent(Selection.Items))
-- Put together the history record
local HistoryRecord = {
Clones = Clones;
Unapply = function (HistoryRecord)
-- Reverts this change
-- Deselect the clones
Selection.Remove(HistoryRecord.Clones, false);
-- Remove the clones
SyncAPI:Invoke('Remove', HistoryRecord.Clones);
end;
Apply = function (HistoryRecord)
-- Reapplies this change
-- Restore the clones
SyncAPI:Invoke('UndoRemove', HistoryRecord.Clones);
end;
};
-- Register the history record
History.Add(HistoryRecord);
-- Select the clones
Selection.Replace(Clones);
-- Flash the outlines of the new parts
coroutine.wrap(Selection.FlashOutlines)();
end;

2 comments
Can you provide some code?
k