Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-4

How do I create a part in a script?

Asked by 9 years ago

Thanks it would be greatly appreciated!

3 answers

Log in to vote
4
Answered by 9 years ago

I have said it before and I will say it again: "This is not a 'Give Me Free Scripts Pl0x' Site, this is an assistance site so please...shoo"

None the less this is easy so here, but don't be asking without trying next time...

part = Instance.new(game.Workspace)
part.Position = Vector3.new(1,1,1)
part.Size = Vector3.new(1,1,1)
part.Achored = true --Set to true so it won't move or false so it will...
part.CanCollide = true --If set to false you can walk through

Next time....don't ask without trying, this is an assistance site.

Ad
Log in to vote
0
Answered by 9 years ago
local part = Instance.new("Part") -- creates the part
part.Parent = workspace -- sets the part's location to workspace

perhaps you wanted to change the size of to part to be a 1x1x1 brick You accomplish with the following code added at the bottom of the script

part.Size = Vector3.new(1,1,1) -- Vector3.new() creates a size or position in studs.
0
Thanks! xImmortalChaos 565 — 9y
Log in to vote
0
Answered by 9 years ago

Creating a Part in a script is simple! Here's your answer:

local part = Instance.new ("Part") -- This creates the part -- part.Parent = workspace -- This puts your Part in the Workspace --

If you want to change the size or position you want the brick to be, this is it:

part.Size = Vector3.new(1, 1, 1) -- This changes the size but, you can change size to position. But, you must make the (1, 1, 1) to a different number if you want it to be position.

Here is your answer for position:

part.Position = Vector3.new(1, 1, 1)

There's your answer for everything!

Answer this question