Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function Instance2(c,p,Early_Parent)if not c then return;end;p=p or{};
- local a=Instance.new(c,(Early_Parent and p.Parent)or nil);for b,d in pairs(p)do local _,e=pcall(function()
- a[b]=d;end);if e then print(e);end;end;return a;end;
- local function Rainbow(Instance_1,Property,Color_Increment,Wait_Increment)if not Instance_1 or not Property then return;end;
- Color_Increment=Color_Increment or 2;Wait_Increment=Wait_Increment or 1/60;coroutine.wrap(function()local frame=0;
- while true do frame=frame+Color_Increment;if frame>=360 then frame=0;end;Instance_1[Property]=Color3.fromHSV(frame/360,1,1);
- wait(Wait_Increment);end;end)();end;
- local function Link_Properties(Instance_1,Property_1,Instance_2,Property_2)
- if not(Instance_1 and Instance_2 and Property_1 and Property_2)then return;end;
- return Instance_1.Changed:Connect(function(a)if not a then return;end;
- if a~=Property_1 then return;end;Instance_2[Property_2]=Instance_1[Property_1];end);end;
- local function Get_Vertices_Based_On_Numbers(Center,Points,Distance)local CFrame=loadstring('return CFrame;')();
- local Vector3=loadstring('return Vector3;')();local Instance=loadstring('return Instance;')();
- if not(CFrame and Vector3 and Instance)then return;end;local Instance_2=loadstring('return Instance_2;')()or{};
- Instance_2.new=Instance_2.new or function(c,p)if not c then return;end;p=p or{};
- local a=Instance.new(c,p.Parent);for b,d in pairs(p)do local _,e=pcall(function()a[b]=d;end);if e then print(e);
- end;end;return a;end;local v3_val_1=Vector3.new(1,1,1);
- Center=(typeof(Center)=='Vector3'and Center)or Vector3.new(0,0,0);
- Points=(type(Points)=='number'and Points)or 3;local Main_Model=Instance_2.new('Model',{Parent=workspace;Name=
- (function()local a,b='Polygon_',1;for _,c in pairs(workspace:GetDescendants())do if(c.Name):sub(1,a:len())then
- b=b+1;end;end;return a..b;end)();});local Center_Point=Instance_2.new('Part',{Parent=Main_Model;Position=
- Center;Size=v3_val_1;Anchored=true;});Distance=Distance or 10;for a=1,Points do
- local b=Instance_2.new('Part',{Parent=Center_Point;CFrame= CFrame.new(Center_Point.Position)*CFrame.Angles(0,
- math.rad(a*(360/Points)),0)*CFrame.new(0,0,-Distance);Anchored=true;});end;return Main_Model;end;
- CFrame_Angles2=function(x,y,z)local a=math.rad;return CFrame.Angles(a(x),a(y),a(z));end;
- local function xerror(...)local a,c={...},'';for _,b in pairs(a)do c=c..tostring(b)..' ';end;
- spawn(function()error(c);end);wait();end;
- --// I ll find a better way i hope
- local function Get_Union(Primary_Part,table_of_obj,is_negated)
- local parts={Primary_Part};Primary_Part.Parent=workspace;for _,v in pairs(table_of_obj)do
- table.insert(parts,v);v.Anchored=true;v.CanCollide=false;v.Color=Primary_Part.Color;
- v.Transparency=Primary_Part.Transparency;v.Material=Primary_Part.Material;end;
- local union=(not is_negated and Primary_Part:UnionAsync(table_of_obj))or
- Primary_Part:SubtractAsync(table_of_obj);for _,v in pairs(parts)do v:Destroy();
- end;union.Parent=workspace;union.CanCollide=false;return union;end;
- local function Instance_3(c,p)if not c then return;end;p=p or{};
- local a={};setmetatable(a,{__index={unpack(p);};});
- local b=Instance.new(c,a.Parent);for d,e in pairs(a)do
- local _,f=pcall(function()b[d]=e;end);if f then print(f);end;end;
- return b;end;
- local function Bevelify(Part_A,Depth)
- local Appearence_Properties={'Color';'Material';'Reflectance';
- 'Transparency';};if not Part_A then return;end;Depth=Depth or.02;
- local PA_Size,Negates,mr=Part_A.Size,{},math.rad;
- local function Corner(a,b,c)local d=Instance_3('Part',{Anchored
- =true;CanCollide=false;});for _,e in pairs(Appearence_Properties)
- do pcall(function()d[e]=Part_A[e];end);end;
- d.Size=Vector3.new(Depth*2,PA_Size.Y,PA_Size.Y);
- d.CFrame=Part_A.CFrame*CFrame.new((PA_Size.X/2)*a,(PA_Size.Y/2)*b,
- (PA_Size.Z/2)*c)*CFrame.Angles(0,mr((a==b and((c==a and-45)or
- 45))or(c==a and 135)or-135),mr(45));table.insert(Negates,d);
- end;local function Edge(wrap_axis,side_1,side_2)
- local Edge_Part=Instance_3('Part',{Anchored=true;CanCollide=
- false;});for _,a in pairs(Appearence_Properties)do
- pcall(function()Edge_Part[a]=Part_A[a];end);end;
- side_1=-1+(2*side_1);side_2=-1+(2*side_2);
- Edge_Part.Size=Vector3.new((wrap_axis==0 and PA_Size.X)or
- Depth*2,(wrap_axis==1 and PA_Size.Y)or Depth*2,(wrap_axis
- ==2 and PA_Size.Z)or Depth*2);
- Edge_Part.CFrame=Part_A.CFrame*CFrame.new((wrap_axis==0 and
- 0)or PA_Size.X/2*side_1,(wrap_axis==1 and 0)or PA_Size.Y/
- 2*((wrap_axis==0 and side_1)or(wrap_axis==2 and side_2)),
- (wrap_axis==2 and 0)or PA_Size.Z/2*side_2)*CFrame.Angles(
- (wrap_axis==0 and mr(45))or 0,(wrap_axis==1 and mr(45))or
- 0,(wrap_axis==2 and mr(45))or 0);
- table.insert(Negates,Edge_Part);end;local Edge_Data={{0;0;0;};{0;
- 0;1;};{0;1;0;};{0;1;1;};{1;0;0;};{1;0;1;};{1;1;0;};{1;1;1;};{2;0;
- 0;};{2;0;1;};{2;1;0;};{2;1;1;};};local CornerData={{1;1;1;};{1;1;
- -1;};{1;-1;1;};{-1;1;1;};{-1;-1;1;};{-1;1;-1;};{1;-1;-1;};{-1;-1;
- -1;};};for _,a in pairs(Edge_Data)do Edge(a[1],a[2],a[3]);end;
- for _,a in pairs(CornerData)do Corner(a[1],a[2],a[3]);end;
- local a=Get_Union(Part_A,Negates,true);a.Anchored=true;
- a.Parent=workspace;return a;end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement