Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Minis SubtractAsync
- -- https://devforum.roblox.com/t/new-roblox-in-game-csg-api-is-now-available/174085
- function GetSub(Part,List)
- local Success = false
- while Success == false do
- local Sub = Part:SubtractAsync(List)
- if Sub == nil then
- -- It Hasnt worked
- print("Union is nil")
- else
- local Success = true
- return Sub
- end
- end
- end
- function GetUnion(Part,List)
- local Success = false
- while Success == false do
- local Union = Part:UnionAsync(List)
- if Union == nil then
- -- It Hasnt worked
- print("Union is nil")
- else
- local Success = true
- return Union
- end
- wait(1)
- end
- end
- function ActualiseUnion(Part,List,Union)
- if Union == nil then
- -- An Error Has Occured
- else
- -- There is a Union
- -- Remove Subtracts
- for i = 1,#List do
- List[i]:Destroy()
- end
- -- Remove MainPart
- local Cf = Part.CFrame
- local P = Part.Parent
- Part:Destroy()
- -- Place Union
- Union.CFrame = Cf
- Union.Parent = P
- end
- end
Add Comment
Please, Sign In to add comment