PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience

Clone Example

Clone Example

Sep 30 2018, 8:18 AM PST

This code first references an existing object in the original variable. Then, it makes a copy of the object, sets the parent to that of the original, and finally moves the copy to (0, 50, 0).

    -- Get a reference to an existing object
    local original = workspace.Model
    -- Create the model copy
    local copy = original:Clone()
    -- Parent the copy to the same parent as the original
    copy.Parent = original.Parent
    -- Move the copy so it's not overlapping the original
    copy:SetPrimaryPartCFrame(CFrame.new(0, 50, 0))