Instance.new

Adding objects into workspace with a script!

by AvishalRBX

Author Avatar

#1 STEP

So in this tutorial i will show you how to create a script that adds objects to workpsace without doing anything!

So what you want to do first is create a script and insert that script into workspace if it isn't already.

#2 STEP

You will now need to type some code. I will make it as easy as possible.

local newpart = Instance.new("Part")

This is the first bit you want to type. If you are having trouble head on over to the playground button and practice this piece of code or practice all of the code all together

You can also name "newpart" to anything you would like

newpart.Parent = game.workspace
newpart.Position = Vector3.new()

This is the next part of the code. Now you may be wondering how to set the position . . Let me tell you! What you want to do is create aq new part and drag that part to where want it to be. Then you will go to the parts properties and find position. Copy the numbers and paste it in the brackets - () -

ADD ONS

If you want you could named the part and size it so, thats what this step will tell you about. Go back into the script and type:

newpart.Size = Vector3.new()
newpart.Name = "Name Here"

With the size numbers it's the exact same as the position but look for the size numbers instead of position. Go ahead and copy the numbers again and then paste the numbers into the brackets - () -

ALL CODE

while wait(2) do

local newpart = Instance.new("Part")

newpart.Parent = game.workspace
newpart.Position = Vector3.new()
newpart.Size = Vector3.new()
newpart.name = "Name Here"

end

This is the complete code! I only added one small thing which is a while wait() do function this will make it insert a new part every few seconds!

Good Job on completing this tutorial i hope you learn't something new!

Bye!

View in-game to comment, award, and more!