Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print'https://pastebin.com/1b6diG9Q'
- local function Get_Union(Primary_Part,table_of_obj,is_negated)
- --[[
- // Description \\
- Modified Function of BasePart:UnionAsync and BasePart:SubtractAsync. All wrapped
- in one neat Function. It even gets rid of the parts in the first and second
- parameters.
- -- Input --
- --> Mandatory
- 1. (Instance) First parameter is the part being used.
- 2. (Table) Second parameter is the table value.
- --> Optional
- 3. (Boolean, nil) Third parameter is whether if its being negated or not. If true, it will negate.
- -- Output --
- 1. Union instance
- --]]
- local parts = {Primary_Part}
- Primary_Part.Parent = workspace
- for _,v in pairs(table_of_obj)do
- table.insert(parts,v)
- end
- local union
- if not is_negated then
- union = Primary_Part:UnionAsync(table_of_obj)
- else
- union = Primary_Part:SubtractAsync(table_of_obj)
- end
- for _,v in pairs(parts)do
- v:Destroy()
- end
- union.Parent = workspace
- return union
- end
- local function Weld_ify(part_1,part_2)
- --[[
- // Description \\
- Shortens welding. Returns weld. The WeldConstraint will be parented under
- part_1 from parameter 1.
- -- Input --
- --> Mandatory
- 1. (Instance) First parameter will be the part that will be parenting the
- WeldConstraint/s.
- 2. (Instance) Second parameter will be the part that will be welded to the
- part from parameter 1.
- --> or
- (table) Second parameter can also be a table value of parts.
- -- Output --
- 1. If parameter 2 was an:
- + Instance, Then it will return:
- (Instance) The WeldConstraint used In the Function.
- + Table, Then it will return:
- (table) The WeldConstraints used In the Function.
- --]]
- if typeof(part_2)=='Instance'then
- local weldc = Instance.new("WeldConstraint",part_1)
- weldc.Part0 = part_1
- weldc.Part1 = part_2
- return weldc
- elseif typeof(part_2)=='table'then
- local weldc_list = {}
- for _,v in pairs(part_2)do
- local weldc = Instance.new("WeldConstraint",part_1)
- weldc.Part0 = part_1
- weldc.Part1 = v
- table.insert(weldc_list,weldc)
- end
- return weldc_list
- else
- error('Function failed: Argument 2 is not an Instance or a table.')
- end
- end
- local function Bevel_ify(para_1,depth)
- --[[
- // Description \\
- Function returns the instance of the anchored beveled part.
- 1. First parameter is the part of what it is beveling.
- Putting iN a table of properties will also work.
- 2. Second parameter is how deep it is (number).
- This Function needs:
- - GetUnion()
- Warning: This is a yielding Function. Script will pause While Function is active.
- --]]
- local part_1
- local mr = math.rad
- if typeof(para_1)=='Instance'then
- part_1 = para_1
- elseif typeof(para_1)=='table'then
- part_1 = Instance.new('Part',workspace)
- for i,v in pairs(para_1)do
- pcall(function()
- part_1[i] = v
- end)
- end
- end
- part_1.Anchored = true
- local function Get_Corner(Positive_x,Positive_y,Positive_z)
- local X_CF = part_1.Size.X * .5
- local Y_CF = part_1.Size.Y * .5
- local Z_CF = part_1.Size.Z * .5
- local CF_Ang,mid_CA_num
- if not Positive_x or Positive_x==0 then
- X_CF = -X_CF
- end
- if not Positive_y or Positive_y==0 then
- Y_CF = -Y_CF
- end
- if not Positive_z or Positive_z==0 then
- Z_CF = -Z_CF
- end
- if Positive_x==Positive_y then
- if Positive_z==Positive_x then
- mid_CA_num = -45
- else
- mid_CA_num = 45
- end
- elseif Positive_z==Positive_x then
- mid_CA_num = 135
- else
- mid_CA_num = -135
- end
- CF_Ang = CFrame.Angles(0,mr(mid_CA_num),mr(45))
- local part = Instance.new("Part",workspace)
- part.Anchored = true
- part.Size = Vector3.new(depth * 2,part_1.Size.Y,part_1.Size.Y)
- part.CFrame = part_1.CFrame *
- CFrame.new(X_CF,Y_CF,Z_CF) *
- CF_Ang
- part.Name = Positive_x.. Positive_y .. Positive_z
- return part
- end
- local function Get_Edge(wrap_axis,Isnegative_1,Isnegative_2)
- local ps = part_1.Size
- local prime_1 = 1
- local prime_2 = 1
- if Isnegative_1==1 then
- prime_1 = -1
- end
- if Isnegative_2==1 then
- prime_2 = -1
- end
- local part = Instance.new("Part",workspace)
- part.Anchored = true
- if wrap_axis==0 or not wrap_axis then
- part.Size = Vector3.new(part_1.Size.X,depth * 2,depth * 2)
- part.CFrame = part_1.CFrame *
- CFrame.new(0,ps.Y * .5 * prime_1,ps.Z * .5 * prime_2) *
- CFrame.Angles(mr(45),0,0)
- elseif wrap_axis==1 then
- part.Size = Vector3.new(depth * 2,part_1.Size.Y,depth * 2)
- part.CFrame = part_1.CFrame *
- CFrame.new(ps.X * .5 * prime_1,0,ps.Z * .5 * prime_2) *
- CFrame.Angles(0,mr(45),0)
- elseif wrap_axis==2 or not wrap_axis then
- part.Size = Vector3.new(depth * 2,depth * 2,part_1.Size.Z)
- part.CFrame = part_1.CFrame *
- CFrame.new(ps.X * .5 * prime_1,ps.Y * .5 * prime_2,0) *
- CFrame.Angles(0,0,mr(45))
- end
- return part
- end
- local bev = {
- Get_Corner(0,0,0),
- Get_Corner(0,0,1),
- Get_Corner(0,1,0),
- Get_Corner(0,1,1),
- Get_Corner(1,0,0),
- Get_Corner(1,0,1),
- Get_Corner(1,1,0),
- Get_Corner(1,1,1),
- Get_Edge(0,0,0),
- Get_Edge(0,0,1),
- Get_Edge(0,1,0),
- Get_Edge(0,1,1),
- Get_Edge(1,0,0),
- Get_Edge(1,0,1),
- Get_Edge(1,1,0),
- Get_Edge(1,1,1),
- Get_Edge(2,0,0),
- Get_Edge(2,0,1),
- Get_Edge(2,1,0),
- Get_Edge(2,1,1)
- }
- local union = Get_Union(part_1,bev,true)
- return union
- end
- local function Girl_Torso(part)
- --[[
- // Description \\
- Returns Girl Torso made out of unions and negateoperations.
- -- Output --
- 1. (Instance) Girl Torso Union.
- This Function needs:
- - Bevel_ify Function
- - Get_Union Function
- This is a yielding Function.
- --]]
- local Bevel_1 = part
- Bevel_1.Size = Vector3.new(2.02,2.02,1.02)
- local Bevil_ified_1 = Bevel_ify(Bevel_1,.02)
- local function mpart(ori,pos,size)
- local p = Instance.new("Part")
- p.Anchored = true
- p.Orientation = ori
- p.Position = pos
- p.Size = size
- return p
- end
- Bevil_ified_1.Anchored = true
- Bevil_ified_1.Position = Vector3.new(-26, -11.5, -8.5)
- local girl_torso = Get_Union(Bevil_ified_1,{
- mpart(Vector3.new(0, -180, -24.17),
- Vector3.new(-27.415, -11.41, -8.5),
- Vector3.new(1, 1.21, 2.62)
- ),
- mpart(Vector3.new(0, 0, 21.92),
- Vector3.new(-24.6, -12, -8.5),
- Vector3.new(1, 1, 3)
- ),
- mpart(Vector3.new(0, 0, -24.17),
- Vector3.new(-24.542, -11.371, -8.5),
- Vector3.new(1, 1.21, 2.62)
- ),
- mpart(Vector3.new(16.39, 0, 0),
- Vector3.new(-26, -11.4, -7.53),
- Vector3.new(2.9, 1, 1)
- ),
- mpart(Vector3.new(0, -180, 22.53),
- Vector3.new(-27.375, -12.03, -8.5),
- Vector3.new(1, 1, 3)
- ),
- mpart(Vector3.new(13.65, 0, 0),
- Vector3.new(-26, -12.111, -9.491),
- Vector3.new(2.9, 1.08, 1)
- ),
- mpart(Vector3.new(-15.45, 0, 0),
- Vector3.new(-26, -12.09, -7.53),
- Vector3.new(2.9, 1, 1)
- ),
- mpart(Vector3.new(-13.77, 0, 0),
- Vector3.new(-26, -11.336, -9.48),
- Vector3.new(2.9, 1, 1)
- )
- },true)
- return girl_torso
- end
- local function Sweater_Version_2(Character_1,color3_value_1)
- --[[
- // Description \\
- Makes a new sweater from given character. Returns Sweater Model.
- -- Input --
- --> Mandatory
- 1. (Instance) It can be a Player's character or a some rig. But it
- must have:
- -- A torso.
- --> Optional
- 2. (Color3) Color3 value for sweater.
- -- Output --
- 1. (Instance) Sweater Model.
- This Function needs:
- - Get_Union()
- - Bevel_ify()
- - Weld_ify()
- This Function also might want:
- - Girl_Torso()
- If the character from parameter 1 has a Girl Torso character
- mesh.
- Warning: This Function can yield.
- --]]
- local l_arm = Character_1:FindFirstChild'Left Arm'
- local r_arm = Character_1:FindFirstChild'Right Arm'
- local torso = Character_1:FindFirstChild'Torso'
- local sl_arm,sr_arm,s_torso
- if not torso then
- error('Function failed: No torso in character in paramter 1.')
- end
- if color3_value_1==nil then
- color3_value_1 = Color3.fromRGB(0,0,255)
- elseif typeof(color3_value_1)~='Color3'then
- color3_value_1 = Color3.fromRGB(0,0,255)
- end
- if l_arm then
- local part = Instance.new("Part")
- part.Size = Vector3.new(1.02,2.02,1.02)
- part.Color = color3_value_1
- part.Material = Enum.Material.Fabric
- local bevel_1 = Bevel_ify(part,.02)
- local part_1 = Instance.new("Part")
- part_1.CFrame = bevel_1.CFrame *
- CFrame.new(0,bevel_1.Size.Y * -.5,0)
- part_1.Size = Vector3.new(1.25,.2,1.25)
- local union_1 = Get_Union(bevel_1,{part_1},true)
- sl_arm = union_1
- end
- if r_arm then
- local part = Instance.new("Part")
- part.Size = Vector3.new(1.02,2.02,1.02)
- part.Color = color3_value_1
- part.Material = Enum.Material.Fabric
- local bevel_1 = Bevel_ify(part,.02)
- local part_1 = Instance.new("Part")
- part_1.CFrame = bevel_1.CFrame *
- CFrame.new(0,bevel_1.Size.Y * -.5,0)
- part_1.Size = Vector3.new(1.25,.2,1.25)
- local union_1 = Get_Union(bevel_1,{part_1},true)
- sr_arm = union_1
- end
- if torso then
- local Has_Girl_Torso = false
- for _,v in pairs(Character_1:GetChildren())do
- if v:IsA'CharacterMesh'then
- if v.MeshId==48112070 then
- Has_Girl_Torso = true
- break
- end
- end
- end
- if Has_Girl_Torso then
- local part = Instance.new("Part")
- part.Color = color3_value_1
- local girl_torso = Girl_Torso(part)
- girl_torso.Material = Enum.Material.Fabric
- s_torso = girl_torso
- else
- local part = Instance.new("Part")
- part.Size = Vector3.new(2.02,2.02,1.02)
- part.Color = color3_value_1
- part.Material = Enum.Material.Fabric
- local bevel_1 = Bevel_ify(part,.02)
- s_torso = bevel_1
- end
- end
- local mod = Instance.new("Model",Character_1)
- if sl_arm then
- sl_arm.Parent = mod
- sl_arm.CFrame = l_arm.CFrame *
- CFrame.new(0,.1,0)
- Weld_ify(l_arm,sl_arm)
- end
- if sr_arm then
- sr_arm.Parent = mod
- sr_arm.CFrame = r_arm.CFrame *
- CFrame.new(0,.1,0)
- Weld_ify(r_arm,sr_arm)
- end
- if s_torso then
- s_torso.Parent = mod
- s_torso.Color = color3_value_1
- s_torso.CFrame = torso.CFrame
- Weld_ify(torso,s_torso)
- end
- for _,v in pairs(mod:GetChildren())do
- v.Anchored = false
- v.Massless = true
- v.CanCollide = false
- end
- return mod
- end
- Sweater_Version_2(owner.Character)
- owner.CharacterAdded:Connect(function(ch)
- Sweater_Version_2(owner.Character)
- end)
- print'Repost my sweater = youre fat'
- print'but you can change the color tho but nothing else.'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement