vastqud
|
  |
| Joined: 10 Sep 2011 |
| Total Posts: 2464 |
|
|
| 12 Jan 2016 04:44 PM |
local explosion = Instance.new("Explosion")
explosion.Parent = workspace
explosion.Position = workspace.TestObject.Position
explosion.BlastRadius = 45 explosion.Hit:connect(function(hitPart, d) local size = hitPart.Size local x = size.X local y = size.Y local z = size.Z hitPart:Destroy() for xi = 1,x do local newPart = Instance.new("Part") newPart.Parent = workspace newPart.Size = Vector3.new(x/5,y/5,z) newPart.Position = Vector3.new(x/5+xi,y,z) newPart.Anchored = true end end)
it's supposed to fragment a single part into a bunch of smaller ones, which it does, but not very well
the new parts get positioned to a spot under the baseplate
but, they do mostly maintain the shape and size of the original block, so that's good
can anyone help me out with positioning and rotating these blocks so that these new blocks pretty much replace the original one block where it stood?
|
|
|
| Report Abuse |
|
|
vastqud
|
  |
| Joined: 10 Sep 2011 |
| Total Posts: 2464 |
|
| |
|
vastqud
|
  |
| Joined: 10 Sep 2011 |
| Total Posts: 2464 |
|
| |
|
vastqud
|
  |
| Joined: 10 Sep 2011 |
| Total Posts: 2464 |
|
| |
|
|
| 12 Jan 2016 05:04 PM |
https://scriptinghelpers.org/questions/25869/what-is-the-appropriate-equations-for-smashable-glass#29470
#code 'The Legend of Heroes Sen no Kiseki' |
|
|
| Report Abuse |
|
|
vastqud
|
  |
| Joined: 10 Sep 2011 |
| Total Posts: 2464 |
|
| |
|
vastqud
|
  |
| Joined: 10 Sep 2011 |
| Total Posts: 2464 |
|
|
| 12 Jan 2016 05:35 PM |
this is what I have now:
local explosion = Instance.new("Explosion")
explosion.Parent = workspace
explosion.Position = workspace.TestObject.Position
explosion.BlastRadius = 45 explosion.Hit:connect(function(hitPart, d) local size = hitPart.Size local pos = hitPart.Position local x = size.X local y = size.Y local z = size.Z local x1 = x/3 local y1 = y/3 local z1 = z local x2 = x1-pos.X local y2 = y1-pos.Y local z2 = z local positions = {Vector3.new(x2,y2,z2), Vector3.new(x2+x,y2,z2), Vector3.new(x2+(2*x),y2,z2), Vector3.new(x2, y1, z1), Vector3.new(x2 + x, y1, z1), Vector3.new(x2 + (2 * x), y1, z1), Vector3.new(x2, y1, z1), Vector3.new(x2 + x, y1, z1), Vector3.new(x2 + (2 * x), y1, z1),} local i = 1 while i <= 9 do wait() local newPart = Instance.new("Part") newPart.Anchored = true newPart.Position = positions[i] newPart.Parent = workspace end hitPart:Destroy() end)
these parts get positioned somewhere way off the map, and they don't keep the shape and size of the original |
|
|
| Report Abuse |
|
|