A Roblox Community
You must log in to view most of the sites content. If you do not already have an account click Register below...

A Roblox Community

A community of Robloxians who want to learn to script and build on Roblox Studio.
 
HomePortalFAQRegisterLog in
If you're a experienced coder make some tutorials! It would really help the site grow.
Make sure you read the rules(Which can be found by clicking here)
If you're a beginner at coding, try some tutorials.
We have many Moderators/Admins watching this site. Contact them with Questions.
Let us know what your favorite sport is. By clicking here to vote (Click here)
This site is becoming inactive. Lets make it active.
Log in
Username:
Password:
Log on automatically: 
:: I forgot my password
Top posters
blueymaddog
 
naknak
 
Supernapalm
 
slayer9365
 
myrco919
 
m27frogy
 
ninga95
 
CloneTrooper787
 
raboy117
 
trappingnoobs
 
Top posting users this month
m27frogy
 
myrco919
 
blueymaddog
 
ninga95
 
naknak
 
Latest topics
» Keylogging/getting the mouse unnoticed
May 16th 2012, 8:43 pm by naknak

» Nederlands
May 16th 2012, 11:52 am by m27frogy

» みなさん、こんにちは!
May 16th 2012, 10:32 am by myrco919

» Try out the panel!
May 16th 2012, 10:30 am by myrco919

» The Local Script: A Robloxian's Worst Nightmare
May 16th 2012, 10:26 am by myrco919

» You're lost.
May 14th 2012, 4:36 am by m27frogy

» Good news, well sorta!
May 9th 2012, 8:29 pm by ninga95

» AIR, Artificial Intelligence Revised
May 5th 2012, 6:35 am by m27frogy

» local script help:
April 7th 2012, 8:22 am by Lukasm

» How to loop regen creations.
April 7th 2012, 6:34 am by MrNicNac

» Refering to functions as objects?
March 28th 2012, 8:29 am by Sethalonian

» Help new people find their way around the website
March 22nd 2012, 11:43 pm by blueymaddog

» I wanna see if anyone can
March 19th 2012, 1:46 am by blueymaddog

» Dispute Rules
March 14th 2012, 1:22 am by blueymaddog

» Explaining the Basics of a Script with Example
March 11th 2012, 6:37 pm by blueymaddog

» Java or C?
March 10th 2012, 8:48 pm by blueymaddog

» Talk about your favourite hobbies!
March 10th 2012, 8:45 pm by blueymaddog

» Metatables Tutorial
March 10th 2012, 8:43 pm by blueymaddog

» Rules of this forum. Please read!
March 9th 2012, 1:35 pm by blueymaddog

» Epic Ice King Staff
March 9th 2012, 1:34 pm by blueymaddog


Share | 
 

 Basic use of Clone()

View previous topic View next topic Go down 
AuthorMessage
naknak
Administrator
Administrator


Posts: 855
Join date: 2010-07-30

PostSubject: Basic use of Clone()   November 27th 2010, 1:50 pm

The Roblox function "Clone()" is a very valuable function. It can make copies of anything you want it to. Like if I wanted to create a certain brick multiple times, I could use this:
Code:

new_brick = Workspace.Brickname:Clone



This creates a piece for us to use. It's parent is nil, so we must put it inside of the Workspace.

Code:

new-brick.Parent = Workspace



Now we have our copy visible. We can edit the brick to suit our needs now.

Code:

new_brick.Position = Vector3.new(1,1,1)
new_brick.Name = "My new brick"
new_brick.Anchored = true



Back to top Go down
asdfscripter
Novice Scripter
Novice Scripter


Posts: 31
Join date: 2011-01-16

PostSubject: Re: Basic use of Clone()   January 17th 2011, 12:53 pm

but wait a minute... what is new_brick? is it just a command you made up? or is it actually an alternative to the function :Clone()?
Back to top Go down
asdfscripter
Novice Scripter
Novice Scripter


Posts: 31
Join date: 2011-01-16

PostSubject: Re: Basic use of Clone()   January 17th 2011, 12:54 pm

dont answer this lol... your making it sound like your writing C...
Back to top Go down
asdfscripter
Novice Scripter
Novice Scripter


Posts: 31
Join date: 2011-01-16

PostSubject: Re: Basic use of Clone()   January 17th 2011, 12:54 pm

just saying
Back to top Go down
naknak
Administrator
Administrator


Posts: 855
Join date: 2010-07-30

PostSubject: Re: Basic use of Clone()   January 17th 2011, 1:14 pm

The first thing I wrote: new_brick = Workspace.Brickname:Clone



Its a variable
Back to top Go down
asdfscripter
Novice Scripter
Novice Scripter


Posts: 31
Join date: 2011-01-16

PostSubject: Re: Basic use of Clone()   January 17th 2011, 1:20 pm

i know but why not just do

Code:
 create = Workspace.Brickname:Clone


your making it sound like your writing C...
Back to top Go down
asdfscripter
Novice Scripter
Novice Scripter


Posts: 31
Join date: 2011-01-16

PostSubject: Re: Basic use of Clone()   January 17th 2011, 1:20 pm

i usually reserve the _ character for dummy variables
Back to top Go down
blueymaddog
Administrator
Administrator


Posts: 1108
Join date: 2010-12-09
Age: 13

PostSubject: Re: Basic use of Clone()   January 18th 2011, 3:44 am

u forgot da '()' it's :Clone() not :Clone. and new-brick should be new_brick. Nice tutorial apart from the typo's

_________________
blueymaddog
Administrator • Moderator • Expert Scripter
PM: blueymaddog
<+1 post. ujelly?>
Back to top Go down
 

Basic use of Clone()

View previous topic View next topic Back to top 
Page 1 of 1

 Similar topics

-
» The Clone Wars Season 5
» AutoCAD 2D Basic - Plotting Exercise
» Ps2dis begginers guide - how to make a basic subroutine
» Basic Commands - Making a clone script
» searching IPKOP clone

Permissions in this forum:You cannot reply to topics in this forum
A Roblox Community :: Tutorials and Resources :: Scripting Tutorials :: Beginner-