Clone (Function)

From ROBLOX Wiki
Revision as of 12:28, 11 December 2024 by PRG (talk | contribs) (Created page with "{| |<onlyinclude> {{Function| name = Clone |arguments = |returns = Instance object |description = Returns a copy of this Object and all its children. The copy's Parent is nil |object = Global |}}</onlyinclude> |} ==Example== <pre> while true do --Starts up a While loop model = game.Workspace.Model:clone() --Right here, it creates a copy of game.Workspace.Model, and sets it as the variable "mode...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
Function
Syntax Clone( )
Returns Instance object
Description: Returns a copy of this Object and all its children. The copy's Parent is nil
In Object: Global


Example



while true do   --Starts up a While loop

  model = game.Workspace.Model:clone()  --Right here, it creates a copy of game.Workspace.Model, and sets it as the variable "model"

  game.Workspace.Model.Parent = nil  --This sets the game.Workspace.Model's parent to nothing, removing it from the game.

  model.Parent = game.Workspace  --Sets the cloned object's Parent to the Workspace.

  wait(300)  --Waits for 300 seconds.

end