generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How would I?

Previous Thread :: Next Thread 
Aeav is not online. Aeav
Joined: 29 Sep 2012
Total Posts: 1155
07 Feb 2016 08:24 PM
I want to make a thing where you have one part, let's say its size is 10,10,10.

I want to have smaller parts make up that shape, say 4, so 10/4 = 2.5.
Each smaller part would have a size of 2.5,2.5,2.5? I think? I have no clue what to do after that. I'm positive you need to make a 'grid' for the part, and position them but I'm stuck.
Report Abuse
XxFrostyTheIceXx is not online. XxFrostyTheIceXx
Joined: 28 Mar 2013
Total Posts: 822
07 Feb 2016 08:43 PM
explain


hi
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
07 Feb 2016 08:55 PM
for z = 0,10,2.5 do
for y = 0,10,2.5 do
for x = 0,10,2.5 do
-- use instance.new() and position them at the x,y,z variables
end
end
end


Report Abuse
Aeav is not online. Aeav
Joined: 29 Sep 2012
Total Posts: 1155
08 Feb 2016 05:09 AM
Ehh, that doesn't seem like a very effective way.

Also, to clarify I mean I want to fill a block with smaller blocks and have it take up the same shape/size/space as the previous block.
Report Abuse
Aeav is not online. Aeav
Joined: 29 Sep 2012
Total Posts: 1155
08 Feb 2016 05:19 AM
I tried to make this, not knowing what to do, and it failed miserably. It just spawns in a crap ton of parts.

b = script.Parent
bx = b.Size.X
by = b.Size.Y
bz = b.Size.Z
n = 4

for a = 1, bx do
for b = 1, by do
for c = 1, bz do
p = Instance.new('Part', workspace)
p.Size = Vector3.new(bx/n, by/n, bz/n)
p.CFrame = p.CFrame * CFrame.new(bx/n*2, by/n*2, bz/n*2)
end
end
end
Report Abuse
Aeav is not online. Aeav
Joined: 29 Sep 2012
Total Posts: 1155
08 Feb 2016 05:21 AM
Okay, this makes a huge block. It's not the same size as the 10x10x10 but it makes a huge block. It's an improvement.

b = script.Parent
bx = b.Size.X
by = b.Size.Y
bz = b.Size.Z
n = 4

for a = 1, bx do
for b = 1, by do
for c = 1, bz do
p = Instance.new('Part', workspace)
p.Size = Vector3.new(bx/n, by/n, bz/n)
p.CFrame = p.CFrame * CFrame.new(bx/n+a, by/n+b, bz/n+c)
end
end
end
Report Abuse
Aeav is not online. Aeav
Joined: 29 Sep 2012
Total Posts: 1155
08 Feb 2016 08:55 AM
Bump
Report Abuse
Aeav is not online. Aeav
Joined: 29 Sep 2012
Total Posts: 1155
08 Feb 2016 11:03 AM
Bump
Report Abuse
Aeav is not online. Aeav
Joined: 29 Sep 2012
Total Posts: 1155
08 Feb 2016 02:56 PM
Bump? I need to know how to split a block up into a number of parts and have those number of parts make up the same shape as the previous block. :)
Report Abuse
Aeav is not online. Aeav
Joined: 29 Sep 2012
Total Posts: 1155
08 Feb 2016 04:05 PM
Come on people
Report Abuse
cheesecake123456 is not online. cheesecake123456
Joined: 01 Jun 2009
Total Posts: 1529
08 Feb 2016 04:37 PM
Sorry it took so long, took a while to get my head around the maths:

parts = {}

w = 53
n = 8

z = w
y = w/2
x = w/(n/2)

subPart = Instance.new('Part', workspace)
subPart.Anchored = true
subPart.Position = Vector3.new(0, 0, 0)
subPart.Size = Vector3.new(x, y, z)
table.insert(parts, subPart)

for i = 1, (n/2) - 1 do
local part = Instance.new('Part', workspace)
part.Anchored = true
part.Size = Vector3.new(x, y, z)
part.Position = Vector3.new(x*i, subPart.Position.y, subPart.Position.z)
table.insert(parts, part)
end

for _, v in pairs(parts) do
local p = v:Clone()
p.Position = Vector3.new(v.Position.x, v.Position.y + v.Size.y, v.Position.z)
p.Anchored = true
p.Parent = workspace
end



Report Abuse
cheesecake123456 is not online. cheesecake123456
Joined: 01 Jun 2009
Total Posts: 1529
08 Feb 2016 04:37 PM
w being width of the cube and n being the number of parts(keep even)


Report Abuse
cheesecake123456 is not online. cheesecake123456
Joined: 01 Jun 2009
Total Posts: 1529
09 Feb 2016 10:03 AM
Cleaned it up a little, you can now change the position of the subPart:

parts = {}

w = 20
n = 6

z = w
y = w/2
x = w/(n/2)

subPart = Instance.new('Part', workspace)
subPart.Anchored = true
subPart.Position = Vector3.new(0, 0, 0)
subPart.Size = Vector3.new(x, y, z)
table.insert(parts, subPart)

for i = 1, (n/2) - 1 do
local part = Instance.new('Part', workspace)
part.Anchored = true
part.Size = Vector3.new(x, y, z)
part.Position = Vector3.new(subPart.Position.x + x*i, subPart.Position.y, subPart.Position.z)
table.insert(parts, part)
end

for _, v in pairs(parts) do
local p = v:Clone()
p.Position = Vector3.new(v.Position.x, v.Position.y + v.Size.y, v.Position.z)
p.Parent = workspace
end


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image