Clone (Function): Difference between revisions
From Goodblox Wiki
Jump to navigationJump to search
Pizzaboxer (talk | contribs) (Created page with "{| |<onlyinclude> {{Function| name = Clone |arguments = |returns = Instance object |description = Returns a copy of this...") |
mNo edit summary |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{| | {{CatUp|Functions}} | ||
<onlyinclude>{{Function| | |||
{{Function| | |||
name = Clone | name = Clone | ||
|arguments = | |arguments = | ||
Line 7: | Line 6: | ||
|description = Returns a copy of this Object and all its children. The copy's Parent is nil | |description = Returns a copy of this Object and all its children. The copy's Parent is nil | ||
|object = Global | |object = Global | ||
}}</onlyinclude> | |||
==Example== | ==Example== | ||
<pre> | <pre> | ||
while true do --Starts up a While loop | |||
local model = workspace.Model:Clone() --Right here, it creates a copy of workspace.Model, and sets it as the variable "model" | |||
workspace.Model:Remove() --This removes workspace.Model from the game. | |||
model.Parent = game.Workspace --Sets the cloned object's Parent to the Workspace. | |||
wait(300) --Waits for 300 seconds. | |||
end | |||
</pre> | |||
[[Category:Functions]] | |||
Latest revision as of 20:39, 23 September 2021
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 local model = workspace.Model:Clone() --Right here, it creates a copy of workspace.Model, and sets it as the variable "model" workspace.Model:Remove() --This removes workspace.Model from the game. model.Parent = game.Workspace --Sets the cloned object's Parent to the Workspace. wait(300) --Waits for 300 seconds. end