Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function DrawRegion3(Region3)
- local XSize = Region3.Size.X/2
- local YSize = Region3.Size.Y/2
- local ZSize = Region3.Size.Z/2
- local Center = Region3.CFrame.p;
- local Template = Instance.new("Part");
- Template.FormFactor = "Custom";
- Template.Size = Vector3.new(0.01,0.01,XSize* 2);
- Template.Anchored = true;
- Template.Name = "dl_Library:::VisualStrut";
- Template.BrickColor = BrickColor.Yellow();
- local Template2 = Template:Clone();
- Template2.Size = Vector3.new(ZSize*2, 0.01,0.01);
- local Template3 = Template:Clone();
- Template3.Size = Vector3.new(0.01, YSize*2,0.01);
- -- Do X sides first
- local X1 = Template:Clone();
- X1.Position = Center + Vector3.new(XSize,YSize,0);
- X1.Parent = workspace
- local X2 = Template:Clone();
- X2.Position = Center + Vector3.new(-XSize,YSize,0);
- X2.Parent = workspace
- local X3 = Template:Clone();
- X3.Position = Center + Vector3.new(-XSize,-YSize,0);
- X3.Parent = workspace
- local X4 = Template:Clone();
- X4.Position = Center + Vector3.new(XSize,-YSize,0);
- X4.Parent = workspace
- -- Do Z sides second
- local X1 = Template2:Clone();
- X1.Position = Center + Vector3.new(0,YSize,ZSize);
- X1.Parent = workspace
- local X2 = Template2:Clone();
- X2.Position = Center + Vector3.new(0,YSize,-ZSize);
- X2.Parent = workspace
- local X3 = Template2:Clone();
- X3.Position = Center + Vector3.new(0,-YSize,-ZSize);
- X3.Parent = workspace
- local X4 = Template2:Clone();
- X4.Position = Center + Vector3.new(0,-YSize,ZSize);
- X4.Parent = workspace
- -- Do Y sides Last
- local X1 = Template3:Clone();
- X1.Position = Center + Vector3.new(XSize,0,ZSize);
- X1.Parent = workspace
- local X2 = Template3:Clone();
- X2.Position = Center + Vector3.new(XSize,0,-ZSize);
- X2.Parent = workspace
- local X3 = Template3:Clone();
- X3.Position = Center + Vector3.new(-XSize,0,-ZSize);
- X3.Parent = workspace
- local X4 = Template3:Clone();
- X4.Position = Center + Vector3.new(-XSize,0,ZSize);
- X4.Parent = workspace
- local X1,X2,X3,X4 = nil,nil,nil,nil
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement