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 » Scripting Helpers
Home Search
 

Re: Simple Function Help

Previous Thread :: Next Thread 
InternetGuy is not online. InternetGuy
Joined: 28 Apr 2010
Total Posts: 3385
18 Jul 2014 02:16 AM
function divide(part)
part:remove()
for i = 1, 4 do

p = Instance.new("Part", workspace)
p.Position.Y = part.Position.Y
p.Anchored = true
p.Size.X = part.Size.X / 4
p.Size.Z = part.Size.Z / 4
p.Size.Y = part.Size.Y / 4
p.Position = Vector3.new() -- Now, this is the part.
end
end

What I'm trying to create here is a function that divides a part into 4..
However, I don't want it so the 4 parts go to the exact center position of the original part, but so that it looks like the original part but it's in 4 pieces and they're properly positioned.
Report Abuse
InternetGuy is not online. InternetGuy
Joined: 28 Apr 2010
Total Posts: 3385
18 Jul 2014 02:18 AM
Bump
Report Abuse
Tynexx is not online. Tynexx
Joined: 11 Jul 2012
Total Posts: 1559
18 Jul 2014 02:20 AM
Maybe:
p.Position = Vector3.new(part.Position.X/4, part.Position.Z/4, part.Position.Y/4))
Probably wont work.
~Tynexx
Report Abuse
InternetGuy is not online. InternetGuy
Joined: 28 Apr 2010
Total Posts: 3385
18 Jul 2014 02:21 AM
Wouldn't work because
ex:
Part is at 16,16,16
new part will be at 4,4,4
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
18 Jul 2014 02:22 AM
p.Size = P.Size / 4
Report Abuse
Tynexx is not online. Tynexx
Joined: 11 Jul 2012
Total Posts: 1559
18 Jul 2014 02:23 AM
Then change /4 to /8?
~Tynexx
Report Abuse
InternetGuy is not online. InternetGuy
Joined: 28 Apr 2010
Total Posts: 3385
18 Jul 2014 02:25 AM
128GB I want them so that they're properly positioned.
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
18 Jul 2014 02:26 AM
Accounting for rotation will be the hardest part of this
Its probably not all that hard but everything I know I learned from wanting to make something that needed it, so I learned it, I haven't done much with CFrame

If the blocks never going to be rotated it should be easy though
Report Abuse
InternetGuy is not online. InternetGuy
Joined: 28 Apr 2010
Total Posts: 3385
18 Jul 2014 02:28 AM
They don't need to be rotated.
Let me explain it better.
I have a part, laying on the ground.
It's 4x1x4.
I want it to it creates 4 parts, 1x1x1, positioned so that they're next to each other making it look like it's 4x1x4.
Just basically divide the original part.
Report Abuse
InternetGuy is not online. InternetGuy
Joined: 28 Apr 2010
Total Posts: 3385
18 Jul 2014 02:30 AM
Bump
Report Abuse
InternetGuy is not online. InternetGuy
Joined: 28 Apr 2010
Total Posts: 3385
18 Jul 2014 02:33 AM
wow it went down fast qq
Report Abuse
InternetGuy is not online. InternetGuy
Joined: 28 Apr 2010
Total Posts: 3385
18 Jul 2014 02:40 AM
Sorry for the mass bumping.
qq
Report Abuse
InternetGuy is not online. InternetGuy
Joined: 28 Apr 2010
Total Posts: 3385
18 Jul 2014 02:47 AM
y every1 sleep
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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