Pinkerten
|
  |
| Joined: 03 Aug 2014 |
| Total Posts: 840 |
|
|
| 10 Feb 2017 11:31 AM |
Its a simple part cutting function, I use it with a diffrent function that dictates which side to cut from. If you would like to see that I can show you. This simpely takes the offset of the mouse on the part, and cuts it according to that.
I can't seam to figure out how to make this less expanded and to condense it more.
--[[In other function local diff = (part.CFrame:toObjectSpace(CFrame.new(mousepos))) SplitAxis(part,diff.Y,"Y",grid) --]]
local function round(x,y) return ma######################end local function SplitAxis(part,diff,axis,grid) if axis == "X" then local size = part.Size local split1 = round((size.X/2 - diff),grid) local split2 = round((size.X/2 + diff),grid) if split1 >= grid then local clone = part:Clone() clone.Size = Vector3.new(split1,size.Y,size.Z) clone.CFrame = part.CFrame * CFrame.new(split2/2,0,0) clone.Parent = Enviroment end if split2 >= grid then local clone = part:Clone() clone.Size = Vector3.new(split2,size.Y,size.Z) clone.CFrame = part.CFrame * CFrame.new(-split1/2,0,0) clone.Parent = Enviroment end print("X",split1,split2) elseif axis == "Y" then local size = part.Size local split1 = round((size.Y/2 - diff),grid) local split2 = round((size.Y/2 + diff),grid) if split1 >= grid then local clone = part:Clone() cl########## #e################################# clone.CFrame = part.CFrame * CFrame.new(0,split2/2,0) clone.Parent = Enviroment end if split2 >= grid then local clone = part:Clone() cl########## #e################################# clone.CFrame = part.CFrame * CFrame.new(0,-split1/2,0) clone.Parent = Enviroment end print("Y",split1,split2) elseif axis == "Z" then local size = part.Size local split1 = round((size.Z/2 - diff),grid) local split2 = round((size.Z/2 + diff),grid) if split1 >= grid then local clone = part:Clone() cl########## #e################################# clone.CFrame = part.CFrame * CFrame.new(0,0,split2/2) clone.Parent = Enviroment end if split2 >= grid then local clone = part:Clone() cl########## #e################################# clone.CFrame = part.CFrame * CFrame.new(0,0,-split1/2) clone.Parent = Enviroment end print("Z",split1,split2) end part:Destroy() end |
|
|
| Report Abuse |
|
Pinkerten
|
  |
| Joined: 03 Aug 2014 |
| Total Posts: 840 |
|
|
| 10 Feb 2017 11:33 AM |
| Well seams as though roblox's overactive filter wins again, heres a pastebin: wSsjmHq0 |
|
|
| Report Abuse |
|