Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function rod(p1,p2,color)
- local att1,att2 = Instance.new("Attachment"),Instance.new("Attachment")
- att1.Parent = p1
- att2.Parent = p2
- local bar = Instance.new("RodConstraint")
- bar.Visible = true
- bar.Thickness = 0.05
- bar.Attachment0 = att1
- bar.Attachment1 = att2
- bar.Color = BrickColor.new(color)
- bar.Parent = p1
- end
- function make_part(pos)
- local p = Instance.new("FlagStand")
- p.Size = Vector3.new()
- p.Position = pos
- p.Anchored = true
- p.CanCollide = false
- p.Massless = true
- p.Locked = true
- p.CastShadow = false
- p.Parent = script
- return p
- end
- function check(p,t)
- for i,v in pairs(p:GetChildren()) do
- if v:IsA("RodConstraint") then
- if not v.Attachment0:IsDescendantOf(t) and not v.Attachment1:IsDescendantOf(t) then else
- return true
- end
- end
- end
- return false
- end
- function dimension_multiply(n,s)
- local t = {}
- local x,y,z = s.X,s.Y,s.Z
- table.insert(t,1,make_part(Vector3.new(x,0,0)))
- table.insert(t,1,make_part(Vector3.new(0,y,0)))
- table.insert(t,1,make_part(Vector3.new(x,y,0)))
- table.insert(t,1,make_part(Vector3.new(0,0,z)))
- table.insert(t,1,make_part(Vector3.new(0,y,z)))
- table.insert(t,1,make_part(Vector3.new(x,y,z)))
- table.insert(t,1,make_part(Vector3.new(x,0,z)))
- table.insert(t,1,make_part(Vector3.new(0,0,0)))
- for _ = 1,n-1 do
- local ot = {table.unpack(t)}
- for i,v in pairs(ot) do
- table.insert(t,1,make_part(v.Position*2))
- end
- end
- for _,p in pairs(t) do
- for i,v in pairs(t) do
- local bar = v:FindFirstChildOfClass("RodConstraint")
- if v ~= p --[[and ((not check(p,v) and not check(v,p)) or bar)]] then
- local color = Color3.new(i/#t,0,0)
- v.Color = color
- rod(p,v,color)
- end
- end
- end
- end
- dimension_multiply(3,Vector3.new(10,10,5))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement