Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --The bottom has explanations about how to use this.
- function createPart(name1,x1,y1,z1,parent1,xs,ys,zs,type)
- --Sets the properties of part.
- part = Instance.new(type,parent1)
- part.Name = name1
- part.FormFactor = "Custom"
- part.Size = Vector3.new(xs,ys,zs)
- part.Position = Vector3.new(x1,y1,z1)
- part.Anchored = true
- part.BottomSurface = 10
- part.TopSurface = 10
- part.RightSurface = 10
- part.LeftSurface = 10
- part.FrontSurface = 10
- part.BackSurface = 10
- end
- function adjustParts(x2,y2,z2,parent2)
- --Gets the children.
- local c = model2:GetChildren()
- for index, child in pairs(c) do
- --Adjusts by addition.
- child.Position = child.Position + Vector3.new(x2,y2,z2)
- end
- end
- function combineModelsN(name,base)
- local c = base:GetChildren()
- NewModel = Instance.new("Model",game.Workspace)
- for index, child in pairs(c) do
- if child.className == "Model" then
- local d = child:GetChildren()
- for index, children in pairs(d) do
- children.Parent = NewModel
- end
- child:remove()
- end
- end
- end
- function combineModelsT(m1,m2,loc)
- NewModel = Instance.new("Model",loc)
- local c = m1:GetChildren()
- for index, children in pairs(c) do
- children.Parent = NewModel
- end
- m1:remove()
- local c = m2:GetChildren()
- for index, children in pairs(c) do
- children.Parent = NewModel
- end
- m2:remove()
- end
- function setColorM(model,color)
- local c = model:GetChildren()
- for index, child in pairs(c) do
- child.BrickColor = color
- end
- end
- function cloneAdjust(part,iterations,dx,dy,dz,parent)
- parts = 0
- while parts < iterations do
- parts = parts + 1
- partc = part:clone()
- partc.Position = partc.Position + Vector3.new(dx*(parts),dy*(parts),dz*(parts))
- partc.Parent = parent
- end
- end
- --Call these as a normal functions except with _G. at the beginning
- --Example
- --_G.createPart(examplevalues)
- --Creates a part
- _G.createPart = createPart
- --Adjusts all parts in a model
- _G.adjustParts = adjustParts
- --Combines all models of the same name in the same location
- _G.combineModelsN = combineModelsN
- --Combines models by two values
- _G.combineModelsT = combineModelsT
- --Sets the color of all blocks in a model
- _G.setColorM = setColorM
- --Clones a part and adjusts them by the iteration multiplied by values you give
- _G.cloneAdjust = cloneAdjust
- _G.FunctionsStored = true --Make scripts wait for this to use functions
- script:Destroy()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement