Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --// Ultra sans ... by 1x1x1x1IAMbck again converted and free to use :OOOO \\--
- -- hard boss fight can rp
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Model0 = Instance.new("Model")
- Model1 = Instance.new("Model")
- Part2 = Instance.new("Part")
- SpecialMesh3 = Instance.new("SpecialMesh")
- BodyPosition4 = Instance.new("BodyPosition")
- Part5 = Instance.new("Part")
- Script6 = Instance.new("Script")
- Part7 = Instance.new("Part")
- SpecialMesh8 = Instance.new("SpecialMesh")
- ParticleEmitter9 = Instance.new("ParticleEmitter")
- Part10 = Instance.new("Part")
- SpecialMesh11 = Instance.new("SpecialMesh")
- ParticleEmitter12 = Instance.new("ParticleEmitter")
- Part13 = Instance.new("Part")
- SpecialMesh14 = Instance.new("SpecialMesh")
- Part15 = Instance.new("Part")
- SpecialMesh16 = Instance.new("SpecialMesh")
- Part17 = Instance.new("Part")
- Script18 = Instance.new("Script")
- CylinderMesh19 = Instance.new("CylinderMesh")
- Script20 = Instance.new("Script")
- Sound21 = Instance.new("Sound")
- Script22 = Instance.new("Script")
- Part23 = Instance.new("Part")
- Script24 = Instance.new("Script")
- CylinderMesh25 = Instance.new("CylinderMesh")
- Script26 = Instance.new("Script")
- Sound27 = Instance.new("Sound")
- Script28 = Instance.new("Script")
- Part29 = Instance.new("Part")
- Script30 = Instance.new("Script")
- CylinderMesh31 = Instance.new("CylinderMesh")
- Script32 = Instance.new("Script")
- Sound33 = Instance.new("Sound")
- Script34 = Instance.new("Script")
- Part35 = Instance.new("Part")
- Script36 = Instance.new("Script")
- CylinderMesh37 = Instance.new("CylinderMesh")
- Script38 = Instance.new("Script")
- Sound39 = Instance.new("Sound")
- Script40 = Instance.new("Script")
- Part41 = Instance.new("Part")
- Script42 = Instance.new("Script")
- CylinderMesh43 = Instance.new("CylinderMesh")
- Script44 = Instance.new("Script")
- Sound45 = Instance.new("Sound")
- Script46 = Instance.new("Script")
- Part47 = Instance.new("Part")
- Script48 = Instance.new("Script")
- CylinderMesh49 = Instance.new("CylinderMesh")
- Script50 = Instance.new("Script")
- Sound51 = Instance.new("Sound")
- Script52 = Instance.new("Script")
- Part53 = Instance.new("Part")
- ParticleEmitter54 = Instance.new("ParticleEmitter")
- Part55 = Instance.new("Part")
- ParticleEmitter56 = Instance.new("ParticleEmitter")
- Part57 = Instance.new("Part")
- Script58 = Instance.new("Script")
- CylinderMesh59 = Instance.new("CylinderMesh")
- Script60 = Instance.new("Script")
- Sound61 = Instance.new("Sound")
- Script62 = Instance.new("Script")
- Model63 = Instance.new("Model")
- UnionOperation64 = Instance.new("UnionOperation")
- UnionOperation65 = Instance.new("UnionOperation")
- Part66 = Instance.new("Part")
- SpecialMesh67 = Instance.new("SpecialMesh")
- UnionOperation68 = Instance.new("UnionOperation")
- Part69 = Instance.new("Part")
- SpecialMesh70 = Instance.new("SpecialMesh")
- Script71 = Instance.new("Script")
- Part72 = Instance.new("Part")
- Humanoid73 = Instance.new("Humanoid")
- Script74 = Instance.new("Script")
- Script75 = Instance.new("Script")
- NumberValue76 = Instance.new("NumberValue")
- BodyGyro77 = Instance.new("BodyGyro")
- BodyPosition78 = Instance.new("BodyPosition")
- Script79 = Instance.new("Script")
- Part80 = Instance.new("Part")
- Script81 = Instance.new("Script")
- CylinderMesh82 = Instance.new("CylinderMesh")
- Script83 = Instance.new("Script")
- Sound84 = Instance.new("Sound")
- Script85 = Instance.new("Script")
- Script86 = Instance.new("Script")
- Sound87 = Instance.new("Sound")
- UnionOperation88 = Instance.new("UnionOperation")
- Part89 = Instance.new("Part")
- Script90 = Instance.new("Script")
- CylinderMesh91 = Instance.new("CylinderMesh")
- Script92 = Instance.new("Script")
- Sound93 = Instance.new("Sound")
- Script94 = Instance.new("Script")
- Script95 = Instance.new("Script")
- Script96 = Instance.new("Script")
- Part97 = Instance.new("Part")
- Script98 = Instance.new("Script")
- SpecialMesh99 = Instance.new("SpecialMesh")
- Script100 = Instance.new("Script")
- Sound101 = Instance.new("Sound")
- Sound102 = Instance.new("Sound")
- Texture103 = Instance.new("Texture")
- Texture104 = Instance.new("Texture")
- Texture105 = Instance.new("Texture")
- Texture106 = Instance.new("Texture")
- Texture107 = Instance.new("Texture")
- Texture108 = Instance.new("Texture")
- Sound109 = Instance.new("Sound")
- Sound110 = Instance.new("Sound")
- Part111 = Instance.new("Part")
- Script112 = Instance.new("Script")
- SpecialMesh113 = Instance.new("SpecialMesh")
- Script114 = Instance.new("Script")
- Texture115 = Instance.new("Texture")
- Texture116 = Instance.new("Texture")
- Texture117 = Instance.new("Texture")
- Texture118 = Instance.new("Texture")
- Texture119 = Instance.new("Texture")
- Texture120 = Instance.new("Texture")
- Part121 = Instance.new("Part")
- SpecialMesh122 = Instance.new("SpecialMesh")
- Model123 = Instance.new("Model")
- Model124 = Instance.new("Model")
- Part125 = Instance.new("Part")
- Script126 = Instance.new("Script")
- CylinderMesh127 = Instance.new("CylinderMesh")
- Script128 = Instance.new("Script")
- Script129 = Instance.new("Script")
- Sound130 = Instance.new("Sound")
- UnionOperation131 = Instance.new("UnionOperation")
- UnionOperation132 = Instance.new("UnionOperation")
- BodyPosition133 = Instance.new("BodyPosition")
- ParticleEmitter134 = Instance.new("ParticleEmitter")
- UnionOperation135 = Instance.new("UnionOperation")
- Part136 = Instance.new("Part")
- Humanoid137 = Instance.new("Humanoid")
- Script138 = Instance.new("Script")
- Script139 = Instance.new("Script")
- Script140 = Instance.new("Script")
- NumberValue141 = Instance.new("NumberValue")
- BodyGyro142 = Instance.new("BodyGyro")
- BodyPosition143 = Instance.new("BodyPosition")
- Script144 = Instance.new("Script")
- UnionOperation145 = Instance.new("UnionOperation")
- Script146 = Instance.new("Script")
- Model147 = Instance.new("Model")
- Model148 = Instance.new("Model")
- Part149 = Instance.new("Part")
- Script150 = Instance.new("Script")
- CylinderMesh151 = Instance.new("CylinderMesh")
- Script152 = Instance.new("Script")
- Script153 = Instance.new("Script")
- Sound154 = Instance.new("Sound")
- UnionOperation155 = Instance.new("UnionOperation")
- UnionOperation156 = Instance.new("UnionOperation")
- BodyPosition157 = Instance.new("BodyPosition")
- ParticleEmitter158 = Instance.new("ParticleEmitter")
- UnionOperation159 = Instance.new("UnionOperation")
- Part160 = Instance.new("Part")
- Humanoid161 = Instance.new("Humanoid")
- Script162 = Instance.new("Script")
- Script163 = Instance.new("Script")
- Script164 = Instance.new("Script")
- NumberValue165 = Instance.new("NumberValue")
- BodyGyro166 = Instance.new("BodyGyro")
- BodyPosition167 = Instance.new("BodyPosition")
- Script168 = Instance.new("Script")
- UnionOperation169 = Instance.new("UnionOperation")
- Script170 = Instance.new("Script")
- Model171 = Instance.new("Model")
- Model172 = Instance.new("Model")
- Part173 = Instance.new("Part")
- Script174 = Instance.new("Script")
- CylinderMesh175 = Instance.new("CylinderMesh")
- Script176 = Instance.new("Script")
- Script177 = Instance.new("Script")
- Sound178 = Instance.new("Sound")
- UnionOperation179 = Instance.new("UnionOperation")
- UnionOperation180 = Instance.new("UnionOperation")
- BodyPosition181 = Instance.new("BodyPosition")
- ParticleEmitter182 = Instance.new("ParticleEmitter")
- UnionOperation183 = Instance.new("UnionOperation")
- Part184 = Instance.new("Part")
- Humanoid185 = Instance.new("Humanoid")
- Script186 = Instance.new("Script")
- Script187 = Instance.new("Script")
- Script188 = Instance.new("Script")
- NumberValue189 = Instance.new("NumberValue")
- BodyGyro190 = Instance.new("BodyGyro")
- BodyPosition191 = Instance.new("BodyPosition")
- Script192 = Instance.new("Script")
- UnionOperation193 = Instance.new("UnionOperation")
- Script194 = Instance.new("Script")
- Model195 = Instance.new("Model")
- Part196 = Instance.new("Part")
- Humanoid197 = Instance.new("Humanoid")
- Script198 = Instance.new("Script")
- Script199 = Instance.new("Script")
- Script200 = Instance.new("Script")
- NumberValue201 = Instance.new("NumberValue")
- BodyGyro202 = Instance.new("BodyGyro")
- BodyPosition203 = Instance.new("BodyPosition")
- UnionOperation204 = Instance.new("UnionOperation")
- Script205 = Instance.new("Script")
- Script206 = Instance.new("Script")
- UnionOperation207 = Instance.new("UnionOperation")
- BodyPosition208 = Instance.new("BodyPosition")
- Model209 = Instance.new("Model")
- Part210 = Instance.new("Part")
- Humanoid211 = Instance.new("Humanoid")
- Script212 = Instance.new("Script")
- Script213 = Instance.new("Script")
- Script214 = Instance.new("Script")
- NumberValue215 = Instance.new("NumberValue")
- BodyGyro216 = Instance.new("BodyGyro")
- BodyPosition217 = Instance.new("BodyPosition")
- UnionOperation218 = Instance.new("UnionOperation")
- Script219 = Instance.new("Script")
- Script220 = Instance.new("Script")
- UnionOperation221 = Instance.new("UnionOperation")
- BodyPosition222 = Instance.new("BodyPosition")
- Model223 = Instance.new("Model")
- Part224 = Instance.new("Part")
- Humanoid225 = Instance.new("Humanoid")
- Script226 = Instance.new("Script")
- Script227 = Instance.new("Script")
- Script228 = Instance.new("Script")
- NumberValue229 = Instance.new("NumberValue")
- BodyGyro230 = Instance.new("BodyGyro")
- BodyPosition231 = Instance.new("BodyPosition")
- UnionOperation232 = Instance.new("UnionOperation")
- Script233 = Instance.new("Script")
- Script234 = Instance.new("Script")
- UnionOperation235 = Instance.new("UnionOperation")
- BodyPosition236 = Instance.new("BodyPosition")
- Model237 = Instance.new("Model")
- Part238 = Instance.new("Part")
- Humanoid239 = Instance.new("Humanoid")
- Script240 = Instance.new("Script")
- Script241 = Instance.new("Script")
- Script242 = Instance.new("Script")
- NumberValue243 = Instance.new("NumberValue")
- BodyGyro244 = Instance.new("BodyGyro")
- BodyPosition245 = Instance.new("BodyPosition")
- UnionOperation246 = Instance.new("UnionOperation")
- Script247 = Instance.new("Script")
- Script248 = Instance.new("Script")
- UnionOperation249 = Instance.new("UnionOperation")
- BodyPosition250 = Instance.new("BodyPosition")
- Model251 = Instance.new("Model")
- Part252 = Instance.new("Part")
- Humanoid253 = Instance.new("Humanoid")
- Script254 = Instance.new("Script")
- Script255 = Instance.new("Script")
- Script256 = Instance.new("Script")
- NumberValue257 = Instance.new("NumberValue")
- BodyGyro258 = Instance.new("BodyGyro")
- BodyPosition259 = Instance.new("BodyPosition")
- UnionOperation260 = Instance.new("UnionOperation")
- Script261 = Instance.new("Script")
- Script262 = Instance.new("Script")
- UnionOperation263 = Instance.new("UnionOperation")
- BodyPosition264 = Instance.new("BodyPosition")
- Model265 = Instance.new("Model")
- Part266 = Instance.new("Part")
- Humanoid267 = Instance.new("Humanoid")
- Script268 = Instance.new("Script")
- Script269 = Instance.new("Script")
- Script270 = Instance.new("Script")
- NumberValue271 = Instance.new("NumberValue")
- BodyGyro272 = Instance.new("BodyGyro")
- BodyPosition273 = Instance.new("BodyPosition")
- UnionOperation274 = Instance.new("UnionOperation")
- Script275 = Instance.new("Script")
- Script276 = Instance.new("Script")
- UnionOperation277 = Instance.new("UnionOperation")
- BodyPosition278 = Instance.new("BodyPosition")
- Model279 = Instance.new("Model")
- Part280 = Instance.new("Part")
- Humanoid281 = Instance.new("Humanoid")
- Script282 = Instance.new("Script")
- Script283 = Instance.new("Script")
- Script284 = Instance.new("Script")
- NumberValue285 = Instance.new("NumberValue")
- BodyGyro286 = Instance.new("BodyGyro")
- BodyPosition287 = Instance.new("BodyPosition")
- UnionOperation288 = Instance.new("UnionOperation")
- Script289 = Instance.new("Script")
- Script290 = Instance.new("Script")
- UnionOperation291 = Instance.new("UnionOperation")
- BodyPosition292 = Instance.new("BodyPosition")
- Model293 = Instance.new("Model")
- Part294 = Instance.new("Part")
- Humanoid295 = Instance.new("Humanoid")
- Script296 = Instance.new("Script")
- Script297 = Instance.new("Script")
- Script298 = Instance.new("Script")
- NumberValue299 = Instance.new("NumberValue")
- BodyGyro300 = Instance.new("BodyGyro")
- BodyPosition301 = Instance.new("BodyPosition")
- UnionOperation302 = Instance.new("UnionOperation")
- Script303 = Instance.new("Script")
- Script304 = Instance.new("Script")
- UnionOperation305 = Instance.new("UnionOperation")
- BodyPosition306 = Instance.new("BodyPosition")
- Model0.Name = "UltraSans"
- Model0.Parent = mas
- Model1.Name = "Body"
- Model1.Parent = Model0
- Part2.Name = "Ribs"
- Part2.Parent = Model1
- Part2.CFrame = CFrame.new(255.436905, 165.891083, -3.19966507, -0.000402251055, 0.0290115159, 0.999579072, 0.049831178, 0.998337924, -0.0289554391, -0.998757601, 0.0497985519, -0.0018472604)
- Part2.Orientation = Vector3.new(1.65999997, 90.1100006, 2.8599999)
- Part2.Position = Vector3.new(255.436905, 165.891083, -3.19966507)
- Part2.Rotation = Vector3.new(93.6500015, 88.3399963, -90.7900009)
- Part2.Size = Vector3.new(1.92031944, 1.92031944, 0.960159719)
- Part2.Anchored = true
- Part2.TopSurface = Enum.SurfaceType.Smooth
- Part2.FormFactor = Enum.FormFactor.Symmetric
- Part2.formFactor = Enum.FormFactor.Symmetric
- SpecialMesh3.Parent = Part2
- SpecialMesh3.MeshId = "http://www.roblox.com/asset/?id=36780113"
- SpecialMesh3.Scale = Vector3.new(43.2071991, 37.0347404, 37.0347404)
- SpecialMesh3.MeshType = Enum.MeshType.FileMesh
- BodyPosition4.Parent = Part2
- BodyPosition4.Position = Vector3.new(0, 175, 0)
- BodyPosition4.P = 1250
- BodyPosition4.MaxForce = Vector3.new(0, 1.79099999e+18, 0)
- BodyPosition4.maxForce = Vector3.new(0, 1.79099999e+18, 0)
- BodyPosition4.position = Vector3.new(0, 175, 0)
- Part5.Parent = Model1
- Part5.CFrame = CFrame.new(256.023621, 204.272949, -1.64614868, -0.0887466818, -0.000201163319, 0.996054292, 0.0574222803, 0.998335838, 0.00531784864, -0.9943977, 0.0576676428, -0.0885874406)
- Part5.Orientation = Vector3.new(-0.299999982, 95.0799942, 3.28999996)
- Part5.Position = Vector3.new(256.023621, 204.272949, -1.64614868)
- Part5.Rotation = Vector3.new(-176.559998, 84.909996, 179.869995)
- Part5.Size = Vector3.new(4.93796539, 1.23449135, 2.4689827)
- Part5.Anchored = true
- Part5.TopParamA = -0.10000000149012
- Part5.TopParamB = 0.10000000149012
- Part5.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- Part5.TopSurfaceInput = Enum.InputType.Constant
- Script6.Name = "qPerfectionWeld"
- Script6.Parent = Model1
- table.insert(cors,sandbox(Script6,function()
- -- Created by Quenty (@Quenty, follow me on twitter).
- -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
- -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
- --[[ INSTRUCTIONS
- - Place in the model
- - Make sure model is anchored
- - That's it. It will weld the model and all children.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
- ]]
- --[[ DOCUMENTATION
- - Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
- - Will work in PBS servers
- - Will work as long as it starts out with the part anchored
- - Stores the relative CFrame as a CFrame value
- - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
- - Utilizes a recursive algorith to find all parts in the model
- - Will reweld on script reparent if the script is initially parented to a tool.
- - Welds as fast as possible
- ]]
- -- qPerfectionWeld.lua
- -- Created 10/6/2014
- -- Author: Quenty
- -- Version 1.0.3
- -- Updated 10/14/2014 - Updated to 1.0.1
- --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
- -- Updated 10/14/2014 - Updated to 1.0.2
- --- Fixed bug fix.
- -- Updated 10/14/2014 - Updated to 1.0.3
- --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
- local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
- local function CallOnChildren(Instance, FunctionToCall)
- -- Calls a function on each of the children of a certain object, using recursion.
- FunctionToCall(Instance)
- for _, Child in next, Instance:GetChildren() do
- CallOnChildren(Child, FunctionToCall)
- end
- end
- local function GetNearestParent(Instance, ClassName)
- -- Returns the nearest parent of a certain class, or returns nil
- local Ancestor = Instance
- repeat
- Ancestor = Ancestor.Parent
- if Ancestor == nil then
- return nil
- end
- until Ancestor:IsA(ClassName)
- return Ancestor
- end
- local function GetBricks(StartInstance)
- local List = {}
- -- if StartInstance:IsA("BasePart") then
- -- List[#List+1] = StartInstance
- -- end
- CallOnChildren(StartInstance, function(Item)
- if Item:IsA("BasePart") then
- List[#List+1] = Item;
- end
- end)
- return List
- end
- local function Modify(Instance, Values)
- -- Modifies an Instance by using a table.
- assert(type(Values) == "table", "Values is not a table");
- for Index, Value in next, Values do
- if type(Index) == "number" then
- Value.Parent = Instance
- else
- Instance[Index] = Value
- end
- end
- return Instance
- end
- local function Make(ClassType, Properties)
- -- Using a syntax hack to create a nice way to Make new items.
- return Modify(Instance.new(ClassType), Properties)
- end
- local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
- local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
- local function HasWheelJoint(Part)
- for _, SurfaceName in pairs(Surfaces) do
- for _, HingSurfaceName in pairs(HingSurfaces) do
- if Part[SurfaceName].Name == HingSurfaceName then
- return true
- end
- end
- end
- return false
- end
- local function ShouldBreakJoints(Part)
- --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
- -- definitely some edge cases.
- if NEVER_BREAK_JOINTS then
- return false
- end
- if HasWheelJoint(Part) then
- return false
- end
- local Connected = Part:GetConnectedParts()
- if #Connected == 1 then
- return false
- end
- for _, Item in pairs(Connected) do
- if HasWheelJoint(Item) then
- return false
- elseif not Item:IsDescendantOf(script.Parent) then
- return false
- end
- end
- return true
- end
- local function WeldTogether(Part0, Part1, JointType, WeldParent)
- --- Weld's 2 parts together
- -- @param Part0 The first part
- -- @param Part1 The second part (Dependent part most of the time).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
- -- @return The weld created.
- JointType = JointType or "Weld"
- local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
- local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
- Modify(NewWeld, {
- Name = "qCFrameWeldThingy";
- Part0 = Part0;
- Part1 = Part1;
- C0 = CFrame.new();--Part0.CFrame:inverse();
- C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
- Parent = Part1;
- })
- if not RelativeValue then
- RelativeValue = Make("CFrameValue", {
- Parent = Part1;
- Name = "qRelativeCFrameWeldValue";
- Archivable = true;
- Value = NewWeld.C1;
- })
- end
- return NewWeld
- end
- local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
- -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
- -- @param MainPart The part to weld the model to (can be in the model).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
- for _, Part in pairs(Parts) do
- if ShouldBreakJoints(Part) then
- Part:BreakJoints()
- end
- end
- for _, Part in pairs(Parts) do
- if Part ~= MainPart then
- WeldTogether(MainPart, Part, JointType, MainPart)
- end
- end
- if not DoNotUnanchor then
- for _, Part in pairs(Parts) do
- Part.Anchored = false
- end
- MainPart.Anchored = false
- end
- end
- local function PerfectionWeld()
- local Tool = GetNearestParent(script, "Tool")
- local Parts = GetBricks(script.Parent)
- local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
- if PrimaryPart then
- WeldParts(Parts, PrimaryPart, "Weld", false)
- else
- warn("qWeld - Unable to weld part")
- end
- return Tool
- end
- local Tool = PerfectionWeld()
- if Tool and script.ClassName == "Script" then
- --- Don't bother with local scripts
- script.Parent.AncestryChanged:connect(function()
- PerfectionWeld()
- end)
- end
- -- Created by Quenty (@Quenty, follow me on twitter).
- end))
- Part7.Name = "GasterBlaser"
- Part7.Parent = Model1
- Part7.CFrame = CFrame.new(246.701797, 208.015915, 47.8325119, -0.974856734, 0.123940133, 0.185183972, -0.0177562926, 0.785197079, -0.618991315, -0.222123757, -0.606716096, -0.763253987)
- Part7.Orientation = Vector3.new(38.2399979, 166.360001, -1.29999995)
- Part7.Position = Vector3.new(246.701797, 208.015915, 47.8325119)
- Part7.Rotation = Vector3.new(140.959991, 10.6700001, -172.75)
- Part7.Size = Vector3.new(1.23449135, 0.987593114, 1.23449135)
- Part7.Anchored = true
- Part7.BottomSurface = Enum.SurfaceType.Smooth
- Part7.TopSurface = Enum.SurfaceType.Smooth
- Part7.FormFactor = Enum.FormFactor.Plate
- Part7.formFactor = Enum.FormFactor.Plate
- SpecialMesh8.Parent = Part7
- SpecialMesh8.MeshId = "http://www.roblox.com/asset/?id=14028428"
- SpecialMesh8.Scale = Vector3.new(18.5173702, 24.6898289, 30.8622837)
- SpecialMesh8.VertexColor = Vector3.new(1000000, 10000, 10000)
- SpecialMesh8.MeshType = Enum.MeshType.FileMesh
- ParticleEmitter9.Name = "Fire"
- ParticleEmitter9.Parent = Part7
- ParticleEmitter9.Speed = NumberRange.new(100, 100)
- ParticleEmitter9.Rotation = NumberRange.new(-45, -45)
- ParticleEmitter9.Color = ColorSequence.new(Color3.new(0.666667, 0, 0),Color3.new(1, 0, 0))
- ParticleEmitter9.LightEmission = 1
- ParticleEmitter9.Texture = "http://www.roblox.com/asset/?id=241936182"
- ParticleEmitter9.Transparency = NumberSequence.new(0,0.28749996423721,1)
- ParticleEmitter9.ZOffset = 1
- ParticleEmitter9.Size = NumberSequence.new(10,0)
- ParticleEmitter9.EmissionDirection = Enum.NormalId.Bottom
- ParticleEmitter9.Lifetime = NumberRange.new(0.60000002384186, 0.60000002384186)
- ParticleEmitter9.LockedToPart = true
- ParticleEmitter9.Rate = 250
- ParticleEmitter9.SpreadAngle = Vector2.new(50, 50)
- ParticleEmitter9.VelocitySpread = 50
- Part10.Name = "GasterBlaser"
- Part10.Parent = Model1
- Part10.CFrame = CFrame.new(246.263687, 210.66745, -45.3492661, 0.911797941, 0.121225327, 0.392337978, 0.143219471, 0.801558256, -0.580510557, -0.384854376, 0.58549875, 0.713497281)
- Part10.Orientation = Vector3.new(35.4899979, 28.8099995, 10.1300001)
- Part10.Position = Vector3.new(246.263687, 210.66745, -45.3492661)
- Part10.Rotation = Vector3.new(39.1299973, 23.1000004, -7.56999969)
- Part10.Size = Vector3.new(1.23449135, 0.987593114, 1.23449135)
- Part10.Anchored = true
- Part10.BottomSurface = Enum.SurfaceType.Smooth
- Part10.TopSurface = Enum.SurfaceType.Smooth
- Part10.FormFactor = Enum.FormFactor.Plate
- Part10.formFactor = Enum.FormFactor.Plate
- SpecialMesh11.Parent = Part10
- SpecialMesh11.MeshId = "http://www.roblox.com/asset/?id=14028428"
- SpecialMesh11.Scale = Vector3.new(18.5173702, 24.6898289, 30.8622837)
- SpecialMesh11.VertexColor = Vector3.new(1000000, 10000, 10000)
- SpecialMesh11.MeshType = Enum.MeshType.FileMesh
- ParticleEmitter12.Name = "Fire"
- ParticleEmitter12.Parent = Part10
- ParticleEmitter12.Speed = NumberRange.new(100, 100)
- ParticleEmitter12.Rotation = NumberRange.new(-45, -45)
- ParticleEmitter12.Color = ColorSequence.new(Color3.new(0.666667, 0, 0),Color3.new(1, 0, 0))
- ParticleEmitter12.LightEmission = 1
- ParticleEmitter12.Texture = "http://www.roblox.com/asset/?id=241936182"
- ParticleEmitter12.Transparency = NumberSequence.new(0,0.28749996423721,1)
- ParticleEmitter12.ZOffset = 1
- ParticleEmitter12.Size = NumberSequence.new(10,0)
- ParticleEmitter12.EmissionDirection = Enum.NormalId.Bottom
- ParticleEmitter12.Lifetime = NumberRange.new(0.60000002384186, 0.60000002384186)
- ParticleEmitter12.LockedToPart = true
- ParticleEmitter12.Rate = 250
- ParticleEmitter12.SpreadAngle = Vector2.new(50, 50)
- ParticleEmitter12.VelocitySpread = 50
- Part13.Name = "Left Arm"
- Part13.Parent = Model1
- Part13.CFrame = CFrame.new(248.724396, 200.188034, 97.2817001, -0.190738052, 0.0807573348, 0.978313506, -0.78801626, 0.581692457, -0.201653793, -0.585362554, -0.809390008, -0.0473127924)
- Part13.Orientation = Vector3.new(11.6300001, 92.7699966, -53.5699997)
- Part13.Position = Vector3.new(248.724396, 200.188034, 97.2817001)
- Part13.Rotation = Vector3.new(103.199997, 78.0499954, -157.050003)
- Part13.Size = Vector3.new(12.3449135, 66.6625366, 12.3449135)
- Part13.BottomSurface = Enum.SurfaceType.Smooth
- Part13.TopSurface = Enum.SurfaceType.Smooth
- Part13.FormFactor = Enum.FormFactor.Custom
- Part13.formFactor = Enum.FormFactor.Custom
- SpecialMesh14.Parent = Part13
- SpecialMesh14.MeshId = "http://www.roblox.com/asset/?id=36780032"
- SpecialMesh14.Scale = Vector3.new(49.3796577, 49.3796577, 49.3796577)
- SpecialMesh14.MeshType = Enum.MeshType.FileMesh
- Part15.Name = "Right Arm"
- Part15.Parent = Model1
- Part15.CFrame = CFrame.new(245.976883, 201.98732, -92.438797, 0.141120955, 0.15161556, 0.978313744, 0.816126168, 0.541548073, -0.201652721, -0.560377538, 0.826884866, -0.0473136418)
- Part15.Orientation = Vector3.new(11.6300001, 92.7699966, 56.4300003)
- Part15.Position = Vector3.new(245.976883, 201.98732, -92.438797)
- Part15.Rotation = Vector3.new(103.199997, 78.0499954, -47.0499992)
- Part15.Size = Vector3.new(12.3449135, 66.6625366, 12.3449135)
- Part15.BottomSurface = Enum.SurfaceType.Smooth
- Part15.TopSurface = Enum.SurfaceType.Smooth
- Part15.FormFactor = Enum.FormFactor.Custom
- Part15.formFactor = Enum.FormFactor.Custom
- SpecialMesh16.Parent = Part15
- SpecialMesh16.MeshId = "http://www.roblox.com/asset/?id=36780156"
- SpecialMesh16.Scale = Vector3.new(49.3796577, 49.3796577, 49.3796577)
- SpecialMesh16.MeshType = Enum.MeshType.FileMesh
- Part17.Name = "Shatter"
- Part17.Parent = Model1
- Part17.CFrame = CFrame.new(240.69458, 179.215439, 394.634857, 0.999580324, 0.0029917676, -0.0286321938, -0.0287241638, 0.0374363177, -0.998891473, -0.00191184809, 0.999302268, 0.0375071391)
- Part17.Orientation = Vector3.new(87.2999954, -37.3600006, -37.5)
- Part17.Position = Vector3.new(240.69458, 179.215439, 394.634857)
- Part17.Rotation = Vector3.new(87.8499985, -1.63999999, -0.170000002)
- Part17.Color = Color3.new(1, 0, 0)
- Part17.Transparency = 1
- Part17.Size = Vector3.new(9.13523674, 102.783638, 8.46861839)
- Part17.BackSurface = Enum.SurfaceType.Weld
- Part17.BottomSurface = Enum.SurfaceType.Weld
- Part17.BrickColor = BrickColor.new("Really red")
- Part17.CanCollide = false
- Part17.FrontSurface = Enum.SurfaceType.Weld
- Part17.LeftSurface = Enum.SurfaceType.Weld
- Part17.Material = Enum.Material.Neon
- Part17.Reflectance = 0.5
- Part17.RightSurface = Enum.SurfaceType.Weld
- Part17.TopSurface = Enum.SurfaceType.Weld
- Part17.brickColor = BrickColor.new("Really red")
- Part17.FormFactor = Enum.FormFactor.Symmetric
- Part17.formFactor = Enum.FormFactor.Symmetric
- Script18.Name = "Fade"
- Script18.Parent = Part17
- table.insert(cors,sandbox(Script18,function()
- bin = script.Parent
- function activate(hit)
- bin.Transparency = 0.2
- wait(0.01)
- bin.Transparency = 0.3
- wait(0.01)
- bin.Transparency = 0.4
- wait(0.01)
- bin.Transparency = 0.5
- wait(0.01)
- bin.Transparency = 0.6
- wait(0.01)
- bin.Transparency = 0.7
- wait(0.01)
- bin.Transparency = 0.8
- wait(0.01)
- bin.Transparency = 0.9
- wait(0.01)
- bin.Transparency = 1
- end
- script.Parent.Touched:connect(activate)
- end))
- CylinderMesh19.Parent = Part17
- CylinderMesh19.Offset = Vector3.new(0, 75, 0)
- CylinderMesh19.Scale = Vector3.new(1, 6.5, 1)
- Script20.Parent = Part17
- table.insert(cors,sandbox(Script20,function()
- function onTouched(hit)
- script.Parent.Fire:play()
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Sound21.Name = "Fire"
- Sound21.Parent = Part17
- Sound21.EmitterSize = 1000
- Sound21.MinDistance = 1000
- Sound21.Pitch = 0.60000002384186
- Sound21.PlaybackSpeed = 0.60000002384186
- Sound21.SoundId = "http://www.roblox.com/asset?id=2248511"
- Sound21.Volume = 4
- Script22.Name = "Lava Script"
- Script22.Parent = Part17
- table.insert(cors,sandbox(Script22,function()
- function onTouched(part)
- if part.Parent:FindFirstChild("Humanoid") ~= nil then
- part.Parent.Torso:BreakJoints()
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Part23.Name = "Shatter"
- Part23.Parent = Model1
- Part23.CFrame = CFrame.new(237.289169, 157.746063, -539.278137, 0.99958545, 0.0054795132, -0.0282655954, -0.0284511056, 0.0374020077, -0.998895288, -0.00441626878, 0.99928534, 0.0375424027)
- Part23.Orientation = Vector3.new(87.3099976, -36.9799995, -37.2599983)
- Part23.Position = Vector3.new(237.289169, 157.746063, -539.278137)
- Part23.Rotation = Vector3.new(87.8499985, -1.62, -0.310000002)
- Part23.Color = Color3.new(1, 0, 0)
- Part23.Transparency = 1
- Part23.Size = Vector3.new(9.13523674, 102.783638, 8.46861839)
- Part23.BackSurface = Enum.SurfaceType.Weld
- Part23.BottomSurface = Enum.SurfaceType.Weld
- Part23.BrickColor = BrickColor.new("Really red")
- Part23.CanCollide = false
- Part23.FrontSurface = Enum.SurfaceType.Weld
- Part23.LeftSurface = Enum.SurfaceType.Weld
- Part23.Material = Enum.Material.Neon
- Part23.Reflectance = 0.5
- Part23.RightSurface = Enum.SurfaceType.Weld
- Part23.TopSurface = Enum.SurfaceType.Weld
- Part23.brickColor = BrickColor.new("Really red")
- Part23.FormFactor = Enum.FormFactor.Symmetric
- Part23.formFactor = Enum.FormFactor.Symmetric
- Script24.Name = "Fade"
- Script24.Parent = Part23
- table.insert(cors,sandbox(Script24,function()
- bin = script.Parent
- function activate(hit)
- bin.Transparency = 0.2
- wait(0.01)
- bin.Transparency = 0.3
- wait(0.01)
- bin.Transparency = 0.4
- wait(0.01)
- bin.Transparency = 0.5
- wait(0.01)
- bin.Transparency = 0.6
- wait(0.01)
- bin.Transparency = 0.7
- wait(0.01)
- bin.Transparency = 0.8
- wait(0.01)
- bin.Transparency = 0.9
- wait(0.01)
- bin.Transparency = 1
- end
- script.Parent.Touched:connect(activate)
- end))
- CylinderMesh25.Parent = Part23
- CylinderMesh25.Offset = Vector3.new(0, 75, 0)
- CylinderMesh25.Scale = Vector3.new(1, 6.5, 1)
- Script26.Parent = Part23
- table.insert(cors,sandbox(Script26,function()
- function onTouched(hit)
- script.Parent.Fire:play()
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Sound27.Name = "Fire"
- Sound27.Parent = Part23
- Sound27.EmitterSize = 1000
- Sound27.MinDistance = 1000
- Sound27.Pitch = 0.60000002384186
- Sound27.PlaybackSpeed = 0.60000002384186
- Sound27.SoundId = "http://www.roblox.com/asset?id=2248511"
- Sound27.Volume = 4
- Script28.Name = "Lava Script"
- Script28.Parent = Part23
- table.insert(cors,sandbox(Script28,function()
- function onTouched(part)
- if part.Parent:FindFirstChild("Humanoid") ~= nil then
- part.Parent.Torso:BreakJoints()
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Part29.Name = "Shatter"
- Part29.Parent = Model1
- Part29.CFrame = CFrame.new(239.414673, 231.100922, -530.748474, 0.999585509, 0.000488025806, -0.02878768, -0.0284511056, -0.136621878, -0.990214586, -0.00441627763, 0.990623176, -0.136551335)
- Part29.Orientation = Vector3.new(81.9799957, -168.099991, -168.23999)
- Part29.Position = Vector3.new(239.414673, 231.100922, -530.748474)
- Part29.Rotation = Vector3.new(97.8499985, -1.64999998, -0.0299999993)
- Part29.Color = Color3.new(1, 0, 0)
- Part29.Transparency = 1
- Part29.Size = Vector3.new(9.13523674, 102.783638, 8.46861839)
- Part29.BackSurface = Enum.SurfaceType.Weld
- Part29.BottomSurface = Enum.SurfaceType.Weld
- Part29.BrickColor = BrickColor.new("Really red")
- Part29.CanCollide = false
- Part29.FrontSurface = Enum.SurfaceType.Weld
- Part29.LeftSurface = Enum.SurfaceType.Weld
- Part29.Material = Enum.Material.Neon
- Part29.Reflectance = 0.5
- Part29.RightSurface = Enum.SurfaceType.Weld
- Part29.TopSurface = Enum.SurfaceType.Weld
- Part29.brickColor = BrickColor.new("Really red")
- Part29.FormFactor = Enum.FormFactor.Symmetric
- Part29.formFactor = Enum.FormFactor.Symmetric
- Script30.Name = "Fade"
- Script30.Parent = Part29
- table.insert(cors,sandbox(Script30,function()
- bin = script.Parent
- function activate(hit)
- bin.Transparency = 0.2
- wait(0.01)
- bin.Transparency = 0.3
- wait(0.01)
- bin.Transparency = 0.4
- wait(0.01)
- bin.Transparency = 0.5
- wait(0.01)
- bin.Transparency = 0.6
- wait(0.01)
- bin.Transparency = 0.7
- wait(0.01)
- bin.Transparency = 0.8
- wait(0.01)
- bin.Transparency = 0.9
- wait(0.01)
- bin.Transparency = 1
- end
- script.Parent.Touched:connect(activate)
- end))
- CylinderMesh31.Parent = Part29
- CylinderMesh31.Offset = Vector3.new(0, 75, 0)
- CylinderMesh31.Scale = Vector3.new(1, 6.5, 1)
- Script32.Parent = Part29
- table.insert(cors,sandbox(Script32,function()
- function onTouched(hit)
- script.Parent.Fire:play()
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Sound33.Name = "Fire"
- Sound33.Parent = Part29
- Sound33.EmitterSize = 1000
- Sound33.MinDistance = 1000
- Sound33.Pitch = 0.60000002384186
- Sound33.PlaybackSpeed = 0.60000002384186
- Sound33.SoundId = "http://www.roblox.com/asset?id=2248511"
- Sound33.Volume = 4
- Script34.Name = "Lava Script"
- Script34.Parent = Part29
- table.insert(cors,sandbox(Script34,function()
- function onTouched(part)
- if part.Parent:FindFirstChild("Humanoid") ~= nil then
- part.Parent.Torso:BreakJoints()
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Part35.Name = "Shatter"
- Part35.Parent = Model1
- Part35.CFrame = CFrame.new(242.149307, 227.234451, 389.155182, 0.999585629, 0.00791429821, -0.0276785586, -0.0287242234, 0.210321724, -0.977210224, -0.00191253109, 0.977600157, 0.2104619)
- Part35.Orientation = Vector3.new(77.7399979, -7.48999977, -7.77999973)
- Part35.Position = Vector3.new(242.149307, 227.234451, 389.155182)
- Part35.Rotation = Vector3.new(77.8499985, -1.58999991, -0.449999988)
- Part35.Color = Color3.new(1, 0, 0)
- Part35.Transparency = 1
- Part35.Size = Vector3.new(9.13523674, 102.783638, 8.46861839)
- Part35.BackSurface = Enum.SurfaceType.Weld
- Part35.BottomSurface = Enum.SurfaceType.Weld
- Part35.BrickColor = BrickColor.new("Really red")
- Part35.CanCollide = false
- Part35.FrontSurface = Enum.SurfaceType.Weld
- Part35.LeftSurface = Enum.SurfaceType.Weld
- Part35.Material = Enum.Material.Neon
- Part35.Reflectance = 0.5
- Part35.RightSurface = Enum.SurfaceType.Weld
- Part35.TopSurface = Enum.SurfaceType.Weld
- Part35.brickColor = BrickColor.new("Really red")
- Part35.FormFactor = Enum.FormFactor.Symmetric
- Part35.formFactor = Enum.FormFactor.Symmetric
- Script36.Name = "Fade"
- Script36.Parent = Part35
- table.insert(cors,sandbox(Script36,function()
- bin = script.Parent
- function activate(hit)
- bin.Transparency = 0.2
- wait(0.01)
- bin.Transparency = 0.3
- wait(0.01)
- bin.Transparency = 0.4
- wait(0.01)
- bin.Transparency = 0.5
- wait(0.01)
- bin.Transparency = 0.6
- wait(0.01)
- bin.Transparency = 0.7
- wait(0.01)
- bin.Transparency = 0.8
- wait(0.01)
- bin.Transparency = 0.9
- wait(0.01)
- bin.Transparency = 1
- end
- script.Parent.Touched:connect(activate)
- end))
- CylinderMesh37.Parent = Part35
- CylinderMesh37.Offset = Vector3.new(0, 75, 0)
- CylinderMesh37.Scale = Vector3.new(1, 6.5, 1)
- Script38.Parent = Part35
- table.insert(cors,sandbox(Script38,function()
- function onTouched(hit)
- script.Parent.Fire:play()
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Sound39.Name = "Fire"
- Sound39.Parent = Part35
- Sound39.EmitterSize = 1000
- Sound39.MinDistance = 1000
- Sound39.Pitch = 0.60000002384186
- Sound39.PlaybackSpeed = 0.60000002384186
- Sound39.SoundId = "http://www.roblox.com/asset?id=2248511"
- Sound39.Volume = 4
- Script40.Name = "Lava Script"
- Script40.Parent = Part35
- table.insert(cors,sandbox(Script40,function()
- function onTouched(part)
- if part.Parent:FindFirstChild("Humanoid") ~= nil then
- part.Parent.Torso:BreakJoints()
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Part41.Name = "Shatter"
- Part41.Parent = Model1
- Part41.CFrame = CFrame.new(240.012283, 155.552521, 393.456024, 0.999585629, 0.000480881077, -0.0287836809, -0.0287241023, -0.0497649834, -0.998347819, -0.00191250595, 0.998760879, -0.0497305393)
- Part41.Orientation = Vector3.new(86.7099991, -149.940002, -150.009995)
- Part41.Position = Vector3.new(240.012283, 155.552521, 393.456024)
- Part41.Rotation = Vector3.new(92.8499985, -1.64999998, -0.0299999993)
- Part41.Color = Color3.new(1, 0, 0)
- Part41.Transparency = 1
- Part41.Size = Vector3.new(9.13523674, 102.783638, 8.46861839)
- Part41.BackSurface = Enum.SurfaceType.Weld
- Part41.BottomSurface = Enum.SurfaceType.Weld
- Part41.BrickColor = BrickColor.new("Really red")
- Part41.CanCollide = false
- Part41.FrontSurface = Enum.SurfaceType.Weld
- Part41.LeftSurface = Enum.SurfaceType.Weld
- Part41.Material = Enum.Material.Neon
- Part41.Reflectance = 0.5
- Part41.RightSurface = Enum.SurfaceType.Weld
- Part41.TopSurface = Enum.SurfaceType.Weld
- Part41.brickColor = BrickColor.new("Really red")
- Part41.FormFactor = Enum.FormFactor.Symmetric
- Part41.formFactor = Enum.FormFactor.Symmetric
- Script42.Name = "Fade"
- Script42.Parent = Part41
- table.insert(cors,sandbox(Script42,function()
- bin = script.Parent
- function activate(hit)
- bin.Transparency = 0.2
- wait(0.01)
- bin.Transparency = 0.3
- wait(0.01)
- bin.Transparency = 0.4
- wait(0.01)
- bin.Transparency = 0.5
- wait(0.01)
- bin.Transparency = 0.6
- wait(0.01)
- bin.Transparency = 0.7
- wait(0.01)
- bin.Transparency = 0.8
- wait(0.01)
- bin.Transparency = 0.9
- wait(0.01)
- bin.Transparency = 1
- end
- script.Parent.Touched:connect(activate)
- end))
- CylinderMesh43.Parent = Part41
- CylinderMesh43.Offset = Vector3.new(0, 75, 0)
- CylinderMesh43.Scale = Vector3.new(1, 6.5, 1)
- Script44.Parent = Part41
- table.insert(cors,sandbox(Script44,function()
- function onTouched(hit)
- script.Parent.Fire:play()
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Sound45.Name = "Fire"
- Sound45.Parent = Part41
- Sound45.EmitterSize = 1000
- Sound45.MinDistance = 1000
- Sound45.Pitch = 0.60000002384186
- Sound45.PlaybackSpeed = 0.60000002384186
- Sound45.SoundId = "http://www.roblox.com/asset?id=2248511"
- Sound45.Volume = 4
- Script46.Name = "Lava Script"
- Script46.Parent = Part41
- table.insert(cors,sandbox(Script46,function()
- function onTouched(part)
- if part.Parent:FindFirstChild("Humanoid") ~= nil then
- part.Parent.Torso:BreakJoints()
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Part47.Name = "Shatter"
- Part47.Parent = Model1
- Part47.CFrame = CFrame.new(236.299973, 119.940369, -538.815735, 0.999585509, 0.00792214368, -0.0276803747, -0.0284510124, 0.124318644, -0.991834402, -0.00441626878, 0.992210686, 0.124492511)
- Part47.Orientation = Vector3.new(82.6699982, -12.54, -12.8899994)
- Part47.Position = Vector3.new(236.299973, 119.940369, -538.815735)
- Part47.Rotation = Vector3.new(82.8499985, -1.58999991, -0.449999988)
- Part47.Color = Color3.new(1, 0, 0)
- Part47.Transparency = 1
- Part47.Size = Vector3.new(9.13523674, 102.783638, 8.46861839)
- Part47.BackSurface = Enum.SurfaceType.Weld
- Part47.BottomSurface = Enum.SurfaceType.Weld
- Part47.BrickColor = BrickColor.new("Really red")
- Part47.CanCollide = false
- Part47.FrontSurface = Enum.SurfaceType.Weld
- Part47.LeftSurface = Enum.SurfaceType.Weld
- Part47.Material = Enum.Material.Neon
- Part47.Reflectance = 0.5
- Part47.RightSurface = Enum.SurfaceType.Weld
- Part47.TopSurface = Enum.SurfaceType.Weld
- Part47.brickColor = BrickColor.new("Really red")
- Part47.FormFactor = Enum.FormFactor.Symmetric
- Part47.formFactor = Enum.FormFactor.Symmetric
- Script48.Name = "Fade"
- Script48.Parent = Part47
- table.insert(cors,sandbox(Script48,function()
- bin = script.Parent
- function activate(hit)
- bin.Transparency = 0.2
- wait(0.01)
- bin.Transparency = 0.3
- wait(0.01)
- bin.Transparency = 0.4
- wait(0.01)
- bin.Transparency = 0.5
- wait(0.01)
- bin.Transparency = 0.6
- wait(0.01)
- bin.Transparency = 0.7
- wait(0.01)
- bin.Transparency = 0.8
- wait(0.01)
- bin.Transparency = 0.9
- wait(0.01)
- bin.Transparency = 1
- end
- script.Parent.Touched:connect(activate)
- end))
- CylinderMesh49.Parent = Part47
- CylinderMesh49.Offset = Vector3.new(0, 75, 0)
- CylinderMesh49.Scale = Vector3.new(1, 6.5, 1)
- Script50.Parent = Part47
- table.insert(cors,sandbox(Script50,function()
- function onTouched(hit)
- script.Parent.Fire:play()
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Sound51.Name = "Fire"
- Sound51.Parent = Part47
- Sound51.EmitterSize = 1000
- Sound51.MinDistance = 1000
- Sound51.Pitch = 0.60000002384186
- Sound51.PlaybackSpeed = 0.60000002384186
- Sound51.SoundId = "http://www.roblox.com/asset?id=2248511"
- Sound51.Volume = 4
- Script52.Name = "Lava Script"
- Script52.Parent = Part47
- table.insert(cors,sandbox(Script52,function()
- function onTouched(part)
- if part.Parent:FindFirstChild("Humanoid") ~= nil then
- part.Parent.Torso:BreakJoints()
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Part53.Name = " "
- Part53.Parent = Model1
- Part53.CFrame = CFrame.new(262.916138, 135.497894, -14.6219063, 0.911797941, 0.121225327, 0.392337978, 0.143219471, 0.801558256, -0.580510557, -0.384854376, 0.58549875, 0.713497281)
- Part53.Orientation = Vector3.new(35.4899979, 28.8099995, 10.1300001)
- Part53.Position = Vector3.new(262.916138, 135.497894, -14.6219063)
- Part53.Rotation = Vector3.new(39.1299973, 23.1000004, -7.56999969)
- Part53.Size = Vector3.new(1.23449135, 0.987593114, 1.23449135)
- Part53.Anchored = true
- Part53.BottomSurface = Enum.SurfaceType.Smooth
- Part53.TopSurface = Enum.SurfaceType.Smooth
- Part53.FormFactor = Enum.FormFactor.Plate
- Part53.formFactor = Enum.FormFactor.Plate
- ParticleEmitter54.Name = "Fire"
- ParticleEmitter54.Parent = Part53
- ParticleEmitter54.Speed = NumberRange.new(100, 100)
- ParticleEmitter54.Rotation = NumberRange.new(-45, -45)
- ParticleEmitter54.Color = ColorSequence.new(Color3.new(0.666667, 0, 0),Color3.new(1, 0, 0))
- ParticleEmitter54.LightEmission = 1
- ParticleEmitter54.Texture = "http://www.roblox.com/asset/?id=241936182"
- ParticleEmitter54.Transparency = NumberSequence.new(0,0.28749996423721,1)
- ParticleEmitter54.ZOffset = 1
- ParticleEmitter54.Size = NumberSequence.new(10,0)
- ParticleEmitter54.EmissionDirection = Enum.NormalId.Bottom
- ParticleEmitter54.Lifetime = NumberRange.new(0.60000002384186, 0.60000002384186)
- ParticleEmitter54.LockedToPart = true
- ParticleEmitter54.Rate = 250
- ParticleEmitter54.SpreadAngle = Vector2.new(50, 50)
- ParticleEmitter54.VelocitySpread = 50
- Part55.Name = " "
- Part55.Parent = Model1
- Part55.CFrame = CFrame.new(257.581726, 130.483658, 6.27809906, -0.974856734, 0.123940133, 0.185183972, -0.0177562926, 0.785197079, -0.618991315, -0.222123757, -0.606716096, -0.763253987)
- Part55.Orientation = Vector3.new(38.2399979, 166.360001, -1.29999995)
- Part55.Position = Vector3.new(257.581726, 130.483658, 6.27809906)
- Part55.Rotation = Vector3.new(140.959991, 10.6700001, -172.75)
- Part55.Size = Vector3.new(1.23449135, 0.987593114, 1.23449135)
- Part55.Anchored = true
- Part55.BottomSurface = Enum.SurfaceType.Smooth
- Part55.TopSurface = Enum.SurfaceType.Smooth
- Part55.FormFactor = Enum.FormFactor.Plate
- Part55.formFactor = Enum.FormFactor.Plate
- ParticleEmitter56.Name = "Fire"
- ParticleEmitter56.Parent = Part55
- ParticleEmitter56.Speed = NumberRange.new(100, 100)
- ParticleEmitter56.Rotation = NumberRange.new(-45, -45)
- ParticleEmitter56.Color = ColorSequence.new(Color3.new(0.666667, 0, 0),Color3.new(1, 0, 0))
- ParticleEmitter56.LightEmission = 1
- ParticleEmitter56.Texture = "http://www.roblox.com/asset/?id=241936182"
- ParticleEmitter56.Transparency = NumberSequence.new(0,0.28749996423721,1)
- ParticleEmitter56.ZOffset = 1
- ParticleEmitter56.Size = NumberSequence.new(10,0)
- ParticleEmitter56.EmissionDirection = Enum.NormalId.Bottom
- ParticleEmitter56.Lifetime = NumberRange.new(0.60000002384186, 0.60000002384186)
- ParticleEmitter56.LockedToPart = true
- ParticleEmitter56.Rate = 250
- ParticleEmitter56.SpreadAngle = Vector2.new(50, 50)
- ParticleEmitter56.VelocitySpread = 50
- Part57.Name = "Shatter"
- Part57.Parent = Model1
- Part57.CFrame = CFrame.new(253.665207, 35.7730713, -10.1541901, 0.999585509, 0.0286352765, 0.00299632479, -0.0284508113, 0.998354912, -0.049779769, -0.00441685319, 0.0496738851, 0.998755753)
- Part57.Orientation = Vector3.new(2.8499999, 0.170000002, -1.63)
- Part57.Position = Vector3.new(253.665207, 35.7730713, -10.1541901)
- Part57.Rotation = Vector3.new(2.8499999, 0.170000002, -1.63999999)
- Part57.Color = Color3.new(1, 0, 0)
- Part57.Transparency = 1
- Part57.Size = Vector3.new(22.1352329, 65.783638, 23.6686192)
- Part57.BackSurface = Enum.SurfaceType.Weld
- Part57.BottomSurface = Enum.SurfaceType.Weld
- Part57.BrickColor = BrickColor.new("Really red")
- Part57.CanCollide = false
- Part57.FrontSurface = Enum.SurfaceType.Weld
- Part57.LeftSurface = Enum.SurfaceType.Weld
- Part57.Material = Enum.Material.Neon
- Part57.Reflectance = 0.5
- Part57.RightSurface = Enum.SurfaceType.Weld
- Part57.TopSurface = Enum.SurfaceType.Weld
- Part57.brickColor = BrickColor.new("Really red")
- Part57.FormFactor = Enum.FormFactor.Symmetric
- Part57.formFactor = Enum.FormFactor.Symmetric
- Script58.Name = "Fade"
- Script58.Parent = Part57
- table.insert(cors,sandbox(Script58,function()
- bin = script.Parent
- function activate(hit)
- bin.Transparency = 0.2
- wait(0.01)
- bin.Transparency = 0.3
- wait(0.01)
- bin.Transparency = 0.4
- wait(0.01)
- bin.Transparency = 0.5
- wait(0.01)
- bin.Transparency = 0.6
- wait(0.01)
- bin.Transparency = 0.7
- wait(0.01)
- bin.Transparency = 0.8
- wait(0.01)
- bin.Transparency = 0.9
- wait(0.01)
- bin.Transparency = 1
- end
- script.Parent.Touched:connect(activate)
- end))
- CylinderMesh59.Parent = Part57
- CylinderMesh59.Offset = Vector3.new(0, 25, 0)
- CylinderMesh59.Scale = Vector3.new(1, 4.5, 1)
- Script60.Parent = Part57
- table.insert(cors,sandbox(Script60,function()
- function onTouched(hit)
- script.Parent.Fire:play()
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Sound61.Name = "Fire"
- Sound61.Parent = Part57
- Sound61.EmitterSize = 1000
- Sound61.MinDistance = 1000
- Sound61.Pitch = 0.60000002384186
- Sound61.PlaybackSpeed = 0.60000002384186
- Sound61.SoundId = "http://www.roblox.com/asset?id=2248511"
- Sound61.Volume = 4
- Script62.Name = "Lava Script"
- Script62.Parent = Part57
- table.insert(cors,sandbox(Script62,function()
- function onTouched(part)
- if part.Parent:FindFirstChild("Humanoid") ~= nil then
- part.Parent.Torso:BreakJoints()
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Model63.Name = "Head"
- Model63.Parent = Model0
- UnionOperation64.Parent = Model63
- UnionOperation64.CFrame = CFrame.new(238.314423, 226.662888, 9.3290863, -0.999578953, 0.0290145539, -0.000376083568, 0.0289597735, 0.998337626, 0.0498331301, 0.00182134425, 0.0498012528, -0.998757541)
- UnionOperation64.Orientation = Vector3.new(-2.8599999, -179.979996, 1.65999997)
- UnionOperation64.Position = Vector3.new(238.314423, 226.662888, 9.3290863)
- UnionOperation64.Rotation = Vector3.new(-177.139999, -0.0199999996, -178.339996)
- UnionOperation64.Color = Color3.new(1, 0, 0)
- UnionOperation64.Size = Vector3.new(0.731566668, 2.22208261, 2.22208357)
- UnionOperation64.BrickColor = BrickColor.new("Really red")
- UnionOperation64.Material = Enum.Material.Neon
- UnionOperation64.brickColor = BrickColor.new("Really red")
- UnionOperation64.UsePartColor = true
- UnionOperation65.Parent = Model63
- UnionOperation65.CFrame = CFrame.new(238.314407, 226.669022, 9.20576477, -0.999578953, 0.0290145539, -0.000376083568, 0.0289597735, 0.998337626, 0.0498331301, 0.00182134425, 0.0498012528, -0.998757541)
- UnionOperation65.Orientation = Vector3.new(-2.8599999, -179.979996, 1.65999997)
- UnionOperation65.Position = Vector3.new(238.314407, 226.669022, 9.20576477)
- UnionOperation65.Rotation = Vector3.new(-177.139999, -0.0199999996, -178.339996)
- UnionOperation65.Color = Color3.new(0.592157, 0, 0)
- UnionOperation65.Size = Vector3.new(1.46313381, 4.44416523, 4.44416857)
- UnionOperation65.BrickColor = BrickColor.new("Crimson")
- UnionOperation65.Material = Enum.Material.Neon
- UnionOperation65.brickColor = BrickColor.new("Crimson")
- UnionOperation65.UsePartColor = true
- Part66.Name = "Handle"
- Part66.Parent = Model63
- Part66.CFrame = CFrame.new(248.086517, 223.699707, -0.307014465, 0.000416902825, 0.314539552, 0.949232578, -0.04983202, -0.948058367, 0.314172506, 0.998767376, -0.0474323109, 0.0152844461)
- Part66.Orientation = Vector3.new(-18.3099995, 89.0799942, -176.98999)
- Part66.Position = Vector3.new(248.086517, 223.699707, -0.307014465)
- Part66.Rotation = Vector3.new(-87.2099991, 71.659996, -89.9199982)
- Part66.Color = Color3.new(0.972549, 0.972549, 0.972549)
- Part66.Size = Vector3.new(3.3260591, 3.3260591, 3.3260591)
- Part66.BottomSurface = Enum.SurfaceType.Smooth
- Part66.BrickColor = BrickColor.new("Institutional white")
- Part66.Material = Enum.Material.Metal
- Part66.TopSurface = Enum.SurfaceType.Smooth
- Part66.brickColor = BrickColor.new("Institutional white")
- Part66.FormFactor = Enum.FormFactor.Symmetric
- Part66.formFactor = Enum.FormFactor.Symmetric
- SpecialMesh67.Parent = Part66
- SpecialMesh67.MeshId = "http://www.roblox.com/asset/?id=21057589"
- SpecialMesh67.Scale = Vector3.new(24.6898289, 30.8622837, 16.0483894)
- SpecialMesh67.MeshType = Enum.MeshType.FileMesh
- UnionOperation68.Parent = Model63
- UnionOperation68.CFrame = CFrame.new(256.070313, 225.963394, -0.327735901, -0.996056914, -0.000202496187, -0.0887173787, -0.00531769032, 0.998335719, 0.0574246123, 0.0885581151, 0.0576699525, -0.994400144)
- UnionOperation68.Orientation = Vector3.new(-3.28999996, -174.899994, -0.310000002)
- UnionOperation68.Position = Vector3.new(256.070313, 225.963394, -0.327735901)
- UnionOperation68.Rotation = Vector3.new(-176.690002, -5.08999968, 179.98999)
- UnionOperation68.Color = Color3.new(0.639216, 0.635294, 0.647059)
- UnionOperation68.Size = Vector3.new(42.0630302, 42.226326, 41.1241989)
- UnionOperation68.BottomParamA = -0.10000000149012
- UnionOperation68.BottomParamB = 0.10000000149012
- UnionOperation68.BottomSurface = Enum.SurfaceType.Motor
- UnionOperation68.BottomSurfaceInput = Enum.InputType.Constant
- UnionOperation68.BrickColor = BrickColor.new("Medium stone grey")
- UnionOperation68.Material = Enum.Material.Metal
- UnionOperation68.brickColor = BrickColor.new("Medium stone grey")
- Part69.Name = "Handle"
- Part69.Parent = Model63
- Part69.CFrame = CFrame.new(253.078461, 215.361496, -0.724945068, -0.000418284559, -0.474598885, 0.880202174, 0.0498288907, 0.879098833, 0.474027723, -0.99875766, 0.0440577716, 0.0232810229)
- Part69.Orientation = Vector3.new(-28.2999992, 88.4799957, 3.24000001)
- Part69.Position = Vector3.new(253.078461, 215.361496, -0.724945068)
- Part69.Rotation = Vector3.new(-87.1899948, 61.6699982, 90.0499954)
- Part69.Color = Color3.new(0.972549, 0.972549, 0.972549)
- Part69.Size = Vector3.new(3.3260591, 3.3260591, 3.3260591)
- Part69.BottomSurface = Enum.SurfaceType.Smooth
- Part69.BrickColor = BrickColor.new("Institutional white")
- Part69.Material = Enum.Material.Metal
- Part69.TopSurface = Enum.SurfaceType.Smooth
- Part69.brickColor = BrickColor.new("Institutional white")
- Part69.FormFactor = Enum.FormFactor.Symmetric
- Part69.formFactor = Enum.FormFactor.Symmetric
- SpecialMesh70.Parent = Part69
- SpecialMesh70.MeshId = "http://www.roblox.com/asset/?id=21057589"
- SpecialMesh70.Scale = Vector3.new(23.4553452, 24.6898289, 16.0483894)
- SpecialMesh70.MeshType = Enum.MeshType.FileMesh
- Script71.Name = "qPerfectionWeld"
- Script71.Parent = Model63
- table.insert(cors,sandbox(Script71,function()
- -- Created by Quenty (@Quenty, follow me on twitter).
- -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
- -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
- --[[ INSTRUCTIONS
- - Place in the model
- - Make sure model is anchored
- - That's it. It will weld the model and all children.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
- ]]
- --[[ DOCUMENTATION
- - Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
- - Will work in PBS servers
- - Will work as long as it starts out with the part anchored
- - Stores the relative CFrame as a CFrame value
- - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
- - Utilizes a recursive algorith to find all parts in the model
- - Will reweld on script reparent if the script is initially parented to a tool.
- - Welds as fast as possible
- ]]
- -- qPerfectionWeld.lua
- -- Created 10/6/2014
- -- Author: Quenty
- -- Version 1.0.3
- -- Updated 10/14/2014 - Updated to 1.0.1
- --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
- -- Updated 10/14/2014 - Updated to 1.0.2
- --- Fixed bug fix.
- -- Updated 10/14/2014 - Updated to 1.0.3
- --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
- local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
- local function CallOnChildren(Instance, FunctionToCall)
- -- Calls a function on each of the children of a certain object, using recursion.
- FunctionToCall(Instance)
- for _, Child in next, Instance:GetChildren() do
- CallOnChildren(Child, FunctionToCall)
- end
- end
- local function GetNearestParent(Instance, ClassName)
- -- Returns the nearest parent of a certain class, or returns nil
- local Ancestor = Instance
- repeat
- Ancestor = Ancestor.Parent
- if Ancestor == nil then
- return nil
- end
- until Ancestor:IsA(ClassName)
- return Ancestor
- end
- local function GetBricks(StartInstance)
- local List = {}
- -- if StartInstance:IsA("BasePart") then
- -- List[#List+1] = StartInstance
- -- end
- CallOnChildren(StartInstance, function(Item)
- if Item:IsA("BasePart") then
- List[#List+1] = Item;
- end
- end)
- return List
- end
- local function Modify(Instance, Values)
- -- Modifies an Instance by using a table.
- assert(type(Values) == "table", "Values is not a table");
- for Index, Value in next, Values do
- if type(Index) == "number" then
- Value.Parent = Instance
- else
- Instance[Index] = Value
- end
- end
- return Instance
- end
- local function Make(ClassType, Properties)
- -- Using a syntax hack to create a nice way to Make new items.
- return Modify(Instance.new(ClassType), Properties)
- end
- local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
- local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
- local function HasWheelJoint(Part)
- for _, SurfaceName in pairs(Surfaces) do
- for _, HingSurfaceName in pairs(HingSurfaces) do
- if Part[SurfaceName].Name == HingSurfaceName then
- return true
- end
- end
- end
- return false
- end
- local function ShouldBreakJoints(Part)
- --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
- -- definitely some edge cases.
- if NEVER_BREAK_JOINTS then
- return false
- end
- if HasWheelJoint(Part) then
- return false
- end
- local Connected = Part:GetConnectedParts()
- if #Connected == 1 then
- return false
- end
- for _, Item in pairs(Connected) do
- if HasWheelJoint(Item) then
- return false
- elseif not Item:IsDescendantOf(script.Parent) then
- return false
- end
- end
- return true
- end
- local function WeldTogether(Part0, Part1, JointType, WeldParent)
- --- Weld's 2 parts together
- -- @param Part0 The first part
- -- @param Part1 The second part (Dependent part most of the time).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
- -- @return The weld created.
- JointType = JointType or "Weld"
- local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
- local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
- Modify(NewWeld, {
- Name = "qCFrameWeldThingy";
- Part0 = Part0;
- Part1 = Part1;
- C0 = CFrame.new();--Part0.CFrame:inverse();
- C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
- Parent = Part1;
- })
- if not RelativeValue then
- RelativeValue = Make("CFrameValue", {
- Parent = Part1;
- Name = "qRelativeCFrameWeldValue";
- Archivable = true;
- Value = NewWeld.C1;
- })
- end
- return NewWeld
- end
- local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
- -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
- -- @param MainPart The part to weld the model to (can be in the model).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
- for _, Part in pairs(Parts) do
- if ShouldBreakJoints(Part) then
- Part:BreakJoints()
- end
- end
- for _, Part in pairs(Parts) do
- if Part ~= MainPart then
- WeldTogether(MainPart, Part, JointType, MainPart)
- end
- end
- if not DoNotUnanchor then
- for _, Part in pairs(Parts) do
- Part.Anchored = false
- end
- MainPart.Anchored = false
- end
- end
- local function PerfectionWeld()
- local Tool = GetNearestParent(script, "Tool")
- local Parts = GetBricks(script.Parent)
- local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
- if PrimaryPart then
- WeldParts(Parts, PrimaryPart, "Weld", false)
- else
- warn("qWeld - Unable to weld part")
- end
- return Tool
- end
- local Tool = PerfectionWeld()
- if Tool and script.ClassName == "Script" then
- --- Don't bother with local scripts
- script.Parent.AncestryChanged:connect(function()
- PerfectionWeld()
- end)
- end
- -- Created by Quenty (@Quenty, follow me on twitter).
- end))
- Part72.Parent = Model63
- Part72.CFrame = CFrame.new(236.023392, 227.942581, 1.53780365, -0.000400150049, 0.0291465167, 0.999575138, 0.0497951023, 0.998335719, -0.0290904455, -0.998759449, 0.0497622974, -0.00185083784)
- Part72.Orientation = Vector3.new(1.66999996, 90.1100006, 2.8599999)
- Part72.Position = Vector3.new(236.023392, 227.942581, 1.53780365)
- Part72.Rotation = Vector3.new(93.6399994, 88.3300018, -90.7900009)
- Part72.Color = Color3.new(0, 1, 0)
- Part72.Transparency = 1
- Part72.Size = Vector3.new(0.814765275, 0.814765275, 0.814765275)
- Part72.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part72.BrickColor = BrickColor.new("Lime green")
- Part72.CanCollide = false
- Part72.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part72.Material = Enum.Material.Metal
- Part72.brickColor = BrickColor.new("Lime green")
- Part72.FormFactor = Enum.FormFactor.Custom
- Part72.formFactor = Enum.FormFactor.Custom
- Part72.Shape = Enum.PartType.Ball
- Humanoid73.Parent = Part72
- Humanoid73.Health = 0
- Humanoid73.MaxHealth = 0
- Humanoid73.NameOcclusion = Enum.NameOcclusion.NoOcclusion
- Humanoid73.WalkSpeed = 10
- Humanoid73.maxHealth = 0
- Script74.Parent = Part72
- table.insert(cors,sandbox(Script74,function()
- bin = script.Parent
- function move(target)
- local dir = (target.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- bin:findFirstChild("BodyGyro").cframe = CFrame.new(pos, pos + dir)
- bin:findFirstChild("BodyGyro").maxTorque = Vector3.new(9000,9000,9000)
- end
- function moveTo(target)
- bin.BodyPosition.position = target.Position
- bin.BodyPosition.maxForce = Vector3.new(10000,10000,10000) * bin.Speed.Value
- end
- function findNearestTorso(pos)
- local list = game.Workspace:GetChildren()
- local torso = nil
- local dist = 10000000000000000
- local temp = nil
- local human = nil
- local temp2 = nil
- for x = 1, #list do
- temp2 = list[x]
- if (temp2.className == "Model") and (temp2 ~= script.Parent) then
- temp = temp2:findFirstChild("Torso")
- human = temp2:findFirstChild("Humanoid")
- if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
- if (temp.Position - pos).magnitude < dist then
- torso = temp
- dist = (temp.Position - pos).magnitude
- end
- end
- end
- end
- return torso
- end
- function shoot(pos)
- dir = (pos - bin.CFrame.p).unit
- for i = 1, 50 do
- local ex = Instance.new("Explosion")
- ex.BlastRadius = 1
- ex.Position = bin.Position + (dir * 10 * i) + (dir * 7)
- ex.Parent = game.Workspace
- end
- end
- function shootAt(torso)
- local dir = (torso.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- shoot(pos)
- end
- while true do
- local torso = findNearestTorso(bin.Position)
- if torso~=nil then
- move(torso)
- moveTo(torso)
- end
- wait()
- end
- end))
- Script75.Parent = Part72
- table.insert(cors,sandbox(Script75,function()
- function onTouched(part)
- local h = part.Parent:findFirstChild("Humanoid")
- if h~=nil then
- h.Health = h.Health 100
- wait(1)
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- NumberValue76.Name = "Speed"
- NumberValue76.Parent = Part72
- NumberValue76.Value = 300
- BodyGyro77.Parent = Part72
- BodyGyro77.CFrame = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyGyro77.MaxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro77.maxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro77.cframe = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyPosition78.Parent = Part72
- BodyPosition78.Position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- BodyPosition78.MaxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition78.maxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition78.position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- Script79.Name = "SuperRun"
- Script79.Parent = Model63
- table.insert(cors,sandbox(Script79,function()
- function makeRun(character)
- local h = character:FindFirstChild("Humanoid")
- if (h~= nil) then
- h.WalkSpeed = 60
- end
- end
- function onPlayerRespawn(property, player)
- -- need to connect to new humanoid
- if property == "Character" and player.Character ~= nil then
- makeRun(player.Character)
- end
- end
- function onPlayerEntered(newPlayer)
- -- VERY UGLY HACK
- -- Will this leak threads?
- -- Is the problem even what I think it is (player arrived before character)?
- while true do
- if newPlayer.Character ~= nil then break end
- wait(1)
- end
- -- start to listen for new humanoid
- newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end )
- makeRun(newPlayer.Character)
- end
- game.Players.ChildAdded:connect(onPlayerEntered)
- end))
- Part80.Name = "Shatter"
- Part80.Parent = Model63
- Part80.CFrame = CFrame.new(-2.86876011, 233.069382, 9.46652985, 0.000479114155, -0.999585629, -0.0287835505, -0.049765408, 0.0287240595, -0.998347759, 0.998760819, 0.00191074784, -0.0497310162)
- Part80.Orientation = Vector3.new(86.7099991, -149.940002, -60.0099983)
- Part80.Position = Vector3.new(-2.86876011, 233.069382, 9.46652985)
- Part80.Rotation = Vector3.new(92.8499985, -1.64999998, 89.9700012)
- Part80.Color = Color3.new(1, 0, 0)
- Part80.Transparency = 1
- Part80.Size = Vector3.new(5.67866373, 84.2662811, 3.03685927)
- Part80.BackSurface = Enum.SurfaceType.Weld
- Part80.BottomSurface = Enum.SurfaceType.Weld
- Part80.BrickColor = BrickColor.new("Really red")
- Part80.CanCollide = false
- Part80.FrontSurface = Enum.SurfaceType.Weld
- Part80.LeftSurface = Enum.SurfaceType.Weld
- Part80.Material = Enum.Material.Neon
- Part80.Reflectance = 0.5
- Part80.RightSurface = Enum.SurfaceType.Weld
- Part80.TopSurface = Enum.SurfaceType.Weld
- Part80.brickColor = BrickColor.new("Really red")
- Part80.FormFactor = Enum.FormFactor.Symmetric
- Part80.formFactor = Enum.FormFactor.Symmetric
- Script81.Name = "Fade"
- Script81.Parent = Part80
- table.insert(cors,sandbox(Script81,function()
- bin = script.Parent
- function activate(hit)
- bin.Transparency = 0.2
- wait(0.01)
- bin.Transparency = 0.3
- wait(0.01)
- bin.Transparency = 0.4
- wait(0.01)
- bin.Transparency = 0.5
- wait(0.01)
- bin.Transparency = 0.6
- wait(0.01)
- bin.Transparency = 0.7
- wait(0.01)
- bin.Transparency = 0.8
- wait(0.01)
- bin.Transparency = 0.9
- wait(0.01)
- bin.Transparency = 1
- end
- script.Parent.Touched:connect(activate)
- end))
- CylinderMesh82.Parent = Part80
- CylinderMesh82.Offset = Vector3.new(0, 150, 0)
- CylinderMesh82.Scale = Vector3.new(1, 10.5, 1)
- Script83.Parent = Part80
- table.insert(cors,sandbox(Script83,function()
- function onTouched(hit)
- script.Parent.Fire:play()
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Sound84.Name = "Fire"
- Sound84.Parent = Part80
- Sound84.EmitterSize = 1000
- Sound84.MinDistance = 1000
- Sound84.Pitch = 0.60000002384186
- Sound84.PlaybackSpeed = 0.60000002384186
- Sound84.SoundId = "http://www.roblox.com/asset?id=2248511"
- Sound84.Volume = 5
- Script85.Name = "Lava Script"
- Script85.Parent = Part80
- table.insert(cors,sandbox(Script85,function()
- function onTouched(part)
- if part.Parent:FindFirstChild("Humanoid") ~= nil then
- part.Parent.Torso:BreakJoints()
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Script86.Name = "MusicScript"
- Script86.Parent = Model63
- table.insert(cors,sandbox(Script86,function()
- --Made by Stickmasterluke
- gw=game.Workspace
- function message(text,time)
- local oldmsg=gw:FindFirstChild("Hint")
- if oldmsg then
- oldmsg.Parent=nil
- end
- local spacenumber=time*0
- local msg=Instance.new("Hint")
- msg.Parent=gw
- --[[for i=1, spacenumber do
- wait(1/25)
- local maketext=""
- for i2=1, i do
- maketext=maketext.." "
- end
- maketext=maketext..text
- for i2=1, spacenumber-i do
- maketext=maketext.." "
- end
- msg.Text=maketext
- end]]
- msg.Text=text
- wait(0)
- msg.Parent=nil
- end
- last=""
- lastlast=""
- while true do
- wait(0)
- local tracks=script:GetChildren()
- local rn=math.random(1,#tracks)
- local track=tracks[rn]
- if track~=nil then
- if track.className=="Sound" and track.Name~=last and track.Name~=lastlast then
- lastlast=last
- last=track.Name
- message(track.Name,50)
- track:play()
- wait(10000000000000000000000000)
- track:pause()
- end
- end
- end
- end))
- Sound87.Parent = Script86
- Sound87.Looped = true
- Sound87.Pitch = 0.80000001192093
- Sound87.PlaybackSpeed = 0.80000001192093
- Sound87.Playing = true
- Sound87.RollOffMode = Enum.RollOffMode.Linear
- Sound87.SoundId = "rbxassetid://459170477"
- Sound87.Volume = 8
- UnionOperation88.Parent = Model63
- UnionOperation88.CFrame = CFrame.new(238.30835, 227.437744, -6.20638275, -0.999578953, 0.0290145539, -0.000376083568, 0.0289597735, 0.998337626, 0.0498331301, 0.00182134425, 0.0498012528, -0.998757541)
- UnionOperation88.Orientation = Vector3.new(-2.8599999, -179.979996, 1.65999997)
- UnionOperation88.Position = Vector3.new(238.30835, 227.437744, -6.20638275)
- UnionOperation88.Rotation = Vector3.new(-177.139999, -0.0199999996, -178.339996)
- UnionOperation88.Color = Color3.new(1, 0, 0)
- UnionOperation88.Size = Vector3.new(0.731566668, 2.22208261, 2.22208357)
- UnionOperation88.BrickColor = BrickColor.new("Really red")
- UnionOperation88.Material = Enum.Material.Neon
- UnionOperation88.brickColor = BrickColor.new("Really red")
- UnionOperation88.UsePartColor = true
- Part89.Name = "Shatter"
- Part89.Parent = Model63
- Part89.CFrame = CFrame.new(-2.87608433, 233.831253, -5.82238388, 0.000479114155, -0.999585629, -0.0287835505, -0.049765408, 0.0287240595, -0.998347759, 0.998760819, 0.00191074784, -0.0497310162)
- Part89.Orientation = Vector3.new(86.7099991, -149.940002, -60.0099983)
- Part89.Position = Vector3.new(-2.87608433, 233.831253, -5.82238388)
- Part89.Rotation = Vector3.new(92.8499985, -1.64999998, 89.9700012)
- Part89.Color = Color3.new(1, 0, 0)
- Part89.Transparency = 1
- Part89.Size = Vector3.new(5.67866373, 84.2662811, 3.03685927)
- Part89.BackSurface = Enum.SurfaceType.Weld
- Part89.BottomSurface = Enum.SurfaceType.Weld
- Part89.BrickColor = BrickColor.new("Really red")
- Part89.CanCollide = false
- Part89.FrontSurface = Enum.SurfaceType.Weld
- Part89.LeftSurface = Enum.SurfaceType.Weld
- Part89.Material = Enum.Material.Neon
- Part89.Reflectance = 0.5
- Part89.RightSurface = Enum.SurfaceType.Weld
- Part89.TopSurface = Enum.SurfaceType.Weld
- Part89.brickColor = BrickColor.new("Really red")
- Part89.FormFactor = Enum.FormFactor.Symmetric
- Part89.formFactor = Enum.FormFactor.Symmetric
- Script90.Name = "Fade"
- Script90.Parent = Part89
- table.insert(cors,sandbox(Script90,function()
- bin = script.Parent
- function activate(hit)
- bin.Transparency = 0.2
- wait(0.01)
- bin.Transparency = 0.3
- wait(0.01)
- bin.Transparency = 0.4
- wait(0.01)
- bin.Transparency = 0.5
- wait(0.01)
- bin.Transparency = 0.6
- wait(0.01)
- bin.Transparency = 0.7
- wait(0.01)
- bin.Transparency = 0.8
- wait(0.01)
- bin.Transparency = 0.9
- wait(0.01)
- bin.Transparency = 1
- end
- script.Parent.Touched:connect(activate)
- end))
- CylinderMesh91.Parent = Part89
- CylinderMesh91.Offset = Vector3.new(0, 150, 0)
- CylinderMesh91.Scale = Vector3.new(1, 10.5, 1)
- Script92.Parent = Part89
- table.insert(cors,sandbox(Script92,function()
- function onTouched(hit)
- script.Parent.Fire:play()
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Sound93.Name = "Fire"
- Sound93.Parent = Part89
- Sound93.EmitterSize = 1000
- Sound93.MinDistance = 1000
- Sound93.Pitch = 0.60000002384186
- Sound93.PlaybackSpeed = 0.60000002384186
- Sound93.SoundId = "http://www.roblox.com/asset?id=2248511"
- Sound93.Volume = 5
- Script94.Name = "Lava Script"
- Script94.Parent = Part89
- table.insert(cors,sandbox(Script94,function()
- function onTouched(part)
- if part.Parent:FindFirstChild("Humanoid") ~= nil then
- part.Parent.Torso:BreakJoints()
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Script95.Parent = Model63
- table.insert(cors,sandbox(Script95,function()
- game.Lighting.TimeOfDay = "00:00:00"
- end))
- Script96.Parent = Model63
- table.insert(cors,sandbox(Script96,function()
- --Leonlai Fog Script. :D
- game.Lighting.FogStart = 10
- game.Lighting.FogEnd = 2000
- game.Lighting.FogColor = Color3.new(0.4,0,0)
- game.Lighting.TimeOfDay = "00:00"
- end))
- Part97.Name = "Shatter"
- Part97.Parent = Model0
- Part97.CFrame = CFrame.new(266.052429, 167.548935, -2.44083023, -0.00011265956, -1, 9.69858229e-05, 7.37018127e-05, 9.6977521e-05, 1, -1, 0.000112666705, 7.36908842e-05)
- Part97.Orientation = Vector3.new(-90, 90.0099945, 0)
- Part97.Position = Vector3.new(266.052429, 167.548935, -2.44083023)
- Part97.Rotation = Vector3.new(-90, 0.00999999978, 90.0099945)
- Part97.Color = Color3.new(1, 0, 0)
- Part97.Size = Vector3.new(3.53000164, 2.98000002, 22.7300014)
- Part97.Anchored = true
- Part97.BackSurface = Enum.SurfaceType.Weld
- Part97.BottomSurface = Enum.SurfaceType.Weld
- Part97.BrickColor = BrickColor.new("Really red")
- Part97.CanCollide = false
- Part97.CustomPhysicalProperties = 0.699999988, 0.300000012, 0.200000003, 1, 1
- Part97.FrontSurface = Enum.SurfaceType.Weld
- Part97.LeftSurface = Enum.SurfaceType.Weld
- Part97.Material = Enum.Material.Neon
- Part97.Reflectance = 1
- Part97.RightSurface = Enum.SurfaceType.Weld
- Part97.TopSurface = Enum.SurfaceType.Weld
- Part97.brickColor = BrickColor.new("Really red")
- Part97.FormFactor = Enum.FormFactor.Symmetric
- Part97.formFactor = Enum.FormFactor.Symmetric
- Script98.Name = "PlantScript"
- Script98.Parent = Part97
- table.insert(cors,sandbox(Script98,function()
- local Handle = script.Parent
- if Handle.className == "Part" then
- local Mesh = Handle:FindFirstChild("Plant Mesh")
- local scaler = -5
- Handle.Friction = 1
- BodyGyro = Instance.new("BodyGyro")
- BodyGyro.Parent = Handle
- BodyGyro.cframe = Handle.CFrame
- BodyGyro.maxTorque = Vector3.new(1000,1000,1000)
- BodyGyro.P = 1000
- BodyGyro.D = 50
- BodyPos = Instance.new("BodyPosition")
- BodyPos.position = Handle.Position
- BodyPos.P = 1000
- BodyPos.D = 500
- BodyPos.maxForce = Vector3.new(1000,1000,1000)
- while true do
- wait(0.00000000000001)
- BodyPos.Parent = Handle
- Mesh.Scale = Mesh.Scale + Vector3.new(scaler,scaler,scaler)
- BodyPos.position = BodyPos.position + Vector3.new(0,0.7,0)
- end
- end
- end))
- SpecialMesh99.Name = "Plant Mesh"
- SpecialMesh99.Parent = Part97
- SpecialMesh99.MeshType = Enum.MeshType.Sphere
- Script100.Parent = Part97
- table.insert(cors,sandbox(Script100,function()
- while true do
- script.Parent.Transparency = 0
- wait (0.5)
- script.Parent.Transparency = .05
- wait (.1)
- script.Parent.Transparency = .1
- wait (.1)
- script.Parent.Transparency = .15
- wait (.1)
- script.Parent.Transparency = .2
- wait (.1)
- script.Parent.Transparency = .25
- wait (.1)
- script.Parent.Transparency = .3
- wait (.1)
- script.Parent.Transparency = .35
- wait (.1)
- script.Parent.Transparency = .4
- wait (.1)
- script.Parent.Transparency = .45
- wait (.1)
- script.Parent.Transparency = .5
- wait (.1)
- script.Parent.Transparency = .55
- wait (.1)
- script.Parent.Transparency = .6
- wait (.1)
- script.Parent.Transparency = .65
- wait (.1)
- script.Parent.Transparency = .7
- wait (.1)
- script.Parent.Transparency = .75
- wait (.1)
- script.Parent.Transparency = .8
- wait (.1)
- script.Parent.Transparency = .85
- wait (.1)
- script.Parent.Transparency = .9
- wait (.1)
- script.Parent.Transparency = 1.95
- wait (.1)
- script.Parent.CanCollide = false
- wait (100)
- script.Parent.Transparency = .95
- wait (.1)
- script.Parent.Transparency = .90
- wait (.1)
- script.Parent.Transparency = .85
- wait (.1)
- script.Parent.Transparency = .80
- wait (.1)
- script.Parent.Transparency = .75
- wait (.1)
- script.Parent.Transparency = .70
- wait (.1)
- script.Parent.Transparency = .65
- wait (.1)
- script.Parent.Transparency = .60
- wait (.1)
- script.Parent.Transparency = .55
- wait (.1)
- script.Parent.Transparency = .50
- wait (.1)
- script.Parent.Transparency = .45
- wait (.1)
- script.Parent.Transparency = .40
- wait (.1)
- script.Parent.Transparency = .35
- wait (.1)
- script.Parent.Transparency = .30
- wait (.1)
- script.Parent.Transparency = .25
- wait (.1)
- script.Parent.Transparency = .20
- wait (.1)
- script.Parent.Transparency = .15
- wait (.1)
- script.Parent.Transparency = .10
- wait (.1)
- script.Parent.Transparency = .05
- wait (.1)
- script.Parent.Transparency = 0
- wait (.1)
- end
- end))
- Sound101.Parent = Part97
- Sound101.EmitterSize = 50000
- Sound101.MinDistance = 50000
- Sound101.Playing = true
- Sound101.RollOffMode = Enum.RollOffMode.Linear
- Sound101.SoundId = "rbxassetid://165969964"
- Sound101.Volume = 10
- Sound102.Parent = Part97
- Sound102.EmitterSize = 50000
- Sound102.MinDistance = 50000
- Sound102.Playing = true
- Sound102.RollOffMode = Enum.RollOffMode.Linear
- Sound102.SoundId = "rbxassetid://264080811"
- Sound102.Volume = 10
- Texture103.Parent = Part97
- Texture103.Texture = "rbxasset://textures/water/normal_21.dds"
- Texture103.Transparency = 0.30000001192093
- Texture103.Color3 = Color3.new(0.666667, 0, 0)
- Texture103.StudsPerTileU = 1000
- Texture103.StudsPerTileV = 1000
- Texture104.Parent = Part97
- Texture104.Texture = "rbxasset://textures/water/normal_21.dds"
- Texture104.Transparency = 0.30000001192093
- Texture104.Face = Enum.NormalId.Back
- Texture104.Color3 = Color3.new(0.666667, 0, 0)
- Texture104.StudsPerTileU = 1000
- Texture104.StudsPerTileV = 1000
- Texture105.Parent = Part97
- Texture105.Texture = "rbxasset://textures/water/normal_21.dds"
- Texture105.Transparency = 0.30000001192093
- Texture105.Face = Enum.NormalId.Left
- Texture105.Color3 = Color3.new(0.666667, 0, 0)
- Texture105.StudsPerTileU = 1000
- Texture105.StudsPerTileV = 1000
- Texture106.Parent = Part97
- Texture106.Texture = "rbxasset://textures/water/normal_21.dds"
- Texture106.Transparency = 0.30000001192093
- Texture106.Face = Enum.NormalId.Right
- Texture106.Color3 = Color3.new(0.666667, 0, 0)
- Texture106.StudsPerTileU = 1000
- Texture106.StudsPerTileV = 1000
- Texture107.Parent = Part97
- Texture107.Texture = "rbxasset://textures/water/normal_21.dds"
- Texture107.Transparency = 0.30000001192093
- Texture107.Face = Enum.NormalId.Top
- Texture107.Color3 = Color3.new(0.666667, 0, 0)
- Texture107.StudsPerTileU = 1000
- Texture107.StudsPerTileV = 1000
- Texture108.Parent = Part97
- Texture108.Texture = "rbxasset://textures/water/normal_21.dds"
- Texture108.Transparency = 0.30000001192093
- Texture108.Face = Enum.NormalId.Bottom
- Texture108.Color3 = Color3.new(0.666667, 0, 0)
- Texture108.StudsPerTileU = 1000
- Texture108.StudsPerTileV = 1000
- Sound109.Parent = Part97
- Sound109.EmitterSize = 3000
- Sound109.MinDistance = 3000
- Sound109.Playing = true
- Sound109.SoundId = "rbxassetid://165969964"
- Sound109.Volume = 10
- Sound110.Parent = Part97
- Sound110.EmitterSize = 2500
- Sound110.MinDistance = 2500
- Sound110.Pitch = 0.30000001192093
- Sound110.PlaybackSpeed = 0.30000001192093
- Sound110.Playing = true
- Sound110.SoundId = "rbxassetid://462606062"
- Sound110.Volume = 10
- Part111.Name = "Shatter"
- Part111.Parent = Model0
- Part111.CFrame = CFrame.new(266.052246, 166.648941, -2.44081497, -0.00011265956, -1, 9.69858229e-05, 7.37018127e-05, 9.6977521e-05, 1, -1, 0.000112666705, 7.36908842e-05)
- Part111.Orientation = Vector3.new(-90, 90.0099945, 0)
- Part111.Position = Vector3.new(266.052246, 166.648941, -2.44081497)
- Part111.Rotation = Vector3.new(-90, 0.00999999978, 90.0099945)
- Part111.Color = Color3.new(1, 0, 0)
- Part111.Size = Vector3.new(3.53000164, 2.98000002, 0.130000323)
- Part111.Anchored = true
- Part111.BackSurface = Enum.SurfaceType.Weld
- Part111.BottomSurface = Enum.SurfaceType.Weld
- Part111.BrickColor = BrickColor.new("Really red")
- Part111.CanCollide = false
- Part111.CustomPhysicalProperties = 0.699999988, 0.300000012, 0.200000003, 1, 1
- Part111.FrontSurface = Enum.SurfaceType.Weld
- Part111.LeftSurface = Enum.SurfaceType.Weld
- Part111.Material = Enum.Material.Neon
- Part111.Reflectance = 1
- Part111.RightSurface = Enum.SurfaceType.Weld
- Part111.TopSurface = Enum.SurfaceType.Weld
- Part111.brickColor = BrickColor.new("Really red")
- Part111.FormFactor = Enum.FormFactor.Symmetric
- Part111.formFactor = Enum.FormFactor.Symmetric
- Script112.Name = "PlantScript"
- Script112.Parent = Part111
- table.insert(cors,sandbox(Script112,function()
- local Handle = script.Parent
- if Handle.className == "Part" then
- local Mesh = Handle:FindFirstChild("Plant Mesh")
- local scaler = -15
- Handle.Friction = 1
- BodyGyro = Instance.new("BodyGyro")
- BodyGyro.Parent = Handle
- BodyGyro.cframe = Handle.CFrame
- BodyGyro.maxTorque = Vector3.new(1000,1000,1000)
- BodyGyro.P = 1000
- BodyGyro.D = 50
- BodyPos = Instance.new("BodyPosition")
- BodyPos.position = Handle.Position
- BodyPos.P = 1000
- BodyPos.D = 500
- BodyPos.maxForce = Vector3.new(1000,1000,1000)
- while true do
- wait(0.00000000000001)
- BodyPos.Parent = Handle
- Mesh.Scale = Mesh.Scale + Vector3.new(scaler,scaler,scaler)
- BodyPos.position = BodyPos.position + Vector3.new(0,0.7,0)
- end
- end
- end))
- SpecialMesh113.Name = "Plant Mesh"
- SpecialMesh113.Parent = Part111
- SpecialMesh113.MeshType = Enum.MeshType.Sphere
- Script114.Parent = Part111
- table.insert(cors,sandbox(Script114,function()
- while true do
- script.Parent.Transparency = 0
- wait (1)
- script.Parent.Transparency = .05
- wait (.1)
- script.Parent.Transparency = .1
- wait (.1)
- script.Parent.Transparency = .15
- wait (.1)
- script.Parent.Transparency = .2
- wait (.1)
- script.Parent.Transparency = .25
- wait (.1)
- script.Parent.Transparency = .3
- wait (.1)
- script.Parent.Transparency = .35
- wait (.1)
- script.Parent.Transparency = .4
- wait (.1)
- script.Parent.Transparency = .45
- wait (.1)
- script.Parent.Transparency = .5
- wait (.1)
- script.Parent.Transparency = .55
- wait (.1)
- script.Parent.Transparency = .6
- wait (.1)
- script.Parent.Transparency = .65
- wait (.1)
- script.Parent.Transparency = .7
- wait (.1)
- script.Parent.Transparency = .75
- wait (.1)
- script.Parent.Transparency = .8
- wait (.1)
- script.Parent.Transparency = .85
- wait (.1)
- script.Parent.Transparency = .9
- wait (.1)
- script.Parent.Transparency = 1.95
- wait (.1)
- script.Parent.CanCollide = false
- wait (100)
- script.Parent.Transparency = .95
- wait (.1)
- script.Parent.Transparency = .90
- wait (.1)
- script.Parent.Transparency = .85
- wait (.1)
- script.Parent.Transparency = .80
- wait (.1)
- script.Parent.Transparency = .75
- wait (.1)
- script.Parent.Transparency = .70
- wait (.1)
- script.Parent.Transparency = .65
- wait (.1)
- script.Parent.Transparency = .60
- wait (.1)
- script.Parent.Transparency = .55
- wait (.1)
- script.Parent.Transparency = .50
- wait (.1)
- script.Parent.Transparency = .45
- wait (.1)
- script.Parent.Transparency = .40
- wait (.1)
- script.Parent.Transparency = .35
- wait (.1)
- script.Parent.Transparency = .30
- wait (.1)
- script.Parent.Transparency = .25
- wait (.1)
- script.Parent.Transparency = .20
- wait (.1)
- script.Parent.Transparency = .15
- wait (.1)
- script.Parent.Transparency = .10
- wait (.1)
- script.Parent.Transparency = .05
- wait (.1)
- script.Parent.Transparency = 0
- wait (.1)
- end
- end))
- Texture115.Parent = Part111
- Texture115.Texture = "rbxasset://textures/water/normal_21.dds"
- Texture115.Transparency = 0.30000001192093
- Texture115.Color3 = Color3.new(0.666667, 0, 0)
- Texture115.StudsPerTileU = 1000
- Texture115.StudsPerTileV = 1000
- Texture116.Parent = Part111
- Texture116.Texture = "rbxasset://textures/water/normal_21.dds"
- Texture116.Transparency = 0.30000001192093
- Texture116.Face = Enum.NormalId.Back
- Texture116.Color3 = Color3.new(0.666667, 0, 0)
- Texture116.StudsPerTileU = 1000
- Texture116.StudsPerTileV = 1000
- Texture117.Parent = Part111
- Texture117.Texture = "rbxasset://textures/water/normal_21.dds"
- Texture117.Transparency = 0.30000001192093
- Texture117.Face = Enum.NormalId.Left
- Texture117.Color3 = Color3.new(0.666667, 0, 0)
- Texture117.StudsPerTileU = 1000
- Texture117.StudsPerTileV = 1000
- Texture118.Parent = Part111
- Texture118.Texture = "rbxasset://textures/water/normal_21.dds"
- Texture118.Transparency = 0.30000001192093
- Texture118.Face = Enum.NormalId.Right
- Texture118.Color3 = Color3.new(0.666667, 0, 0)
- Texture118.StudsPerTileU = 1000
- Texture118.StudsPerTileV = 1000
- Texture119.Parent = Part111
- Texture119.Texture = "rbxasset://textures/water/normal_21.dds"
- Texture119.Transparency = 0.30000001192093
- Texture119.Face = Enum.NormalId.Top
- Texture119.Color3 = Color3.new(0.666667, 0, 0)
- Texture119.StudsPerTileU = 1000
- Texture119.StudsPerTileV = 1000
- Texture120.Parent = Part111
- Texture120.Texture = "rbxasset://textures/water/normal_21.dds"
- Texture120.Transparency = 0.30000001192093
- Texture120.Face = Enum.NormalId.Bottom
- Texture120.Color3 = Color3.new(0.666667, 0, 0)
- Texture120.StudsPerTileU = 1000
- Texture120.StudsPerTileV = 1000
- Part121.Name = "Sky"
- Part121.Parent = Model0
- Part121.CFrame = CFrame.new(271.080505, 25.8172607, -31.0029831, -1, -8.53250094e-05, -3.61879065e-05, -8.53250167e-05, 1, 2.29678975e-07, 3.61878883e-05, 2.32766723e-07, -1)
- Part121.Orientation = Vector3.new(0, -180, 0)
- Part121.Position = Vector3.new(271.080505, 25.8172607, -31.0029831)
- Part121.Rotation = Vector3.new(-180, 0, 180)
- Part121.Size = Vector3.new(2, 2, 2)
- Part121.Anchored = true
- Part121.Locked = true
- Part121.FormFactor = Enum.FormFactor.Symmetric
- Part121.formFactor = Enum.FormFactor.Symmetric
- SpecialMesh122.Parent = Part121
- SpecialMesh122.MeshId = "http://www.roblox.com/asset/?id=1527559"
- SpecialMesh122.Scale = Vector3.new(-3000, -1500, -3000)
- SpecialMesh122.VertexColor = Vector3.new(0.879999995, 0, 0)
- SpecialMesh122.TextureId = "http://www.roblox.com/asset/?id=1529455"
- SpecialMesh122.MeshType = Enum.MeshType.FileMesh
- Model123.Name = "Blaster"
- Model123.Parent = Model0
- Model124.Name = "Top laser"
- Model124.Parent = Model123
- Part125.Name = "Shatter"
- Part125.Parent = Model124
- Part125.CFrame = CFrame.new(-209.927994, 140.251923, 65.1207047, 5.14824933e-05, -1, 0.000131111578, 0.000206255281, -0.000131100955, -1, 1, 5.1509538e-05, 0.000206248529)
- Part125.Orientation = Vector3.new(90, -90, 0)
- Part125.Position = Vector3.new(-209.927994, 140.251923, 65.1207047)
- Part125.Rotation = Vector3.new(89.9899979, 0.00999999978, 90)
- Part125.Color = Color3.new(1, 0, 0)
- Part125.Transparency = 1
- Part125.Size = Vector3.new(19.677372, 481.386078, 19.4694805)
- Part125.BackSurface = Enum.SurfaceType.Weld
- Part125.BottomSurface = Enum.SurfaceType.Weld
- Part125.BrickColor = BrickColor.new("Really red")
- Part125.CanCollide = false
- Part125.FrontSurface = Enum.SurfaceType.Weld
- Part125.LeftSurface = Enum.SurfaceType.Weld
- Part125.Material = Enum.Material.Neon
- Part125.Reflectance = 0.5
- Part125.RightSurface = Enum.SurfaceType.Weld
- Part125.TopSurface = Enum.SurfaceType.Weld
- Part125.brickColor = BrickColor.new("Really red")
- Part125.FormFactor = Enum.FormFactor.Symmetric
- Part125.formFactor = Enum.FormFactor.Symmetric
- Script126.Name = "Fade"
- Script126.Parent = Part125
- table.insert(cors,sandbox(Script126,function()
- bin = script.Parent
- function activate(hit)
- bin.Transparency = 0.2
- wait(0.01)
- bin.Transparency = 0.3
- wait(0.01)
- bin.Transparency = 0.4
- wait(0.01)
- bin.Transparency = 0.5
- wait(0.01)
- bin.Transparency = 0.6
- wait(0.01)
- bin.Transparency = 0.7
- wait(0.01)
- bin.Transparency = 0.8
- wait(0.01)
- bin.Transparency = 0.9
- wait(0.01)
- bin.Transparency = 1
- end
- script.Parent.Touched:connect(activate)
- end))
- CylinderMesh127.Parent = Part125
- CylinderMesh127.Scale = Vector3.new(1, 2, 1)
- Script128.Parent = Part125
- table.insert(cors,sandbox(Script128,function()
- function onTouched(hit)
- script.Parent.Sound:play()
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Script129.Name = "Lava Script"
- Script129.Parent = Part125
- table.insert(cors,sandbox(Script129,function()
- function onTouched(part)
- if part.Parent:FindFirstChild("Humanoid") ~= nil then
- part.Parent.Torso:BreakJoints()
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Sound130.Parent = Part125
- Sound130.EmitterSize = 1000
- Sound130.MinDistance = 1000
- Sound130.SoundId = "rbxassetid://245537790"
- Sound130.Volume = 5
- UnionOperation131.Name = "Head"
- UnionOperation131.Parent = Model123
- UnionOperation131.CFrame = CFrame.new(276.505615, 160.19072, 64.6878738, -1.80344014e-05, 0.707137406, -0.707076192, 1.35542832e-05, 0.707076192, 0.707137406, 1, 3.16888872e-06, -2.23364368e-05)
- UnionOperation131.Orientation = Vector3.new(-45, -90, 0)
- UnionOperation131.Position = Vector3.new(276.505615, 160.19072, 64.6878738)
- UnionOperation131.Rotation = Vector3.new(-90, -45, -90)
- UnionOperation131.Color = Color3.new(0.639216, 0.635294, 0.647059)
- UnionOperation131.Size = Vector3.new(32.5082893, 56.5730247, 53.7166595)
- UnionOperation131.Anchored = true
- UnionOperation131.BrickColor = BrickColor.new("Medium stone grey")
- UnionOperation131.CanCollide = false
- UnionOperation131.brickColor = BrickColor.new("Medium stone grey")
- UnionOperation131.UsePartColor = true
- UnionOperation132.Name = "Head"
- UnionOperation132.Parent = Model123
- UnionOperation132.CFrame = CFrame.new(298.768677, 145.652023, 69.7866287, -0.000111436362, 0.258685172, -0.965961695, 0.000496955938, 0.965961695, 0.258685052, 0.999999881, -0.000451213506, -0.000236198364)
- UnionOperation132.Orientation = Vector3.new(-14.9899998, -90.0099945, 0.0299999993)
- UnionOperation132.Position = Vector3.new(298.768677, 145.652023, 69.7866287)
- UnionOperation132.Rotation = Vector3.new(-90.0499954, -75.0100021, -90.0199966)
- UnionOperation132.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- UnionOperation132.Transparency = 1
- UnionOperation132.Size = Vector3.new(4.89833546, 4.32207441, 6.2466197)
- UnionOperation132.BrickColor = BrickColor.new("Really black")
- UnionOperation132.CanCollide = false
- UnionOperation132.Material = Enum.Material.Cobblestone
- UnionOperation132.brickColor = BrickColor.new("Really black")
- UnionOperation132.UsePartColor = true
- BodyPosition133.Parent = UnionOperation132
- BodyPosition133.Position = Vector3.new(0, 200, 0)
- BodyPosition133.MaxForce = Vector3.new(0, 2.09999995e+10, 0)
- BodyPosition133.maxForce = Vector3.new(0, 2.09999995e+10, 0)
- BodyPosition133.position = Vector3.new(0, 200, 0)
- ParticleEmitter134.Name = "Fire"
- ParticleEmitter134.Parent = UnionOperation132
- ParticleEmitter134.Speed = NumberRange.new(100, 100)
- ParticleEmitter134.Rotation = NumberRange.new(-45, -45)
- ParticleEmitter134.Color = ColorSequence.new(Color3.new(0.666667, 0, 0),Color3.new(1, 0, 0))
- ParticleEmitter134.LightEmission = 1
- ParticleEmitter134.Texture = "http://www.roblox.com/asset/?id=241936182"
- ParticleEmitter134.Transparency = NumberSequence.new(0,0.28749996423721,1)
- ParticleEmitter134.ZOffset = 1
- ParticleEmitter134.Size = NumberSequence.new(10,0)
- ParticleEmitter134.EmissionDirection = Enum.NormalId.Front
- ParticleEmitter134.Lifetime = NumberRange.new(0.60000002384186, 0.60000002384186)
- ParticleEmitter134.LockedToPart = true
- ParticleEmitter134.Rate = 250
- ParticleEmitter134.SpreadAngle = Vector2.new(50, 50)
- ParticleEmitter134.VelocitySpread = 50
- UnionOperation135.Name = "Jaws"
- UnionOperation135.Parent = Model123
- UnionOperation135.CFrame = CFrame.new(267.765869, 144.297729, 64.7221909, -1.81461492e-05, 4.86373538e-05, -1, 1.35393748e-05, 1, 4.86371064e-05, 1, -1.35384926e-05, -1.81468076e-05)
- UnionOperation135.Orientation = Vector3.new(0, -90, 0)
- UnionOperation135.Position = Vector3.new(267.765869, 144.297729, 64.7221909)
- UnionOperation135.Rotation = Vector3.new(0, -90, 0)
- UnionOperation135.Color = Color3.new(0.639216, 0.635294, 0.647059)
- UnionOperation135.Size = Vector3.new(46.4771423, 52.6358223, 53.1223793)
- UnionOperation135.Anchored = true
- UnionOperation135.BrickColor = BrickColor.new("Medium stone grey")
- UnionOperation135.CanCollide = false
- UnionOperation135.brickColor = BrickColor.new("Medium stone grey")
- UnionOperation135.UsePartColor = true
- Part136.Parent = Model123
- Part136.CFrame = CFrame.new(298.517029, 144.009369, 67.1627731, 4.17202064e-05, 0.000191151965, 1, -7.77918976e-05, 1, -0.00019114872, -1, -7.77839232e-05, 4.17350784e-05)
- Part136.Orientation = Vector3.new(0.00999999978, 90, 0)
- Part136.Position = Vector3.new(298.517029, 144.009369, 67.1627731)
- Part136.Rotation = Vector3.new(0, 90, 0)
- Part136.Color = Color3.new(0, 1, 0)
- Part136.Transparency = 1
- Part136.Size = Vector3.new(5.24247837, 2.53084993, 18.6198387)
- Part136.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part136.BrickColor = BrickColor.new("Lime green")
- Part136.CanCollide = false
- Part136.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part136.Material = Enum.Material.Ice
- Part136.brickColor = BrickColor.new("Lime green")
- Part136.FormFactor = Enum.FormFactor.Custom
- Part136.formFactor = Enum.FormFactor.Custom
- Humanoid137.Parent = Part136
- Humanoid137.Health = 0
- Humanoid137.MaxHealth = 0
- Humanoid137.NameOcclusion = Enum.NameOcclusion.NoOcclusion
- Humanoid137.WalkSpeed = 10
- Humanoid137.maxHealth = 0
- Script138.Name = "Vaccine"
- Script138.Parent = Part136
- table.insert(cors,sandbox(Script138,function()
- function spread() -- created by culinwino3000
- local stuff = game.Workspace:GetChildren()
- for i = 1, #stuff do
- if (stuff[i].className ~= "Script") and (stuff[i]:findFirstChild("Vaccine") == nil) and (stuff[i].className ~= "Camera") then
- local clone = script:clone()
- clone.Parent = stuff[i]
- end
- end
- end
- while true do
- wait(.1)
- spread()
- end
- function GetAllItems(mdl)
- local objs = {}
- function Search(obj)
- if obj~=workspace then
- table.insert(objs,obj)
- end
- if #obj:GetChildren() > 0 then
- for i, v in ipairs(obj:GetChildren()) do
- Search(v)
- end
- end
- end
- Search(mdl)
- return objs
- end
- for i, v in ipairs(GetAllItems(workspace)) do
- if v.className == "Script" then
- if v.Name == "Chaotic" or v.Name == "Spreadify" or v.Name == "Virus" or v.Name == "Infected" then
- v.Parent = game.Lighting --Just in case it has a removal prevention.
- t = Instance.new("ObjectValue")
- t.Name = "IsAVirus"
- t.Parent = v
- end
- end
- end
- for i, v in ipairs(game.Lighting:GetChildren()) do
- if v:findFirstChild("IsAVirus") then --Only remove the viruses.
- v:remove()
- end
- end
- print("Virus debugged! All clean!")
- end))
- Script139.Parent = Part136
- table.insert(cors,sandbox(Script139,function()
- bin = script.Parent
- function move(target)
- local dir = (target.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- bin:findFirstChild("BodyGyro").cframe = CFrame.new(pos, pos + dir)
- bin:findFirstChild("BodyGyro").maxTorque = Vector3.new(9000,9000,9000)
- end
- function moveTo(target)
- bin.BodyPosition.position = target.Position
- bin.BodyPosition.maxForce = Vector3.new(10000,10000,10000) * bin.Speed.Value
- end
- function findNearestTorso(pos)
- local list = game.Workspace:GetChildren()
- local torso = nil
- local dist = 10000000000000000
- local temp = nil
- local human = nil
- local temp2 = nil
- for x = 1, #list do
- temp2 = list[x]
- if (temp2.className == "Model") and (temp2 ~= script.Parent) then
- temp = temp2:findFirstChild("Torso")
- human = temp2:findFirstChild("Humanoid")
- if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
- if (temp.Position - pos).magnitude < dist then
- torso = temp
- dist = (temp.Position - pos).magnitude
- end
- end
- end
- end
- return torso
- end
- function shoot(pos)
- dir = (pos - bin.CFrame.p).unit
- for i = 1, 50 do
- local ex = Instance.new("Explosion")
- ex.BlastRadius = 1
- ex.Position = bin.Position + (dir * 10 * i) + (dir * 7)
- ex.Parent = game.Workspace
- end
- end
- function shootAt(torso)
- local dir = (torso.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- shoot(pos)
- end
- while true do
- local torso = findNearestTorso(bin.Position)
- if torso~=nil then
- move(torso)
- moveTo(torso)
- end
- wait()
- end
- end))
- Script140.Parent = Part136
- table.insert(cors,sandbox(Script140,function()
- function onTouched(part)
- local h = part.Parent:findFirstChild("Humanoid")
- if h~=nil then
- h.Health = h.Health 100
- wait(1)
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- NumberValue141.Name = "Speed"
- NumberValue141.Parent = Part136
- NumberValue141.Value = 1000
- BodyGyro142.Parent = Part136
- BodyGyro142.CFrame = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyGyro142.MaxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro142.maxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro142.cframe = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyPosition143.Parent = Part136
- BodyPosition143.Position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- BodyPosition143.MaxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition143.maxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition143.position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- Script144.Name = "qPerfectionWeld"
- Script144.Parent = Model123
- table.insert(cors,sandbox(Script144,function()
- -- Created by Quenty (@Quenty, follow me on twitter).
- -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
- -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
- --[[ INSTRUCTIONS
- - Place in the model
- - Make sure model is anchored
- - That's it. It will weld the model and all children.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
- ]]
- --[[ DOCUMENTATION
- - Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
- - Will work in PBS servers
- - Will work as long as it starts out with the part anchored
- - Stores the relative CFrame as a CFrame value
- - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
- - Utilizes a recursive algorith to find all parts in the model
- - Will reweld on script reparent if the script is initially parented to a tool.
- - Welds as fast as possible
- ]]
- -- qPerfectionWeld.lua
- -- Created 10/6/2014
- -- Author: Quenty
- -- Version 1.0.3
- -- Updated 10/14/2014 - Updated to 1.0.1
- --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
- -- Updated 10/14/2014 - Updated to 1.0.2
- --- Fixed bug fix.
- -- Updated 10/14/2014 - Updated to 1.0.3
- --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
- local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
- local function CallOnChildren(Instance, FunctionToCall)
- -- Calls a function on each of the children of a certain object, using recursion.
- FunctionToCall(Instance)
- for _, Child in next, Instance:GetChildren() do
- CallOnChildren(Child, FunctionToCall)
- end
- end
- local function GetNearestParent(Instance, ClassName)
- -- Returns the nearest parent of a certain class, or returns nil
- local Ancestor = Instance
- repeat
- Ancestor = Ancestor.Parent
- if Ancestor == nil then
- return nil
- end
- until Ancestor:IsA(ClassName)
- return Ancestor
- end
- local function GetBricks(StartInstance)
- local List = {}
- -- if StartInstance:IsA("BasePart") then
- -- List[#List+1] = StartInstance
- -- end
- CallOnChildren(StartInstance, function(Item)
- if Item:IsA("BasePart") then
- List[#List+1] = Item;
- end
- end)
- return List
- end
- local function Modify(Instance, Values)
- -- Modifies an Instance by using a table.
- assert(type(Values) == "table", "Values is not a table");
- for Index, Value in next, Values do
- if type(Index) == "number" then
- Value.Parent = Instance
- else
- Instance[Index] = Value
- end
- end
- return Instance
- end
- local function Make(ClassType, Properties)
- -- Using a syntax hack to create a nice way to Make new items.
- return Modify(Instance.new(ClassType), Properties)
- end
- local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
- local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
- local function HasWheelJoint(Part)
- for _, SurfaceName in pairs(Surfaces) do
- for _, HingSurfaceName in pairs(HingSurfaces) do
- if Part[SurfaceName].Name == HingSurfaceName then
- return true
- end
- end
- end
- return false
- end
- local function ShouldBreakJoints(Part)
- --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
- -- definitely some edge cases.
- if NEVER_BREAK_JOINTS then
- return false
- end
- if HasWheelJoint(Part) then
- return false
- end
- local Connected = Part:GetConnectedParts()
- if #Connected == 1 then
- return false
- end
- for _, Item in pairs(Connected) do
- if HasWheelJoint(Item) then
- return false
- elseif not Item:IsDescendantOf(script.Parent) then
- return false
- end
- end
- return true
- end
- local function WeldTogether(Part0, Part1, JointType, WeldParent)
- --- Weld's 2 parts together
- -- @param Part0 The first part
- -- @param Part1 The second part (Dependent part most of the time).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
- -- @return The weld created.
- JointType = JointType or "Weld"
- local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
- local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
- Modify(NewWeld, {
- Name = "qCFrameWeldThingy";
- Part0 = Part0;
- Part1 = Part1;
- C0 = CFrame.new();--Part0.CFrame:inverse();
- C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
- Parent = Part1;
- })
- if not RelativeValue then
- RelativeValue = Make("CFrameValue", {
- Parent = Part1;
- Name = "qRelativeCFrameWeldValue";
- Archivable = true;
- Value = NewWeld.C1;
- })
- end
- return NewWeld
- end
- local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
- -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
- -- @param MainPart The part to weld the model to (can be in the model).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
- for _, Part in pairs(Parts) do
- if ShouldBreakJoints(Part) then
- Part:BreakJoints()
- end
- end
- for _, Part in pairs(Parts) do
- if Part ~= MainPart then
- WeldTogether(MainPart, Part, JointType, MainPart)
- end
- end
- if not DoNotUnanchor then
- for _, Part in pairs(Parts) do
- Part.Anchored = false
- end
- MainPart.Anchored = false
- end
- end
- local function PerfectionWeld()
- local Tool = GetNearestParent(script, "Tool")
- local Parts = GetBricks(script.Parent)
- local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
- if PrimaryPart then
- WeldParts(Parts, PrimaryPart, "Weld", false)
- else
- warn("qWeld - Unable to weld part")
- end
- return Tool
- end
- local Tool = PerfectionWeld()
- if Tool and script.ClassName == "Script" then
- --- Don't bother with local scripts
- script.Parent.AncestryChanged:connect(function()
- PerfectionWeld()
- end)
- end
- -- Created by Quenty (@Quenty, follow me on twitter).
- end))
- UnionOperation145.Parent = Model123
- UnionOperation145.CFrame = CFrame.new(266.689331, 162.804581, 64.4994736, -1.77512757e-05, 0.0870547071, -0.996203601, 1.35543223e-05, 0.996203542, 0.0870547071, 1, -1.19575316e-05, -1.88638533e-05)
- UnionOperation145.Orientation = Vector3.new(-4.98999977, -90, 0)
- UnionOperation145.Position = Vector3.new(266.689331, 162.804581, 64.4994736)
- UnionOperation145.Rotation = Vector3.new(-90.0099945, -85.0099945, -90.0099945)
- UnionOperation145.Color = Color3.new(1, 0, 0)
- UnionOperation145.Size = Vector3.new(20.9885483, 5.03980398, 5.56811333)
- UnionOperation145.Anchored = true
- UnionOperation145.BrickColor = BrickColor.new("Really red")
- UnionOperation145.CanCollide = false
- UnionOperation145.Material = Enum.Material.Neon
- UnionOperation145.brickColor = BrickColor.new("Really red")
- UnionOperation145.UsePartColor = true
- Script146.Parent = UnionOperation145
- table.insert(cors,sandbox(Script146,function()
- while true do
- wait(.000001)
- script.Parent.UsePartColor=true
- wait(.000001)
- script.Parent.UsePartColor=false
- end
- end))
- Model147.Name = "Blaster"
- Model147.Parent = Model0
- Model148.Name = "Top laser"
- Model148.Parent = Model147
- Part149.Name = "Shatter"
- Part149.Parent = Model148
- Part149.CFrame = CFrame.new(-180.065933, 202.950943, -12.9140587, 5.14824933e-05, -1, 0.000131111578, 0.000206255281, -0.000131100955, -1, 1, 5.1509538e-05, 0.000206248529)
- Part149.Orientation = Vector3.new(90, -90, 0)
- Part149.Position = Vector3.new(-180.065933, 202.950943, -12.9140587)
- Part149.Rotation = Vector3.new(89.9899979, 0.00999999978, 90)
- Part149.Color = Color3.new(1, 0, 0)
- Part149.Transparency = 1
- Part149.Size = Vector3.new(19.677372, 481.386078, 19.4694805)
- Part149.BackSurface = Enum.SurfaceType.Weld
- Part149.BottomSurface = Enum.SurfaceType.Weld
- Part149.BrickColor = BrickColor.new("Really red")
- Part149.CanCollide = false
- Part149.FrontSurface = Enum.SurfaceType.Weld
- Part149.LeftSurface = Enum.SurfaceType.Weld
- Part149.Material = Enum.Material.Neon
- Part149.Reflectance = 0.5
- Part149.RightSurface = Enum.SurfaceType.Weld
- Part149.TopSurface = Enum.SurfaceType.Weld
- Part149.brickColor = BrickColor.new("Really red")
- Part149.FormFactor = Enum.FormFactor.Symmetric
- Part149.formFactor = Enum.FormFactor.Symmetric
- Script150.Name = "Fade"
- Script150.Parent = Part149
- table.insert(cors,sandbox(Script150,function()
- bin = script.Parent
- function activate(hit)
- bin.Transparency = 0.2
- wait(0.01)
- bin.Transparency = 0.3
- wait(0.01)
- bin.Transparency = 0.4
- wait(0.01)
- bin.Transparency = 0.5
- wait(0.01)
- bin.Transparency = 0.6
- wait(0.01)
- bin.Transparency = 0.7
- wait(0.01)
- bin.Transparency = 0.8
- wait(0.01)
- bin.Transparency = 0.9
- wait(0.01)
- bin.Transparency = 1
- end
- script.Parent.Touched:connect(activate)
- end))
- CylinderMesh151.Parent = Part149
- CylinderMesh151.Scale = Vector3.new(1, 2, 1)
- Script152.Parent = Part149
- table.insert(cors,sandbox(Script152,function()
- function onTouched(hit)
- script.Parent.Sound:play()
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Script153.Name = "Lava Script"
- Script153.Parent = Part149
- table.insert(cors,sandbox(Script153,function()
- function onTouched(part)
- if part.Parent:FindFirstChild("Humanoid") ~= nil then
- part.Parent.Torso:BreakJoints()
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Sound154.Parent = Part149
- Sound154.EmitterSize = 1000
- Sound154.MinDistance = 1000
- Sound154.SoundId = "rbxassetid://245537790"
- Sound154.Volume = 5
- UnionOperation155.Name = "Head"
- UnionOperation155.Parent = Model147
- UnionOperation155.CFrame = CFrame.new(306.367432, 222.889603, -13.34692, -1.80344014e-05, 0.707137406, -0.707076192, 1.35542832e-05, 0.707076192, 0.707137406, 1, 3.16888872e-06, -2.23364368e-05)
- UnionOperation155.Orientation = Vector3.new(-45, -90, 0)
- UnionOperation155.Position = Vector3.new(306.367432, 222.889603, -13.34692)
- UnionOperation155.Rotation = Vector3.new(-90, -45, -90)
- UnionOperation155.Color = Color3.new(0.639216, 0.635294, 0.647059)
- UnionOperation155.Size = Vector3.new(32.5082893, 56.5730247, 53.7166595)
- UnionOperation155.Anchored = true
- UnionOperation155.BrickColor = BrickColor.new("Medium stone grey")
- UnionOperation155.CanCollide = false
- UnionOperation155.brickColor = BrickColor.new("Medium stone grey")
- UnionOperation155.UsePartColor = true
- UnionOperation156.Name = "Head"
- UnionOperation156.Parent = Model147
- UnionOperation156.CFrame = CFrame.new(328.630493, 208.351089, -8.24817657, -0.000111436362, 0.258685172, -0.965961695, 0.000496955938, 0.965961695, 0.258685052, 0.999999881, -0.000451213506, -0.000236198364)
- UnionOperation156.Orientation = Vector3.new(-14.9899998, -90.0099945, 0.0299999993)
- UnionOperation156.Position = Vector3.new(328.630493, 208.351089, -8.24817657)
- UnionOperation156.Rotation = Vector3.new(-90.0499954, -75.0100021, -90.0199966)
- UnionOperation156.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- UnionOperation156.Transparency = 1
- UnionOperation156.Size = Vector3.new(4.89833546, 4.32207441, 6.2466197)
- UnionOperation156.BrickColor = BrickColor.new("Really black")
- UnionOperation156.CanCollide = false
- UnionOperation156.Material = Enum.Material.Cobblestone
- UnionOperation156.brickColor = BrickColor.new("Really black")
- UnionOperation156.UsePartColor = true
- BodyPosition157.Parent = UnionOperation156
- BodyPosition157.Position = Vector3.new(0, 200, 0)
- BodyPosition157.MaxForce = Vector3.new(0, 2.09999995e+10, 0)
- BodyPosition157.maxForce = Vector3.new(0, 2.09999995e+10, 0)
- BodyPosition157.position = Vector3.new(0, 200, 0)
- ParticleEmitter158.Name = "Fire"
- ParticleEmitter158.Parent = UnionOperation156
- ParticleEmitter158.Speed = NumberRange.new(100, 100)
- ParticleEmitter158.Rotation = NumberRange.new(-45, -45)
- ParticleEmitter158.Color = ColorSequence.new(Color3.new(0.666667, 0, 0),Color3.new(1, 0, 0))
- ParticleEmitter158.LightEmission = 1
- ParticleEmitter158.Texture = "http://www.roblox.com/asset/?id=241936182"
- ParticleEmitter158.Transparency = NumberSequence.new(0,0.28749996423721,1)
- ParticleEmitter158.ZOffset = 1
- ParticleEmitter158.Size = NumberSequence.new(10,0)
- ParticleEmitter158.EmissionDirection = Enum.NormalId.Front
- ParticleEmitter158.Lifetime = NumberRange.new(0.60000002384186, 0.60000002384186)
- ParticleEmitter158.LockedToPart = true
- ParticleEmitter158.Rate = 250
- ParticleEmitter158.SpreadAngle = Vector2.new(50, 50)
- ParticleEmitter158.VelocitySpread = 50
- UnionOperation159.Name = "Jaws"
- UnionOperation159.Parent = Model147
- UnionOperation159.CFrame = CFrame.new(297.627686, 206.996765, -13.3126068, -1.81461492e-05, 4.86373538e-05, -1, 1.35393748e-05, 1, 4.86371064e-05, 1, -1.35384926e-05, -1.81468076e-05)
- UnionOperation159.Orientation = Vector3.new(0, -90, 0)
- UnionOperation159.Position = Vector3.new(297.627686, 206.996765, -13.3126068)
- UnionOperation159.Rotation = Vector3.new(0, -90, 0)
- UnionOperation159.Color = Color3.new(0.639216, 0.635294, 0.647059)
- UnionOperation159.Size = Vector3.new(46.4771423, 52.6358223, 53.1223793)
- UnionOperation159.Anchored = true
- UnionOperation159.BrickColor = BrickColor.new("Medium stone grey")
- UnionOperation159.CanCollide = false
- UnionOperation159.brickColor = BrickColor.new("Medium stone grey")
- UnionOperation159.UsePartColor = true
- Part160.Parent = Model147
- Part160.CFrame = CFrame.new(328.378906, 206.708755, -10.8719559, 4.17202064e-05, 0.000191151965, 1, -7.77918976e-05, 1, -0.00019114872, -1, -7.77839232e-05, 4.17350784e-05)
- Part160.Orientation = Vector3.new(0.00999999978, 90, 0)
- Part160.Position = Vector3.new(328.378906, 206.708755, -10.8719559)
- Part160.Rotation = Vector3.new(0, 90, 0)
- Part160.Color = Color3.new(0, 1, 0)
- Part160.Transparency = 1
- Part160.Size = Vector3.new(5.24247837, 2.53084993, 18.6198387)
- Part160.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part160.BrickColor = BrickColor.new("Lime green")
- Part160.CanCollide = false
- Part160.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part160.Material = Enum.Material.Ice
- Part160.brickColor = BrickColor.new("Lime green")
- Part160.FormFactor = Enum.FormFactor.Custom
- Part160.formFactor = Enum.FormFactor.Custom
- Humanoid161.Parent = Part160
- Humanoid161.Health = 0
- Humanoid161.MaxHealth = 0
- Humanoid161.NameOcclusion = Enum.NameOcclusion.NoOcclusion
- Humanoid161.WalkSpeed = 10
- Humanoid161.maxHealth = 0
- Script162.Name = "Vaccine"
- Script162.Parent = Part160
- table.insert(cors,sandbox(Script162,function()
- function spread() -- created by culinwino3000
- local stuff = game.Workspace:GetChildren()
- for i = 1, #stuff do
- if (stuff[i].className ~= "Script") and (stuff[i]:findFirstChild("Vaccine") == nil) and (stuff[i].className ~= "Camera") then
- local clone = script:clone()
- clone.Parent = stuff[i]
- end
- end
- end
- while true do
- wait(.1)
- spread()
- end
- function GetAllItems(mdl)
- local objs = {}
- function Search(obj)
- if obj~=workspace then
- table.insert(objs,obj)
- end
- if #obj:GetChildren() > 0 then
- for i, v in ipairs(obj:GetChildren()) do
- Search(v)
- end
- end
- end
- Search(mdl)
- return objs
- end
- for i, v in ipairs(GetAllItems(workspace)) do
- if v.className == "Script" then
- if v.Name == "Chaotic" or v.Name == "Spreadify" or v.Name == "Virus" or v.Name == "Infected" then
- v.Parent = game.Lighting --Just in case it has a removal prevention.
- t = Instance.new("ObjectValue")
- t.Name = "IsAVirus"
- t.Parent = v
- end
- end
- end
- for i, v in ipairs(game.Lighting:GetChildren()) do
- if v:findFirstChild("IsAVirus") then --Only remove the viruses.
- v:remove()
- end
- end
- print("Virus debugged! All clean!")
- end))
- Script163.Parent = Part160
- table.insert(cors,sandbox(Script163,function()
- bin = script.Parent
- function move(target)
- local dir = (target.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- bin:findFirstChild("BodyGyro").cframe = CFrame.new(pos, pos + dir)
- bin:findFirstChild("BodyGyro").maxTorque = Vector3.new(9000,9000,9000)
- end
- function moveTo(target)
- bin.BodyPosition.position = target.Position
- bin.BodyPosition.maxForce = Vector3.new(10000,10000,10000) * bin.Speed.Value
- end
- function findNearestTorso(pos)
- local list = game.Workspace:GetChildren()
- local torso = nil
- local dist = 10000000000000000
- local temp = nil
- local human = nil
- local temp2 = nil
- for x = 1, #list do
- temp2 = list[x]
- if (temp2.className == "Model") and (temp2 ~= script.Parent) then
- temp = temp2:findFirstChild("Torso")
- human = temp2:findFirstChild("Humanoid")
- if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
- if (temp.Position - pos).magnitude < dist then
- torso = temp
- dist = (temp.Position - pos).magnitude
- end
- end
- end
- end
- return torso
- end
- function shoot(pos)
- dir = (pos - bin.CFrame.p).unit
- for i = 1, 50 do
- local ex = Instance.new("Explosion")
- ex.BlastRadius = 1
- ex.Position = bin.Position + (dir * 10 * i) + (dir * 7)
- ex.Parent = game.Workspace
- end
- end
- function shootAt(torso)
- local dir = (torso.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- shoot(pos)
- end
- while true do
- local torso = findNearestTorso(bin.Position)
- if torso~=nil then
- move(torso)
- moveTo(torso)
- end
- wait()
- end
- end))
- Script164.Parent = Part160
- table.insert(cors,sandbox(Script164,function()
- function onTouched(part)
- local h = part.Parent:findFirstChild("Humanoid")
- if h~=nil then
- h.Health = h.Health 100
- wait(1)
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- NumberValue165.Name = "Speed"
- NumberValue165.Parent = Part160
- NumberValue165.Value = 3000
- BodyGyro166.Parent = Part160
- BodyGyro166.CFrame = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyGyro166.MaxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro166.maxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro166.cframe = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyPosition167.Parent = Part160
- BodyPosition167.Position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- BodyPosition167.MaxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition167.maxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition167.position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- Script168.Name = "qPerfectionWeld"
- Script168.Parent = Model147
- table.insert(cors,sandbox(Script168,function()
- -- Created by Quenty (@Quenty, follow me on twitter).
- -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
- -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
- --[[ INSTRUCTIONS
- - Place in the model
- - Make sure model is anchored
- - That's it. It will weld the model and all children.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
- ]]
- --[[ DOCUMENTATION
- - Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
- - Will work in PBS servers
- - Will work as long as it starts out with the part anchored
- - Stores the relative CFrame as a CFrame value
- - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
- - Utilizes a recursive algorith to find all parts in the model
- - Will reweld on script reparent if the script is initially parented to a tool.
- - Welds as fast as possible
- ]]
- -- qPerfectionWeld.lua
- -- Created 10/6/2014
- -- Author: Quenty
- -- Version 1.0.3
- -- Updated 10/14/2014 - Updated to 1.0.1
- --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
- -- Updated 10/14/2014 - Updated to 1.0.2
- --- Fixed bug fix.
- -- Updated 10/14/2014 - Updated to 1.0.3
- --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
- local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
- local function CallOnChildren(Instance, FunctionToCall)
- -- Calls a function on each of the children of a certain object, using recursion.
- FunctionToCall(Instance)
- for _, Child in next, Instance:GetChildren() do
- CallOnChildren(Child, FunctionToCall)
- end
- end
- local function GetNearestParent(Instance, ClassName)
- -- Returns the nearest parent of a certain class, or returns nil
- local Ancestor = Instance
- repeat
- Ancestor = Ancestor.Parent
- if Ancestor == nil then
- return nil
- end
- until Ancestor:IsA(ClassName)
- return Ancestor
- end
- local function GetBricks(StartInstance)
- local List = {}
- -- if StartInstance:IsA("BasePart") then
- -- List[#List+1] = StartInstance
- -- end
- CallOnChildren(StartInstance, function(Item)
- if Item:IsA("BasePart") then
- List[#List+1] = Item;
- end
- end)
- return List
- end
- local function Modify(Instance, Values)
- -- Modifies an Instance by using a table.
- assert(type(Values) == "table", "Values is not a table");
- for Index, Value in next, Values do
- if type(Index) == "number" then
- Value.Parent = Instance
- else
- Instance[Index] = Value
- end
- end
- return Instance
- end
- local function Make(ClassType, Properties)
- -- Using a syntax hack to create a nice way to Make new items.
- return Modify(Instance.new(ClassType), Properties)
- end
- local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
- local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
- local function HasWheelJoint(Part)
- for _, SurfaceName in pairs(Surfaces) do
- for _, HingSurfaceName in pairs(HingSurfaces) do
- if Part[SurfaceName].Name == HingSurfaceName then
- return true
- end
- end
- end
- return false
- end
- local function ShouldBreakJoints(Part)
- --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
- -- definitely some edge cases.
- if NEVER_BREAK_JOINTS then
- return false
- end
- if HasWheelJoint(Part) then
- return false
- end
- local Connected = Part:GetConnectedParts()
- if #Connected == 1 then
- return false
- end
- for _, Item in pairs(Connected) do
- if HasWheelJoint(Item) then
- return false
- elseif not Item:IsDescendantOf(script.Parent) then
- return false
- end
- end
- return true
- end
- local function WeldTogether(Part0, Part1, JointType, WeldParent)
- --- Weld's 2 parts together
- -- @param Part0 The first part
- -- @param Part1 The second part (Dependent part most of the time).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
- -- @return The weld created.
- JointType = JointType or "Weld"
- local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
- local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
- Modify(NewWeld, {
- Name = "qCFrameWeldThingy";
- Part0 = Part0;
- Part1 = Part1;
- C0 = CFrame.new();--Part0.CFrame:inverse();
- C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
- Parent = Part1;
- })
- if not RelativeValue then
- RelativeValue = Make("CFrameValue", {
- Parent = Part1;
- Name = "qRelativeCFrameWeldValue";
- Archivable = true;
- Value = NewWeld.C1;
- })
- end
- return NewWeld
- end
- local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
- -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
- -- @param MainPart The part to weld the model to (can be in the model).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
- for _, Part in pairs(Parts) do
- if ShouldBreakJoints(Part) then
- Part:BreakJoints()
- end
- end
- for _, Part in pairs(Parts) do
- if Part ~= MainPart then
- WeldTogether(MainPart, Part, JointType, MainPart)
- end
- end
- if not DoNotUnanchor then
- for _, Part in pairs(Parts) do
- Part.Anchored = false
- end
- MainPart.Anchored = false
- end
- end
- local function PerfectionWeld()
- local Tool = GetNearestParent(script, "Tool")
- local Parts = GetBricks(script.Parent)
- local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
- if PrimaryPart then
- WeldParts(Parts, PrimaryPart, "Weld", false)
- else
- warn("qWeld - Unable to weld part")
- end
- return Tool
- end
- local Tool = PerfectionWeld()
- if Tool and script.ClassName == "Script" then
- --- Don't bother with local scripts
- script.Parent.AncestryChanged:connect(function()
- PerfectionWeld()
- end)
- end
- -- Created by Quenty (@Quenty, follow me on twitter).
- end))
- UnionOperation169.Parent = Model147
- UnionOperation169.CFrame = CFrame.new(296.551147, 225.503799, -13.5353241, -1.77512757e-05, 0.0870547071, -0.996203601, 1.35543223e-05, 0.996203542, 0.0870547071, 1, -1.19575316e-05, -1.88638533e-05)
- UnionOperation169.Orientation = Vector3.new(-4.98999977, -90, 0)
- UnionOperation169.Position = Vector3.new(296.551147, 225.503799, -13.5353241)
- UnionOperation169.Rotation = Vector3.new(-90.0099945, -85.0099945, -90.0099945)
- UnionOperation169.Color = Color3.new(1, 0, 0)
- UnionOperation169.Size = Vector3.new(20.9885483, 5.03980398, 5.56811333)
- UnionOperation169.Anchored = true
- UnionOperation169.BrickColor = BrickColor.new("Really red")
- UnionOperation169.CanCollide = false
- UnionOperation169.Material = Enum.Material.Neon
- UnionOperation169.brickColor = BrickColor.new("Really red")
- UnionOperation169.UsePartColor = true
- Script170.Parent = UnionOperation169
- table.insert(cors,sandbox(Script170,function()
- while true do
- wait(.000001)
- script.Parent.UsePartColor=true
- wait(.000001)
- script.Parent.UsePartColor=false
- end
- end))
- Model171.Name = "Blaster"
- Model171.Parent = Model0
- Model172.Name = "Top laser"
- Model172.Parent = Model171
- Part173.Name = "Shatter"
- Part173.Parent = Model172
- Part173.CFrame = CFrame.new(-209.934769, 140.224854, -65.9834366, 5.14824933e-05, -1, 0.000131111578, 0.000206255281, -0.000131100955, -1, 1, 5.1509538e-05, 0.000206248529)
- Part173.Orientation = Vector3.new(90, -90, 0)
- Part173.Position = Vector3.new(-209.934769, 140.224854, -65.9834366)
- Part173.Rotation = Vector3.new(89.9899979, 0.00999999978, 90)
- Part173.Color = Color3.new(1, 0, 0)
- Part173.Transparency = 1
- Part173.Size = Vector3.new(19.677372, 481.386078, 19.4694805)
- Part173.BackSurface = Enum.SurfaceType.Weld
- Part173.BottomSurface = Enum.SurfaceType.Weld
- Part173.BrickColor = BrickColor.new("Really red")
- Part173.CanCollide = false
- Part173.FrontSurface = Enum.SurfaceType.Weld
- Part173.LeftSurface = Enum.SurfaceType.Weld
- Part173.Material = Enum.Material.Neon
- Part173.Reflectance = 0.5
- Part173.RightSurface = Enum.SurfaceType.Weld
- Part173.TopSurface = Enum.SurfaceType.Weld
- Part173.brickColor = BrickColor.new("Really red")
- Part173.FormFactor = Enum.FormFactor.Symmetric
- Part173.formFactor = Enum.FormFactor.Symmetric
- Script174.Name = "Fade"
- Script174.Parent = Part173
- table.insert(cors,sandbox(Script174,function()
- bin = script.Parent
- function activate(hit)
- bin.Transparency = 0.2
- wait(0.01)
- bin.Transparency = 0.3
- wait(0.01)
- bin.Transparency = 0.4
- wait(0.01)
- bin.Transparency = 0.5
- wait(0.01)
- bin.Transparency = 0.6
- wait(0.01)
- bin.Transparency = 0.7
- wait(0.01)
- bin.Transparency = 0.8
- wait(0.01)
- bin.Transparency = 0.9
- wait(0.01)
- bin.Transparency = 1
- end
- script.Parent.Touched:connect(activate)
- end))
- CylinderMesh175.Parent = Part173
- CylinderMesh175.Scale = Vector3.new(1, 2, 1)
- Script176.Parent = Part173
- table.insert(cors,sandbox(Script176,function()
- function onTouched(hit)
- script.Parent.Sound:play()
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Script177.Name = "Lava Script"
- Script177.Parent = Part173
- table.insert(cors,sandbox(Script177,function()
- function onTouched(part)
- if part.Parent:FindFirstChild("Humanoid") ~= nil then
- part.Parent.Torso:BreakJoints()
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Sound178.Parent = Part173
- Sound178.EmitterSize = 1000
- Sound178.MinDistance = 1000
- Sound178.SoundId = "rbxassetid://245537790"
- Sound178.Volume = 5
- UnionOperation179.Name = "Head"
- UnionOperation179.Parent = Model171
- UnionOperation179.CFrame = CFrame.new(276.498962, 160.163666, -66.4162674, -1.80344014e-05, 0.707137406, -0.707076192, 1.35542832e-05, 0.707076192, 0.707137406, 1, 3.16888872e-06, -2.23364368e-05)
- UnionOperation179.Orientation = Vector3.new(-45, -90, 0)
- UnionOperation179.Position = Vector3.new(276.498962, 160.163666, -66.4162674)
- UnionOperation179.Rotation = Vector3.new(-90, -45, -90)
- UnionOperation179.Color = Color3.new(0.639216, 0.635294, 0.647059)
- UnionOperation179.Size = Vector3.new(32.5082893, 56.5730247, 53.7166595)
- UnionOperation179.Anchored = true
- UnionOperation179.BrickColor = BrickColor.new("Medium stone grey")
- UnionOperation179.CanCollide = false
- UnionOperation179.brickColor = BrickColor.new("Medium stone grey")
- UnionOperation179.UsePartColor = true
- UnionOperation180.Name = "Head"
- UnionOperation180.Parent = Model171
- UnionOperation180.CFrame = CFrame.new(298.761963, 145.625092, -61.3175888, -0.000111436362, 0.258685172, -0.965961695, 0.000496955938, 0.965961695, 0.258685052, 0.999999881, -0.000451213506, -0.000236198364)
- UnionOperation180.Orientation = Vector3.new(-14.9899998, -90.0099945, 0.0299999993)
- UnionOperation180.Position = Vector3.new(298.761963, 145.625092, -61.3175888)
- UnionOperation180.Rotation = Vector3.new(-90.0499954, -75.0100021, -90.0199966)
- UnionOperation180.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- UnionOperation180.Transparency = 1
- UnionOperation180.Size = Vector3.new(4.89833546, 4.32207441, 6.2466197)
- UnionOperation180.BrickColor = BrickColor.new("Really black")
- UnionOperation180.CanCollide = false
- UnionOperation180.Material = Enum.Material.Cobblestone
- UnionOperation180.brickColor = BrickColor.new("Really black")
- UnionOperation180.UsePartColor = true
- BodyPosition181.Parent = UnionOperation180
- BodyPosition181.Position = Vector3.new(0, 200, 0)
- BodyPosition181.MaxForce = Vector3.new(0, 2.09999995e+10, 0)
- BodyPosition181.maxForce = Vector3.new(0, 2.09999995e+10, 0)
- BodyPosition181.position = Vector3.new(0, 200, 0)
- ParticleEmitter182.Name = "Fire"
- ParticleEmitter182.Parent = UnionOperation180
- ParticleEmitter182.Speed = NumberRange.new(100, 100)
- ParticleEmitter182.Rotation = NumberRange.new(-45, -45)
- ParticleEmitter182.Color = ColorSequence.new(Color3.new(0.666667, 0, 0),Color3.new(1, 0, 0))
- ParticleEmitter182.LightEmission = 1
- ParticleEmitter182.Texture = "http://www.roblox.com/asset/?id=241936182"
- ParticleEmitter182.Transparency = NumberSequence.new(0,0.28749996423721,1)
- ParticleEmitter182.ZOffset = 1
- ParticleEmitter182.Size = NumberSequence.new(10,0)
- ParticleEmitter182.EmissionDirection = Enum.NormalId.Front
- ParticleEmitter182.Lifetime = NumberRange.new(0.60000002384186, 0.60000002384186)
- ParticleEmitter182.LockedToPart = true
- ParticleEmitter182.Rate = 250
- ParticleEmitter182.SpreadAngle = Vector2.new(50, 50)
- ParticleEmitter182.VelocitySpread = 50
- UnionOperation183.Name = "Jaws"
- UnionOperation183.Parent = Model171
- UnionOperation183.CFrame = CFrame.new(267.759216, 144.270752, -66.3819885, -1.81461492e-05, 4.86373538e-05, -1, 1.35393748e-05, 1, 4.86371064e-05, 1, -1.35384926e-05, -1.81468076e-05)
- UnionOperation183.Orientation = Vector3.new(0, -90, 0)
- UnionOperation183.Position = Vector3.new(267.759216, 144.270752, -66.3819885)
- UnionOperation183.Rotation = Vector3.new(0, -90, 0)
- UnionOperation183.Color = Color3.new(0.639216, 0.635294, 0.647059)
- UnionOperation183.Size = Vector3.new(46.4771423, 52.6358223, 53.1223793)
- UnionOperation183.Anchored = true
- UnionOperation183.BrickColor = BrickColor.new("Medium stone grey")
- UnionOperation183.CanCollide = false
- UnionOperation183.brickColor = BrickColor.new("Medium stone grey")
- UnionOperation183.UsePartColor = true
- Part184.Parent = Model171
- Part184.CFrame = CFrame.new(298.510315, 143.982391, -63.9413071, 4.17202064e-05, 0.000191151965, 1, -7.77918976e-05, 1, -0.00019114872, -1, -7.77839232e-05, 4.17350784e-05)
- Part184.Orientation = Vector3.new(0.00999999978, 90, 0)
- Part184.Position = Vector3.new(298.510315, 143.982391, -63.9413071)
- Part184.Rotation = Vector3.new(0, 90, 0)
- Part184.Color = Color3.new(0, 1, 0)
- Part184.Transparency = 1
- Part184.Size = Vector3.new(5.24247837, 2.53084993, 18.6198387)
- Part184.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part184.BrickColor = BrickColor.new("Lime green")
- Part184.CanCollide = false
- Part184.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part184.Material = Enum.Material.Ice
- Part184.brickColor = BrickColor.new("Lime green")
- Part184.FormFactor = Enum.FormFactor.Custom
- Part184.formFactor = Enum.FormFactor.Custom
- Humanoid185.Parent = Part184
- Humanoid185.Health = 0
- Humanoid185.MaxHealth = 0
- Humanoid185.NameOcclusion = Enum.NameOcclusion.NoOcclusion
- Humanoid185.WalkSpeed = 10
- Humanoid185.maxHealth = 0
- Script186.Name = "Vaccine"
- Script186.Parent = Part184
- table.insert(cors,sandbox(Script186,function()
- function spread() -- created by culinwino3000
- local stuff = game.Workspace:GetChildren()
- for i = 1, #stuff do
- if (stuff[i].className ~= "Script") and (stuff[i]:findFirstChild("Vaccine") == nil) and (stuff[i].className ~= "Camera") then
- local clone = script:clone()
- clone.Parent = stuff[i]
- end
- end
- end
- while true do
- wait(.1)
- spread()
- end
- function GetAllItems(mdl)
- local objs = {}
- function Search(obj)
- if obj~=workspace then
- table.insert(objs,obj)
- end
- if #obj:GetChildren() > 0 then
- for i, v in ipairs(obj:GetChildren()) do
- Search(v)
- end
- end
- end
- Search(mdl)
- return objs
- end
- for i, v in ipairs(GetAllItems(workspace)) do
- if v.className == "Script" then
- if v.Name == "Chaotic" or v.Name == "Spreadify" or v.Name == "Virus" or v.Name == "Infected" then
- v.Parent = game.Lighting --Just in case it has a removal prevention.
- t = Instance.new("ObjectValue")
- t.Name = "IsAVirus"
- t.Parent = v
- end
- end
- end
- for i, v in ipairs(game.Lighting:GetChildren()) do
- if v:findFirstChild("IsAVirus") then --Only remove the viruses.
- v:remove()
- end
- end
- print("Virus debugged! All clean!")
- end))
- Script187.Parent = Part184
- table.insert(cors,sandbox(Script187,function()
- bin = script.Parent
- function move(target)
- local dir = (target.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- bin:findFirstChild("BodyGyro").cframe = CFrame.new(pos, pos + dir)
- bin:findFirstChild("BodyGyro").maxTorque = Vector3.new(9000,9000,9000)
- end
- function moveTo(target)
- bin.BodyPosition.position = target.Position
- bin.BodyPosition.maxForce = Vector3.new(10000,10000,10000) * bin.Speed.Value
- end
- function findNearestTorso(pos)
- local list = game.Workspace:GetChildren()
- local torso = nil
- local dist = 10000000000000000
- local temp = nil
- local human = nil
- local temp2 = nil
- for x = 1, #list do
- temp2 = list[x]
- if (temp2.className == "Model") and (temp2 ~= script.Parent) then
- temp = temp2:findFirstChild("Torso")
- human = temp2:findFirstChild("Humanoid")
- if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
- if (temp.Position - pos).magnitude < dist then
- torso = temp
- dist = (temp.Position - pos).magnitude
- end
- end
- end
- end
- return torso
- end
- function shoot(pos)
- dir = (pos - bin.CFrame.p).unit
- for i = 1, 50 do
- local ex = Instance.new("Explosion")
- ex.BlastRadius = 1
- ex.Position = bin.Position + (dir * 10 * i) + (dir * 7)
- ex.Parent = game.Workspace
- end
- end
- function shootAt(torso)
- local dir = (torso.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- shoot(pos)
- end
- while true do
- local torso = findNearestTorso(bin.Position)
- if torso~=nil then
- move(torso)
- moveTo(torso)
- end
- wait()
- end
- end))
- Script188.Parent = Part184
- table.insert(cors,sandbox(Script188,function()
- function onTouched(part)
- local h = part.Parent:findFirstChild("Humanoid")
- if h~=nil then
- h.Health = h.Health 100
- wait(1)
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- NumberValue189.Name = "Speed"
- NumberValue189.Parent = Part184
- NumberValue189.Value = 2000
- BodyGyro190.Parent = Part184
- BodyGyro190.CFrame = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyGyro190.MaxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro190.maxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro190.cframe = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyPosition191.Parent = Part184
- BodyPosition191.Position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- BodyPosition191.MaxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition191.maxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition191.position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- Script192.Name = "qPerfectionWeld"
- Script192.Parent = Model171
- table.insert(cors,sandbox(Script192,function()
- -- Created by Quenty (@Quenty, follow me on twitter).
- -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
- -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
- --[[ INSTRUCTIONS
- - Place in the model
- - Make sure model is anchored
- - That's it. It will weld the model and all children.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
- ]]
- --[[ DOCUMENTATION
- - Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
- - Will work in PBS servers
- - Will work as long as it starts out with the part anchored
- - Stores the relative CFrame as a CFrame value
- - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
- - Utilizes a recursive algorith to find all parts in the model
- - Will reweld on script reparent if the script is initially parented to a tool.
- - Welds as fast as possible
- ]]
- -- qPerfectionWeld.lua
- -- Created 10/6/2014
- -- Author: Quenty
- -- Version 1.0.3
- -- Updated 10/14/2014 - Updated to 1.0.1
- --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
- -- Updated 10/14/2014 - Updated to 1.0.2
- --- Fixed bug fix.
- -- Updated 10/14/2014 - Updated to 1.0.3
- --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
- local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
- local function CallOnChildren(Instance, FunctionToCall)
- -- Calls a function on each of the children of a certain object, using recursion.
- FunctionToCall(Instance)
- for _, Child in next, Instance:GetChildren() do
- CallOnChildren(Child, FunctionToCall)
- end
- end
- local function GetNearestParent(Instance, ClassName)
- -- Returns the nearest parent of a certain class, or returns nil
- local Ancestor = Instance
- repeat
- Ancestor = Ancestor.Parent
- if Ancestor == nil then
- return nil
- end
- until Ancestor:IsA(ClassName)
- return Ancestor
- end
- local function GetBricks(StartInstance)
- local List = {}
- -- if StartInstance:IsA("BasePart") then
- -- List[#List+1] = StartInstance
- -- end
- CallOnChildren(StartInstance, function(Item)
- if Item:IsA("BasePart") then
- List[#List+1] = Item;
- end
- end)
- return List
- end
- local function Modify(Instance, Values)
- -- Modifies an Instance by using a table.
- assert(type(Values) == "table", "Values is not a table");
- for Index, Value in next, Values do
- if type(Index) == "number" then
- Value.Parent = Instance
- else
- Instance[Index] = Value
- end
- end
- return Instance
- end
- local function Make(ClassType, Properties)
- -- Using a syntax hack to create a nice way to Make new items.
- return Modify(Instance.new(ClassType), Properties)
- end
- local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
- local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
- local function HasWheelJoint(Part)
- for _, SurfaceName in pairs(Surfaces) do
- for _, HingSurfaceName in pairs(HingSurfaces) do
- if Part[SurfaceName].Name == HingSurfaceName then
- return true
- end
- end
- end
- return false
- end
- local function ShouldBreakJoints(Part)
- --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
- -- definitely some edge cases.
- if NEVER_BREAK_JOINTS then
- return false
- end
- if HasWheelJoint(Part) then
- return false
- end
- local Connected = Part:GetConnectedParts()
- if #Connected == 1 then
- return false
- end
- for _, Item in pairs(Connected) do
- if HasWheelJoint(Item) then
- return false
- elseif not Item:IsDescendantOf(script.Parent) then
- return false
- end
- end
- return true
- end
- local function WeldTogether(Part0, Part1, JointType, WeldParent)
- --- Weld's 2 parts together
- -- @param Part0 The first part
- -- @param Part1 The second part (Dependent part most of the time).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
- -- @return The weld created.
- JointType = JointType or "Weld"
- local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
- local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
- Modify(NewWeld, {
- Name = "qCFrameWeldThingy";
- Part0 = Part0;
- Part1 = Part1;
- C0 = CFrame.new();--Part0.CFrame:inverse();
- C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
- Parent = Part1;
- })
- if not RelativeValue then
- RelativeValue = Make("CFrameValue", {
- Parent = Part1;
- Name = "qRelativeCFrameWeldValue";
- Archivable = true;
- Value = NewWeld.C1;
- })
- end
- return NewWeld
- end
- local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
- -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
- -- @param MainPart The part to weld the model to (can be in the model).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
- for _, Part in pairs(Parts) do
- if ShouldBreakJoints(Part) then
- Part:BreakJoints()
- end
- end
- for _, Part in pairs(Parts) do
- if Part ~= MainPart then
- WeldTogether(MainPart, Part, JointType, MainPart)
- end
- end
- if not DoNotUnanchor then
- for _, Part in pairs(Parts) do
- Part.Anchored = false
- end
- MainPart.Anchored = false
- end
- end
- local function PerfectionWeld()
- local Tool = GetNearestParent(script, "Tool")
- local Parts = GetBricks(script.Parent)
- local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
- if PrimaryPart then
- WeldParts(Parts, PrimaryPart, "Weld", false)
- else
- warn("qWeld - Unable to weld part")
- end
- return Tool
- end
- local Tool = PerfectionWeld()
- if Tool and script.ClassName == "Script" then
- --- Don't bother with local scripts
- script.Parent.AncestryChanged:connect(function()
- PerfectionWeld()
- end)
- end
- -- Created by Quenty (@Quenty, follow me on twitter).
- end))
- UnionOperation193.Parent = Model171
- UnionOperation193.CFrame = CFrame.new(266.682556, 162.777512, -66.6047058, -1.77512757e-05, 0.0870547071, -0.996203601, 1.35543223e-05, 0.996203542, 0.0870547071, 1, -1.19575316e-05, -1.88638533e-05)
- UnionOperation193.Orientation = Vector3.new(-4.98999977, -90, 0)
- UnionOperation193.Position = Vector3.new(266.682556, 162.777512, -66.6047058)
- UnionOperation193.Rotation = Vector3.new(-90.0099945, -85.0099945, -90.0099945)
- UnionOperation193.Color = Color3.new(1, 0, 0)
- UnionOperation193.Size = Vector3.new(20.9885483, 5.03980398, 5.56811333)
- UnionOperation193.Anchored = true
- UnionOperation193.BrickColor = BrickColor.new("Really red")
- UnionOperation193.CanCollide = false
- UnionOperation193.Material = Enum.Material.Neon
- UnionOperation193.brickColor = BrickColor.new("Really red")
- UnionOperation193.UsePartColor = true
- Script194.Parent = UnionOperation193
- table.insert(cors,sandbox(Script194,function()
- while true do
- wait(.000001)
- script.Parent.UsePartColor=true
- wait(.000001)
- script.Parent.UsePartColor=false
- end
- end))
- Model195.Name = "Bone"
- Model195.Parent = Model0
- Part196.Parent = Model195
- Part196.CFrame = CFrame.new(444.633484, 42.3201294, -51.2514801, 7.61404863e-06, -0.765985608, 0.64285785, -2.67270821e-07, -0.64285779, -0.765985608, 1, 5.66043445e-06, -5.09947677e-06)
- Part196.Orientation = Vector3.new(49.9899979, 90, -180)
- Part196.Position = Vector3.new(444.633484, 42.3201294, -51.2514801)
- Part196.Rotation = Vector3.new(90, 40.0099983, 90)
- Part196.Color = Color3.new(0, 1, 0)
- Part196.Transparency = 1
- Part196.Size = Vector3.new(10.7807922, 5.20451689, 38.2904015)
- Part196.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part196.BrickColor = BrickColor.new("Lime green")
- Part196.CanCollide = false
- Part196.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part196.Material = Enum.Material.Ice
- Part196.brickColor = BrickColor.new("Lime green")
- Part196.FormFactor = Enum.FormFactor.Custom
- Part196.formFactor = Enum.FormFactor.Custom
- Humanoid197.Parent = Part196
- Humanoid197.Health = 0
- Humanoid197.MaxHealth = 0
- Humanoid197.NameOcclusion = Enum.NameOcclusion.NoOcclusion
- Humanoid197.WalkSpeed = 10
- Humanoid197.maxHealth = 0
- Script198.Name = "Vaccine"
- Script198.Parent = Part196
- table.insert(cors,sandbox(Script198,function()
- function spread() -- created by culinwino3000
- local stuff = game.Workspace:GetChildren()
- for i = 1, #stuff do
- if (stuff[i].className ~= "Script") and (stuff[i]:findFirstChild("Vaccine") == nil) and (stuff[i].className ~= "Camera") then
- local clone = script:clone()
- clone.Parent = stuff[i]
- end
- end
- end
- while true do
- wait(.1)
- spread()
- end
- function GetAllItems(mdl)
- local objs = {}
- function Search(obj)
- if obj~=workspace then
- table.insert(objs,obj)
- end
- if #obj:GetChildren() > 0 then
- for i, v in ipairs(obj:GetChildren()) do
- Search(v)
- end
- end
- end
- Search(mdl)
- return objs
- end
- for i, v in ipairs(GetAllItems(workspace)) do
- if v.className == "Script" then
- if v.Name == "Chaotic" or v.Name == "Spreadify" or v.Name == "Virus" or v.Name == "Infected" then
- v.Parent = game.Lighting --Just in case it has a removal prevention.
- t = Instance.new("ObjectValue")
- t.Name = "IsAVirus"
- t.Parent = v
- end
- end
- end
- for i, v in ipairs(game.Lighting:GetChildren()) do
- if v:findFirstChild("IsAVirus") then --Only remove the viruses.
- v:remove()
- end
- end
- print("Virus debugged! All clean!")
- end))
- Script199.Parent = Part196
- table.insert(cors,sandbox(Script199,function()
- bin = script.Parent
- function move(target)
- local dir = (target.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- bin:findFirstChild("BodyGyro").cframe = CFrame.new(pos, pos + dir)
- bin:findFirstChild("BodyGyro").maxTorque = Vector3.new(9000,9000,9000)
- end
- function moveTo(target)
- bin.BodyPosition.position = target.Position
- bin.BodyPosition.maxForce = Vector3.new(10000,10000,10000) * bin.Speed.Value
- end
- function findNearestTorso(pos)
- local list = game.Workspace:GetChildren()
- local torso = nil
- local dist = 10000000000000000
- local temp = nil
- local human = nil
- local temp2 = nil
- for x = 1, #list do
- temp2 = list[x]
- if (temp2.className == "Model") and (temp2 ~= script.Parent) then
- temp = temp2:findFirstChild("Torso")
- human = temp2:findFirstChild("Humanoid")
- if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
- if (temp.Position - pos).magnitude < dist then
- torso = temp
- dist = (temp.Position - pos).magnitude
- end
- end
- end
- end
- return torso
- end
- function shoot(pos)
- dir = (pos - bin.CFrame.p).unit
- for i = 1, 50 do
- local ex = Instance.new("Explosion")
- ex.BlastRadius = 1
- ex.Position = bin.Position + (dir * 10 * i) + (dir * 7)
- ex.Parent = game.Workspace
- end
- end
- function shootAt(torso)
- local dir = (torso.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- shoot(pos)
- end
- while true do
- local torso = findNearestTorso(bin.Position)
- if torso~=nil then
- move(torso)
- moveTo(torso)
- end
- wait()
- end
- end))
- Script200.Parent = Part196
- table.insert(cors,sandbox(Script200,function()
- function onTouched(part)
- local h = part.Parent:findFirstChild("Humanoid")
- if h~=nil then
- h.Health = h.Health 100
- wait(1)
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- NumberValue201.Name = "Speed"
- NumberValue201.Parent = Part196
- NumberValue201.Value = 230
- BodyGyro202.Parent = Part196
- BodyGyro202.CFrame = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyGyro202.MaxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro202.maxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro202.cframe = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyPosition203.Parent = Part196
- BodyPosition203.Position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- BodyPosition203.MaxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition203.maxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition203.position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- UnionOperation204.Parent = Model195
- UnionOperation204.CFrame = CFrame.new(310.212097, 202.778717, -49.4455566, 0.64284879, 0.765993178, 3.61879065e-05, -0.765993118, 0.64284879, -2.29677639e-07, -2.34392846e-05, -2.75720413e-05, 1)
- UnionOperation204.Orientation = Vector3.new(0, 0, -50)
- UnionOperation204.Position = Vector3.new(310.212097, 202.778717, -49.4455566)
- UnionOperation204.Rotation = Vector3.new(0, 0, -50)
- UnionOperation204.Color = Color3.new(1, 0, 0)
- UnionOperation204.Size = Vector3.new(69.4595108, 10.037365, 29.4796295)
- UnionOperation204.BrickColor = BrickColor.new("Really red")
- UnionOperation204.CanCollide = false
- UnionOperation204.Material = Enum.Material.Neon
- UnionOperation204.brickColor = BrickColor.new("Really red")
- UnionOperation204.UsePartColor = true
- Script205.Parent = UnionOperation204
- table.insert(cors,sandbox(Script205,function()
- local debounce = false
- local HealthLoss = 10 -- Damage
- function OnTouched(Part)
- if Part.Parent ~= nil then
- if debounce == false and Part.Parent:findFirstChild("Humanoid") ~= nil then
- debounce = true
- Part.Parent:findFirstChild("Humanoid"):TakeDamage(HealthLoss)
- wait(0)
- debounce = false
- end
- end
- end
- script.Parent.Touched:connect(OnTouched)
- end))
- Script206.Name = "qPerfectionWeld"
- Script206.Parent = Model195
- table.insert(cors,sandbox(Script206,function()
- -- Created by Quenty (@Quenty, follow me on twitter).
- -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
- -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
- --[[ INSTRUCTIONS
- - Place in the model
- - Make sure model is anchored
- - That's it. It will weld the model and all children.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
- ]]
- --[[ DOCUMENTATION
- - Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
- - Will work in PBS servers
- - Will work as long as it starts out with the part anchored
- - Stores the relative CFrame as a CFrame value
- - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
- - Utilizes a recursive algorith to find all parts in the model
- - Will reweld on script reparent if the script is initially parented to a tool.
- - Welds as fast as possible
- ]]
- -- qPerfectionWeld.lua
- -- Created 10/6/2014
- -- Author: Quenty
- -- Version 1.0.3
- -- Updated 10/14/2014 - Updated to 1.0.1
- --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
- -- Updated 10/14/2014 - Updated to 1.0.2
- --- Fixed bug fix.
- -- Updated 10/14/2014 - Updated to 1.0.3
- --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
- local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
- local function CallOnChildren(Instance, FunctionToCall)
- -- Calls a function on each of the children of a certain object, using recursion.
- FunctionToCall(Instance)
- for _, Child in next, Instance:GetChildren() do
- CallOnChildren(Child, FunctionToCall)
- end
- end
- local function GetNearestParent(Instance, ClassName)
- -- Returns the nearest parent of a certain class, or returns nil
- local Ancestor = Instance
- repeat
- Ancestor = Ancestor.Parent
- if Ancestor == nil then
- return nil
- end
- until Ancestor:IsA(ClassName)
- return Ancestor
- end
- local function GetBricks(StartInstance)
- local List = {}
- -- if StartInstance:IsA("BasePart") then
- -- List[#List+1] = StartInstance
- -- end
- CallOnChildren(StartInstance, function(Item)
- if Item:IsA("BasePart") then
- List[#List+1] = Item;
- end
- end)
- return List
- end
- local function Modify(Instance, Values)
- -- Modifies an Instance by using a table.
- assert(type(Values) == "table", "Values is not a table");
- for Index, Value in next, Values do
- if type(Index) == "number" then
- Value.Parent = Instance
- else
- Instance[Index] = Value
- end
- end
- return Instance
- end
- local function Make(ClassType, Properties)
- -- Using a syntax hack to create a nice way to Make new items.
- return Modify(Instance.new(ClassType), Properties)
- end
- local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
- local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
- local function HasWheelJoint(Part)
- for _, SurfaceName in pairs(Surfaces) do
- for _, HingSurfaceName in pairs(HingSurfaces) do
- if Part[SurfaceName].Name == HingSurfaceName then
- return true
- end
- end
- end
- return false
- end
- local function ShouldBreakJoints(Part)
- --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
- -- definitely some edge cases.
- if NEVER_BREAK_JOINTS then
- return false
- end
- if HasWheelJoint(Part) then
- return false
- end
- local Connected = Part:GetConnectedParts()
- if #Connected == 1 then
- return false
- end
- for _, Item in pairs(Connected) do
- if HasWheelJoint(Item) then
- return false
- elseif not Item:IsDescendantOf(script.Parent) then
- return false
- end
- end
- return true
- end
- local function WeldTogether(Part0, Part1, JointType, WeldParent)
- --- Weld's 2 parts together
- -- @param Part0 The first part
- -- @param Part1 The second part (Dependent part most of the time).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
- -- @return The weld created.
- JointType = JointType or "Weld"
- local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
- local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
- Modify(NewWeld, {
- Name = "qCFrameWeldThingy";
- Part0 = Part0;
- Part1 = Part1;
- C0 = CFrame.new();--Part0.CFrame:inverse();
- C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
- Parent = Part1;
- })
- if not RelativeValue then
- RelativeValue = Make("CFrameValue", {
- Parent = Part1;
- Name = "qRelativeCFrameWeldValue";
- Archivable = true;
- Value = NewWeld.C1;
- })
- end
- return NewWeld
- end
- local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
- -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
- -- @param MainPart The part to weld the model to (can be in the model).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
- for _, Part in pairs(Parts) do
- if ShouldBreakJoints(Part) then
- Part:BreakJoints()
- end
- end
- for _, Part in pairs(Parts) do
- if Part ~= MainPart then
- WeldTogether(MainPart, Part, JointType, MainPart)
- end
- end
- if not DoNotUnanchor then
- for _, Part in pairs(Parts) do
- Part.Anchored = false
- end
- MainPart.Anchored = false
- end
- end
- local function PerfectionWeld()
- local Tool = GetNearestParent(script, "Tool")
- local Parts = GetBricks(script.Parent)
- local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
- if PrimaryPart then
- WeldParts(Parts, PrimaryPart, "Weld", false)
- else
- warn("qWeld - Unable to weld part")
- end
- return Tool
- end
- local Tool = PerfectionWeld()
- if Tool and script.ClassName == "Script" then
- --- Don't bother with local scripts
- script.Parent.AncestryChanged:connect(function()
- PerfectionWeld()
- end)
- end
- -- Created by Quenty (@Quenty, follow me on twitter).
- end))
- UnionOperation207.Name = "Head"
- UnionOperation207.Parent = Model195
- UnionOperation207.CFrame = CFrame.new(307.984436, 204.175674, -49.8986053, -0.642508924, 0.766278207, -3.59768746e-05, 0.766278148, 0.642508924, -0.000280174136, -0.000191575848, -0.000207582663, -1)
- UnionOperation207.Orientation = Vector3.new(0.0199999996, -180, 50.0200005)
- UnionOperation207.Position = Vector3.new(307.984436, 204.175674, -49.8986053)
- UnionOperation207.Rotation = Vector3.new(179.979996, 0, -129.979996)
- UnionOperation207.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- UnionOperation207.Transparency = 1
- UnionOperation207.Size = Vector3.new(10.0730858, 8.88804531, 12.8457394)
- UnionOperation207.BrickColor = BrickColor.new("Really black")
- UnionOperation207.CanCollide = false
- UnionOperation207.Material = Enum.Material.Cobblestone
- UnionOperation207.brickColor = BrickColor.new("Really black")
- UnionOperation207.UsePartColor = true
- BodyPosition208.Parent = UnionOperation207
- BodyPosition208.Position = Vector3.new(0, 10, 0)
- BodyPosition208.MaxForce = Vector3.new(0, 2.09999995e+10, 0)
- BodyPosition208.maxForce = Vector3.new(0, 2.09999995e+10, 0)
- BodyPosition208.position = Vector3.new(0, 10, 0)
- Model209.Name = "Bone"
- Model209.Parent = Model0
- Part210.Parent = Model209
- Part210.CFrame = CFrame.new(444.637085, 42.3201141, 36.1492767, 7.61404863e-06, -0.765985608, 0.64285785, -2.67270821e-07, -0.64285779, -0.765985608, 1, 5.66043445e-06, -5.09947677e-06)
- Part210.Orientation = Vector3.new(49.9899979, 90, -180)
- Part210.Position = Vector3.new(444.637085, 42.3201141, 36.1492767)
- Part210.Rotation = Vector3.new(90, 40.0099983, 90)
- Part210.Color = Color3.new(0, 1, 0)
- Part210.Transparency = 1
- Part210.Size = Vector3.new(10.7807922, 5.20451689, 38.2904015)
- Part210.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part210.BrickColor = BrickColor.new("Lime green")
- Part210.CanCollide = false
- Part210.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part210.Material = Enum.Material.Ice
- Part210.brickColor = BrickColor.new("Lime green")
- Part210.FormFactor = Enum.FormFactor.Custom
- Part210.formFactor = Enum.FormFactor.Custom
- Humanoid211.Parent = Part210
- Humanoid211.Health = 0
- Humanoid211.MaxHealth = 0
- Humanoid211.NameOcclusion = Enum.NameOcclusion.NoOcclusion
- Humanoid211.WalkSpeed = 10
- Humanoid211.maxHealth = 0
- Script212.Name = "Vaccine"
- Script212.Parent = Part210
- table.insert(cors,sandbox(Script212,function()
- function spread() -- created by culinwino3000
- local stuff = game.Workspace:GetChildren()
- for i = 1, #stuff do
- if (stuff[i].className ~= "Script") and (stuff[i]:findFirstChild("Vaccine") == nil) and (stuff[i].className ~= "Camera") then
- local clone = script:clone()
- clone.Parent = stuff[i]
- end
- end
- end
- while true do
- wait(.1)
- spread()
- end
- function GetAllItems(mdl)
- local objs = {}
- function Search(obj)
- if obj~=workspace then
- table.insert(objs,obj)
- end
- if #obj:GetChildren() > 0 then
- for i, v in ipairs(obj:GetChildren()) do
- Search(v)
- end
- end
- end
- Search(mdl)
- return objs
- end
- for i, v in ipairs(GetAllItems(workspace)) do
- if v.className == "Script" then
- if v.Name == "Chaotic" or v.Name == "Spreadify" or v.Name == "Virus" or v.Name == "Infected" then
- v.Parent = game.Lighting --Just in case it has a removal prevention.
- t = Instance.new("ObjectValue")
- t.Name = "IsAVirus"
- t.Parent = v
- end
- end
- end
- for i, v in ipairs(game.Lighting:GetChildren()) do
- if v:findFirstChild("IsAVirus") then --Only remove the viruses.
- v:remove()
- end
- end
- print("Virus debugged! All clean!")
- end))
- Script213.Parent = Part210
- table.insert(cors,sandbox(Script213,function()
- bin = script.Parent
- function move(target)
- local dir = (target.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- bin:findFirstChild("BodyGyro").cframe = CFrame.new(pos, pos + dir)
- bin:findFirstChild("BodyGyro").maxTorque = Vector3.new(9000,9000,9000)
- end
- function moveTo(target)
- bin.BodyPosition.position = target.Position
- bin.BodyPosition.maxForce = Vector3.new(10000,10000,10000) * bin.Speed.Value
- end
- function findNearestTorso(pos)
- local list = game.Workspace:GetChildren()
- local torso = nil
- local dist = 10000000000000000
- local temp = nil
- local human = nil
- local temp2 = nil
- for x = 1, #list do
- temp2 = list[x]
- if (temp2.className == "Model") and (temp2 ~= script.Parent) then
- temp = temp2:findFirstChild("Torso")
- human = temp2:findFirstChild("Humanoid")
- if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
- if (temp.Position - pos).magnitude < dist then
- torso = temp
- dist = (temp.Position - pos).magnitude
- end
- end
- end
- end
- return torso
- end
- function shoot(pos)
- dir = (pos - bin.CFrame.p).unit
- for i = 1, 50 do
- local ex = Instance.new("Explosion")
- ex.BlastRadius = 1
- ex.Position = bin.Position + (dir * 10 * i) + (dir * 7)
- ex.Parent = game.Workspace
- end
- end
- function shootAt(torso)
- local dir = (torso.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- shoot(pos)
- end
- while true do
- local torso = findNearestTorso(bin.Position)
- if torso~=nil then
- move(torso)
- moveTo(torso)
- end
- wait()
- end
- end))
- Script214.Parent = Part210
- table.insert(cors,sandbox(Script214,function()
- function onTouched(part)
- local h = part.Parent:findFirstChild("Humanoid")
- if h~=nil then
- h.Health = h.Health 100
- wait(1)
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- NumberValue215.Name = "Speed"
- NumberValue215.Parent = Part210
- NumberValue215.Value = 210
- BodyGyro216.Parent = Part210
- BodyGyro216.CFrame = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyGyro216.MaxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro216.maxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro216.cframe = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyPosition217.Parent = Part210
- BodyPosition217.Position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- BodyPosition217.MaxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition217.maxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition217.position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- UnionOperation218.Parent = Model209
- UnionOperation218.CFrame = CFrame.new(310.215759, 202.778687, 37.9551392, 0.64284879, 0.765993178, 3.61879065e-05, -0.765993118, 0.64284879, -2.29677639e-07, -2.34392846e-05, -2.75720413e-05, 1)
- UnionOperation218.Orientation = Vector3.new(0, 0, -50)
- UnionOperation218.Position = Vector3.new(310.215759, 202.778687, 37.9551392)
- UnionOperation218.Rotation = Vector3.new(0, 0, -50)
- UnionOperation218.Color = Color3.new(1, 0, 0)
- UnionOperation218.Size = Vector3.new(69.4595108, 10.037365, 29.4796295)
- UnionOperation218.BrickColor = BrickColor.new("Really red")
- UnionOperation218.CanCollide = false
- UnionOperation218.Material = Enum.Material.Neon
- UnionOperation218.brickColor = BrickColor.new("Really red")
- UnionOperation218.UsePartColor = true
- Script219.Parent = UnionOperation218
- table.insert(cors,sandbox(Script219,function()
- local debounce = false
- local HealthLoss = 10 -- Damage
- function OnTouched(Part)
- if Part.Parent ~= nil then
- if debounce == false and Part.Parent:findFirstChild("Humanoid") ~= nil then
- debounce = true
- Part.Parent:findFirstChild("Humanoid"):TakeDamage(HealthLoss)
- wait(0)
- debounce = false
- end
- end
- end
- script.Parent.Touched:connect(OnTouched)
- end))
- Script220.Name = "qPerfectionWeld"
- Script220.Parent = Model209
- table.insert(cors,sandbox(Script220,function()
- -- Created by Quenty (@Quenty, follow me on twitter).
- -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
- -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
- --[[ INSTRUCTIONS
- - Place in the model
- - Make sure model is anchored
- - That's it. It will weld the model and all children.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
- ]]
- --[[ DOCUMENTATION
- - Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
- - Will work in PBS servers
- - Will work as long as it starts out with the part anchored
- - Stores the relative CFrame as a CFrame value
- - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
- - Utilizes a recursive algorith to find all parts in the model
- - Will reweld on script reparent if the script is initially parented to a tool.
- - Welds as fast as possible
- ]]
- -- qPerfectionWeld.lua
- -- Created 10/6/2014
- -- Author: Quenty
- -- Version 1.0.3
- -- Updated 10/14/2014 - Updated to 1.0.1
- --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
- -- Updated 10/14/2014 - Updated to 1.0.2
- --- Fixed bug fix.
- -- Updated 10/14/2014 - Updated to 1.0.3
- --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
- local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
- local function CallOnChildren(Instance, FunctionToCall)
- -- Calls a function on each of the children of a certain object, using recursion.
- FunctionToCall(Instance)
- for _, Child in next, Instance:GetChildren() do
- CallOnChildren(Child, FunctionToCall)
- end
- end
- local function GetNearestParent(Instance, ClassName)
- -- Returns the nearest parent of a certain class, or returns nil
- local Ancestor = Instance
- repeat
- Ancestor = Ancestor.Parent
- if Ancestor == nil then
- return nil
- end
- until Ancestor:IsA(ClassName)
- return Ancestor
- end
- local function GetBricks(StartInstance)
- local List = {}
- -- if StartInstance:IsA("BasePart") then
- -- List[#List+1] = StartInstance
- -- end
- CallOnChildren(StartInstance, function(Item)
- if Item:IsA("BasePart") then
- List[#List+1] = Item;
- end
- end)
- return List
- end
- local function Modify(Instance, Values)
- -- Modifies an Instance by using a table.
- assert(type(Values) == "table", "Values is not a table");
- for Index, Value in next, Values do
- if type(Index) == "number" then
- Value.Parent = Instance
- else
- Instance[Index] = Value
- end
- end
- return Instance
- end
- local function Make(ClassType, Properties)
- -- Using a syntax hack to create a nice way to Make new items.
- return Modify(Instance.new(ClassType), Properties)
- end
- local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
- local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
- local function HasWheelJoint(Part)
- for _, SurfaceName in pairs(Surfaces) do
- for _, HingSurfaceName in pairs(HingSurfaces) do
- if Part[SurfaceName].Name == HingSurfaceName then
- return true
- end
- end
- end
- return false
- end
- local function ShouldBreakJoints(Part)
- --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
- -- definitely some edge cases.
- if NEVER_BREAK_JOINTS then
- return false
- end
- if HasWheelJoint(Part) then
- return false
- end
- local Connected = Part:GetConnectedParts()
- if #Connected == 1 then
- return false
- end
- for _, Item in pairs(Connected) do
- if HasWheelJoint(Item) then
- return false
- elseif not Item:IsDescendantOf(script.Parent) then
- return false
- end
- end
- return true
- end
- local function WeldTogether(Part0, Part1, JointType, WeldParent)
- --- Weld's 2 parts together
- -- @param Part0 The first part
- -- @param Part1 The second part (Dependent part most of the time).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
- -- @return The weld created.
- JointType = JointType or "Weld"
- local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
- local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
- Modify(NewWeld, {
- Name = "qCFrameWeldThingy";
- Part0 = Part0;
- Part1 = Part1;
- C0 = CFrame.new();--Part0.CFrame:inverse();
- C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
- Parent = Part1;
- })
- if not RelativeValue then
- RelativeValue = Make("CFrameValue", {
- Parent = Part1;
- Name = "qRelativeCFrameWeldValue";
- Archivable = true;
- Value = NewWeld.C1;
- })
- end
- return NewWeld
- end
- local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
- -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
- -- @param MainPart The part to weld the model to (can be in the model).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
- for _, Part in pairs(Parts) do
- if ShouldBreakJoints(Part) then
- Part:BreakJoints()
- end
- end
- for _, Part in pairs(Parts) do
- if Part ~= MainPart then
- WeldTogether(MainPart, Part, JointType, MainPart)
- end
- end
- if not DoNotUnanchor then
- for _, Part in pairs(Parts) do
- Part.Anchored = false
- end
- MainPart.Anchored = false
- end
- end
- local function PerfectionWeld()
- local Tool = GetNearestParent(script, "Tool")
- local Parts = GetBricks(script.Parent)
- local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
- if PrimaryPart then
- WeldParts(Parts, PrimaryPart, "Weld", false)
- else
- warn("qWeld - Unable to weld part")
- end
- return Tool
- end
- local Tool = PerfectionWeld()
- if Tool and script.ClassName == "Script" then
- --- Don't bother with local scripts
- script.Parent.AncestryChanged:connect(function()
- PerfectionWeld()
- end)
- end
- -- Created by Quenty (@Quenty, follow me on twitter).
- end))
- UnionOperation221.Name = "Head"
- UnionOperation221.Parent = Model209
- UnionOperation221.CFrame = CFrame.new(307.988037, 204.175644, 37.5021591, -0.642508924, 0.766278207, -3.59768746e-05, 0.766278148, 0.642508924, -0.000280174136, -0.000191575848, -0.000207582663, -1)
- UnionOperation221.Orientation = Vector3.new(0.0199999996, -180, 50.0200005)
- UnionOperation221.Position = Vector3.new(307.988037, 204.175644, 37.5021591)
- UnionOperation221.Rotation = Vector3.new(179.979996, 0, -129.979996)
- UnionOperation221.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- UnionOperation221.Transparency = 1
- UnionOperation221.Size = Vector3.new(10.0730858, 8.88804531, 12.8457394)
- UnionOperation221.BrickColor = BrickColor.new("Really black")
- UnionOperation221.CanCollide = false
- UnionOperation221.Material = Enum.Material.Cobblestone
- UnionOperation221.brickColor = BrickColor.new("Really black")
- UnionOperation221.UsePartColor = true
- BodyPosition222.Parent = UnionOperation221
- BodyPosition222.Position = Vector3.new(0, 10, 0)
- BodyPosition222.MaxForce = Vector3.new(0, 2.09999995e+10, 0)
- BodyPosition222.maxForce = Vector3.new(0, 2.09999995e+10, 0)
- BodyPosition222.position = Vector3.new(0, 10, 0)
- Model223.Name = "Bone"
- Model223.Parent = Model0
- Part224.Parent = Model223
- Part224.CFrame = CFrame.new(339.13147, 168.079651, -37.0154343, 7.61404863e-06, -0.765985608, 0.64285785, -2.67270821e-07, -0.64285779, -0.765985608, 1, 5.66043445e-06, -5.09947677e-06)
- Part224.Orientation = Vector3.new(49.9899979, 90, -180)
- Part224.Position = Vector3.new(339.13147, 168.079651, -37.0154343)
- Part224.Rotation = Vector3.new(90, 40.0099983, 90)
- Part224.Color = Color3.new(0, 1, 0)
- Part224.Transparency = 1
- Part224.Size = Vector3.new(5.79999971, 2.79999804, 20.6000004)
- Part224.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part224.BrickColor = BrickColor.new("Lime green")
- Part224.CanCollide = false
- Part224.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part224.Material = Enum.Material.Ice
- Part224.brickColor = BrickColor.new("Lime green")
- Part224.FormFactor = Enum.FormFactor.Custom
- Part224.formFactor = Enum.FormFactor.Custom
- Humanoid225.Parent = Part224
- Humanoid225.Health = 0
- Humanoid225.MaxHealth = 0
- Humanoid225.NameOcclusion = Enum.NameOcclusion.NoOcclusion
- Humanoid225.WalkSpeed = 10
- Humanoid225.maxHealth = 0
- Script226.Name = "Vaccine"
- Script226.Parent = Part224
- table.insert(cors,sandbox(Script226,function()
- function spread() -- created by culinwino3000
- local stuff = game.Workspace:GetChildren()
- for i = 1, #stuff do
- if (stuff[i].className ~= "Script") and (stuff[i]:findFirstChild("Vaccine") == nil) and (stuff[i].className ~= "Camera") then
- local clone = script:clone()
- clone.Parent = stuff[i]
- end
- end
- end
- while true do
- wait(.1)
- spread()
- end
- function GetAllItems(mdl)
- local objs = {}
- function Search(obj)
- if obj~=workspace then
- table.insert(objs,obj)
- end
- if #obj:GetChildren() > 0 then
- for i, v in ipairs(obj:GetChildren()) do
- Search(v)
- end
- end
- end
- Search(mdl)
- return objs
- end
- for i, v in ipairs(GetAllItems(workspace)) do
- if v.className == "Script" then
- if v.Name == "Chaotic" or v.Name == "Spreadify" or v.Name == "Virus" or v.Name == "Infected" then
- v.Parent = game.Lighting --Just in case it has a removal prevention.
- t = Instance.new("ObjectValue")
- t.Name = "IsAVirus"
- t.Parent = v
- end
- end
- end
- for i, v in ipairs(game.Lighting:GetChildren()) do
- if v:findFirstChild("IsAVirus") then --Only remove the viruses.
- v:remove()
- end
- end
- print("Virus debugged! All clean!")
- end))
- Script227.Parent = Part224
- table.insert(cors,sandbox(Script227,function()
- bin = script.Parent
- function move(target)
- local dir = (target.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- bin:findFirstChild("BodyGyro").cframe = CFrame.new(pos, pos + dir)
- bin:findFirstChild("BodyGyro").maxTorque = Vector3.new(9000,9000,9000)
- end
- function moveTo(target)
- bin.BodyPosition.position = target.Position
- bin.BodyPosition.maxForce = Vector3.new(10000,10000,10000) * bin.Speed.Value
- end
- function findNearestTorso(pos)
- local list = game.Workspace:GetChildren()
- local torso = nil
- local dist = 10000000000000000
- local temp = nil
- local human = nil
- local temp2 = nil
- for x = 1, #list do
- temp2 = list[x]
- if (temp2.className == "Model") and (temp2 ~= script.Parent) then
- temp = temp2:findFirstChild("Torso")
- human = temp2:findFirstChild("Humanoid")
- if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
- if (temp.Position - pos).magnitude < dist then
- torso = temp
- dist = (temp.Position - pos).magnitude
- end
- end
- end
- end
- return torso
- end
- function shoot(pos)
- dir = (pos - bin.CFrame.p).unit
- for i = 1, 50 do
- local ex = Instance.new("Explosion")
- ex.BlastRadius = 1
- ex.Position = bin.Position + (dir * 10 * i) + (dir * 7)
- ex.Parent = game.Workspace
- end
- end
- function shootAt(torso)
- local dir = (torso.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- shoot(pos)
- end
- while true do
- local torso = findNearestTorso(bin.Position)
- if torso~=nil then
- move(torso)
- moveTo(torso)
- end
- wait()
- end
- end))
- Script228.Parent = Part224
- table.insert(cors,sandbox(Script228,function()
- function onTouched(part)
- local h = part.Parent:findFirstChild("Humanoid")
- if h~=nil then
- h.Health = h.Health 100
- wait(1)
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- NumberValue229.Name = "Speed"
- NumberValue229.Parent = Part224
- NumberValue229.Value = 60
- BodyGyro230.Parent = Part224
- BodyGyro230.CFrame = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyGyro230.MaxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro230.maxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro230.cframe = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyPosition231.Parent = Part224
- BodyPosition231.Position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- BodyPosition231.MaxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition231.maxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition231.position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- UnionOperation232.Parent = Model223
- UnionOperation232.CFrame = CFrame.new(266.813599, 254.405853, -36.0438766, 0.64284879, 0.765993178, 3.61879065e-05, -0.765993118, 0.64284879, -2.29677639e-07, -2.34392846e-05, -2.75720413e-05, 1)
- UnionOperation232.Orientation = Vector3.new(0, 0, -50)
- UnionOperation232.Position = Vector3.new(266.813599, 254.405853, -36.0438766)
- UnionOperation232.Rotation = Vector3.new(0, 0, -50)
- UnionOperation232.Color = Color3.new(0.972549, 0.972549, 0.972549)
- UnionOperation232.Size = Vector3.new(37.3687897, 5.40004063, 15.8598595)
- UnionOperation232.Anchored = true
- UnionOperation232.Material = Enum.Material.Marble
- UnionOperation232.UsePartColor = true
- Script233.Parent = UnionOperation232
- table.insert(cors,sandbox(Script233,function()
- local debounce = false
- local HealthLoss = 5 -- Damage
- function OnTouched(Part)
- if Part.Parent ~= nil then
- if debounce == false and Part.Parent:findFirstChild("Humanoid") ~= nil then
- debounce = true
- Part.Parent:findFirstChild("Humanoid"):TakeDamage(HealthLoss)
- wait(0)
- debounce = false
- end
- end
- end
- script.Parent.Touched:connect(OnTouched)
- end))
- Script234.Name = "qPerfectionWeld"
- Script234.Parent = Model223
- table.insert(cors,sandbox(Script234,function()
- -- Created by Quenty (@Quenty, follow me on twitter).
- -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
- -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
- --[[ INSTRUCTIONS
- - Place in the model
- - Make sure model is anchored
- - That's it. It will weld the model and all children.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
- ]]
- --[[ DOCUMENTATION
- - Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
- - Will work in PBS servers
- - Will work as long as it starts out with the part anchored
- - Stores the relative CFrame as a CFrame value
- - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
- - Utilizes a recursive algorith to find all parts in the model
- - Will reweld on script reparent if the script is initially parented to a tool.
- - Welds as fast as possible
- ]]
- -- qPerfectionWeld.lua
- -- Created 10/6/2014
- -- Author: Quenty
- -- Version 1.0.3
- -- Updated 10/14/2014 - Updated to 1.0.1
- --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
- -- Updated 10/14/2014 - Updated to 1.0.2
- --- Fixed bug fix.
- -- Updated 10/14/2014 - Updated to 1.0.3
- --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
- local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
- local function CallOnChildren(Instance, FunctionToCall)
- -- Calls a function on each of the children of a certain object, using recursion.
- FunctionToCall(Instance)
- for _, Child in next, Instance:GetChildren() do
- CallOnChildren(Child, FunctionToCall)
- end
- end
- local function GetNearestParent(Instance, ClassName)
- -- Returns the nearest parent of a certain class, or returns nil
- local Ancestor = Instance
- repeat
- Ancestor = Ancestor.Parent
- if Ancestor == nil then
- return nil
- end
- until Ancestor:IsA(ClassName)
- return Ancestor
- end
- local function GetBricks(StartInstance)
- local List = {}
- -- if StartInstance:IsA("BasePart") then
- -- List[#List+1] = StartInstance
- -- end
- CallOnChildren(StartInstance, function(Item)
- if Item:IsA("BasePart") then
- List[#List+1] = Item;
- end
- end)
- return List
- end
- local function Modify(Instance, Values)
- -- Modifies an Instance by using a table.
- assert(type(Values) == "table", "Values is not a table");
- for Index, Value in next, Values do
- if type(Index) == "number" then
- Value.Parent = Instance
- else
- Instance[Index] = Value
- end
- end
- return Instance
- end
- local function Make(ClassType, Properties)
- -- Using a syntax hack to create a nice way to Make new items.
- return Modify(Instance.new(ClassType), Properties)
- end
- local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
- local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
- local function HasWheelJoint(Part)
- for _, SurfaceName in pairs(Surfaces) do
- for _, HingSurfaceName in pairs(HingSurfaces) do
- if Part[SurfaceName].Name == HingSurfaceName then
- return true
- end
- end
- end
- return false
- end
- local function ShouldBreakJoints(Part)
- --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
- -- definitely some edge cases.
- if NEVER_BREAK_JOINTS then
- return false
- end
- if HasWheelJoint(Part) then
- return false
- end
- local Connected = Part:GetConnectedParts()
- if #Connected == 1 then
- return false
- end
- for _, Item in pairs(Connected) do
- if HasWheelJoint(Item) then
- return false
- elseif not Item:IsDescendantOf(script.Parent) then
- return false
- end
- end
- return true
- end
- local function WeldTogether(Part0, Part1, JointType, WeldParent)
- --- Weld's 2 parts together
- -- @param Part0 The first part
- -- @param Part1 The second part (Dependent part most of the time).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
- -- @return The weld created.
- JointType = JointType or "Weld"
- local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
- local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
- Modify(NewWeld, {
- Name = "qCFrameWeldThingy";
- Part0 = Part0;
- Part1 = Part1;
- C0 = CFrame.new();--Part0.CFrame:inverse();
- C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
- Parent = Part1;
- })
- if not RelativeValue then
- RelativeValue = Make("CFrameValue", {
- Parent = Part1;
- Name = "qRelativeCFrameWeldValue";
- Archivable = true;
- Value = NewWeld.C1;
- })
- end
- return NewWeld
- end
- local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
- -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
- -- @param MainPart The part to weld the model to (can be in the model).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
- for _, Part in pairs(Parts) do
- if ShouldBreakJoints(Part) then
- Part:BreakJoints()
- end
- end
- for _, Part in pairs(Parts) do
- if Part ~= MainPart then
- WeldTogether(MainPart, Part, JointType, MainPart)
- end
- end
- if not DoNotUnanchor then
- for _, Part in pairs(Parts) do
- Part.Anchored = false
- end
- MainPart.Anchored = false
- end
- end
- local function PerfectionWeld()
- local Tool = GetNearestParent(script, "Tool")
- local Parts = GetBricks(script.Parent)
- local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
- if PrimaryPart then
- WeldParts(Parts, PrimaryPart, "Weld", false)
- else
- warn("qWeld - Unable to weld part")
- end
- return Tool
- end
- local Tool = PerfectionWeld()
- if Tool and script.ClassName == "Script" then
- --- Don't bother with local scripts
- script.Parent.AncestryChanged:connect(function()
- PerfectionWeld()
- end)
- end
- -- Created by Quenty (@Quenty, follow me on twitter).
- end))
- UnionOperation235.Name = "Head"
- UnionOperation235.Parent = Model223
- UnionOperation235.CFrame = CFrame.new(265.615173, 255.157394, -36.2876282, -0.642508924, 0.766278207, -3.59768746e-05, 0.766278148, 0.642508924, -0.000280174136, -0.000191575848, -0.000207582663, -1)
- UnionOperation235.Orientation = Vector3.new(0.0199999996, -180, 50.0200005)
- UnionOperation235.Position = Vector3.new(265.615173, 255.157394, -36.2876282)
- UnionOperation235.Rotation = Vector3.new(179.979996, 0, -129.979996)
- UnionOperation235.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- UnionOperation235.Transparency = 1
- UnionOperation235.Size = Vector3.new(5.41925812, 4.78171349, 6.91092873)
- UnionOperation235.BrickColor = BrickColor.new("Really black")
- UnionOperation235.CanCollide = false
- UnionOperation235.Material = Enum.Material.Cobblestone
- UnionOperation235.brickColor = BrickColor.new("Really black")
- UnionOperation235.UsePartColor = true
- BodyPosition236.Parent = UnionOperation235
- BodyPosition236.Position = Vector3.new(0, 5, 0)
- BodyPosition236.MaxForce = Vector3.new(0, 2.09999995e+10, 0)
- BodyPosition236.maxForce = Vector3.new(0, 2.09999995e+10, 0)
- BodyPosition236.position = Vector3.new(0, 5, 0)
- Model237.Name = "Bone"
- Model237.Parent = Model0
- Part238.Parent = Model237
- Part238.CFrame = CFrame.new(325.633362, 184.164917, -6.61549377, 7.61404863e-06, -0.765985608, 0.64285785, -2.67270821e-07, -0.64285779, -0.765985608, 1, 5.66043445e-06, -5.09947677e-06)
- Part238.Orientation = Vector3.new(49.9899979, 90, -180)
- Part238.Position = Vector3.new(325.633362, 184.164917, -6.61549377)
- Part238.Rotation = Vector3.new(90, 40.0099983, 90)
- Part238.Color = Color3.new(0, 1, 0)
- Part238.Transparency = 1
- Part238.Size = Vector3.new(5.79999971, 2.79999804, 20.6000004)
- Part238.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part238.BrickColor = BrickColor.new("Lime green")
- Part238.CanCollide = false
- Part238.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part238.Material = Enum.Material.Ice
- Part238.brickColor = BrickColor.new("Lime green")
- Part238.FormFactor = Enum.FormFactor.Custom
- Part238.formFactor = Enum.FormFactor.Custom
- Humanoid239.Parent = Part238
- Humanoid239.Health = 0
- Humanoid239.MaxHealth = 0
- Humanoid239.NameOcclusion = Enum.NameOcclusion.NoOcclusion
- Humanoid239.WalkSpeed = 10
- Humanoid239.maxHealth = 0
- Script240.Name = "Vaccine"
- Script240.Parent = Part238
- table.insert(cors,sandbox(Script240,function()
- function spread() -- created by culinwino3000
- local stuff = game.Workspace:GetChildren()
- for i = 1, #stuff do
- if (stuff[i].className ~= "Script") and (stuff[i]:findFirstChild("Vaccine") == nil) and (stuff[i].className ~= "Camera") then
- local clone = script:clone()
- clone.Parent = stuff[i]
- end
- end
- end
- while true do
- wait(.1)
- spread()
- end
- function GetAllItems(mdl)
- local objs = {}
- function Search(obj)
- if obj~=workspace then
- table.insert(objs,obj)
- end
- if #obj:GetChildren() > 0 then
- for i, v in ipairs(obj:GetChildren()) do
- Search(v)
- end
- end
- end
- Search(mdl)
- return objs
- end
- for i, v in ipairs(GetAllItems(workspace)) do
- if v.className == "Script" then
- if v.Name == "Chaotic" or v.Name == "Spreadify" or v.Name == "Virus" or v.Name == "Infected" then
- v.Parent = game.Lighting --Just in case it has a removal prevention.
- t = Instance.new("ObjectValue")
- t.Name = "IsAVirus"
- t.Parent = v
- end
- end
- end
- for i, v in ipairs(game.Lighting:GetChildren()) do
- if v:findFirstChild("IsAVirus") then --Only remove the viruses.
- v:remove()
- end
- end
- print("Virus debugged! All clean!")
- end))
- Script241.Parent = Part238
- table.insert(cors,sandbox(Script241,function()
- bin = script.Parent
- function move(target)
- local dir = (target.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- bin:findFirstChild("BodyGyro").cframe = CFrame.new(pos, pos + dir)
- bin:findFirstChild("BodyGyro").maxTorque = Vector3.new(9000,9000,9000)
- end
- function moveTo(target)
- bin.BodyPosition.position = target.Position
- bin.BodyPosition.maxForce = Vector3.new(10000,10000,10000) * bin.Speed.Value
- end
- function findNearestTorso(pos)
- local list = game.Workspace:GetChildren()
- local torso = nil
- local dist = 10000000000000000
- local temp = nil
- local human = nil
- local temp2 = nil
- for x = 1, #list do
- temp2 = list[x]
- if (temp2.className == "Model") and (temp2 ~= script.Parent) then
- temp = temp2:findFirstChild("Torso")
- human = temp2:findFirstChild("Humanoid")
- if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
- if (temp.Position - pos).magnitude < dist then
- torso = temp
- dist = (temp.Position - pos).magnitude
- end
- end
- end
- end
- return torso
- end
- function shoot(pos)
- dir = (pos - bin.CFrame.p).unit
- for i = 1, 50 do
- local ex = Instance.new("Explosion")
- ex.BlastRadius = 1
- ex.Position = bin.Position + (dir * 10 * i) + (dir * 7)
- ex.Parent = game.Workspace
- end
- end
- function shootAt(torso)
- local dir = (torso.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- shoot(pos)
- end
- while true do
- local torso = findNearestTorso(bin.Position)
- if torso~=nil then
- move(torso)
- moveTo(torso)
- end
- wait()
- end
- end))
- Script242.Parent = Part238
- table.insert(cors,sandbox(Script242,function()
- function onTouched(part)
- local h = part.Parent:findFirstChild("Humanoid")
- if h~=nil then
- h.Health = h.Health 100
- wait(1)
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- NumberValue243.Name = "Speed"
- NumberValue243.Parent = Part238
- NumberValue243.Value = 100
- BodyGyro244.Parent = Part238
- BodyGyro244.CFrame = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyGyro244.MaxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro244.maxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro244.cframe = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyPosition245.Parent = Part238
- BodyPosition245.Position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- BodyPosition245.MaxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition245.maxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition245.position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- UnionOperation246.Parent = Model237
- UnionOperation246.CFrame = CFrame.new(266.81488, 254.405853, -5.64367294, 0.64284879, 0.765993178, 3.61879065e-05, -0.765993118, 0.64284879, -2.29677639e-07, -2.34392846e-05, -2.75720413e-05, 1)
- UnionOperation246.Orientation = Vector3.new(0, 0, -50)
- UnionOperation246.Position = Vector3.new(266.81488, 254.405853, -5.64367294)
- UnionOperation246.Rotation = Vector3.new(0, 0, -50)
- UnionOperation246.Color = Color3.new(0.972549, 0.972549, 0.972549)
- UnionOperation246.Size = Vector3.new(37.3687897, 5.40004063, 15.8598595)
- UnionOperation246.Anchored = true
- UnionOperation246.Material = Enum.Material.Marble
- UnionOperation246.UsePartColor = true
- Script247.Parent = UnionOperation246
- table.insert(cors,sandbox(Script247,function()
- local debounce = false
- local HealthLoss = 5 -- Damage
- function OnTouched(Part)
- if Part.Parent ~= nil then
- if debounce == false and Part.Parent:findFirstChild("Humanoid") ~= nil then
- debounce = true
- Part.Parent:findFirstChild("Humanoid"):TakeDamage(HealthLoss)
- wait(0)
- debounce = false
- end
- end
- end
- script.Parent.Touched:connect(OnTouched)
- end))
- Script248.Name = "qPerfectionWeld"
- Script248.Parent = Model237
- table.insert(cors,sandbox(Script248,function()
- -- Created by Quenty (@Quenty, follow me on twitter).
- -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
- -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
- --[[ INSTRUCTIONS
- - Place in the model
- - Make sure model is anchored
- - That's it. It will weld the model and all children.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
- ]]
- --[[ DOCUMENTATION
- - Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
- - Will work in PBS servers
- - Will work as long as it starts out with the part anchored
- - Stores the relative CFrame as a CFrame value
- - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
- - Utilizes a recursive algorith to find all parts in the model
- - Will reweld on script reparent if the script is initially parented to a tool.
- - Welds as fast as possible
- ]]
- -- qPerfectionWeld.lua
- -- Created 10/6/2014
- -- Author: Quenty
- -- Version 1.0.3
- -- Updated 10/14/2014 - Updated to 1.0.1
- --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
- -- Updated 10/14/2014 - Updated to 1.0.2
- --- Fixed bug fix.
- -- Updated 10/14/2014 - Updated to 1.0.3
- --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
- local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
- local function CallOnChildren(Instance, FunctionToCall)
- -- Calls a function on each of the children of a certain object, using recursion.
- FunctionToCall(Instance)
- for _, Child in next, Instance:GetChildren() do
- CallOnChildren(Child, FunctionToCall)
- end
- end
- local function GetNearestParent(Instance, ClassName)
- -- Returns the nearest parent of a certain class, or returns nil
- local Ancestor = Instance
- repeat
- Ancestor = Ancestor.Parent
- if Ancestor == nil then
- return nil
- end
- until Ancestor:IsA(ClassName)
- return Ancestor
- end
- local function GetBricks(StartInstance)
- local List = {}
- -- if StartInstance:IsA("BasePart") then
- -- List[#List+1] = StartInstance
- -- end
- CallOnChildren(StartInstance, function(Item)
- if Item:IsA("BasePart") then
- List[#List+1] = Item;
- end
- end)
- return List
- end
- local function Modify(Instance, Values)
- -- Modifies an Instance by using a table.
- assert(type(Values) == "table", "Values is not a table");
- for Index, Value in next, Values do
- if type(Index) == "number" then
- Value.Parent = Instance
- else
- Instance[Index] = Value
- end
- end
- return Instance
- end
- local function Make(ClassType, Properties)
- -- Using a syntax hack to create a nice way to Make new items.
- return Modify(Instance.new(ClassType), Properties)
- end
- local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
- local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
- local function HasWheelJoint(Part)
- for _, SurfaceName in pairs(Surfaces) do
- for _, HingSurfaceName in pairs(HingSurfaces) do
- if Part[SurfaceName].Name == HingSurfaceName then
- return true
- end
- end
- end
- return false
- end
- local function ShouldBreakJoints(Part)
- --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
- -- definitely some edge cases.
- if NEVER_BREAK_JOINTS then
- return false
- end
- if HasWheelJoint(Part) then
- return false
- end
- local Connected = Part:GetConnectedParts()
- if #Connected == 1 then
- return false
- end
- for _, Item in pairs(Connected) do
- if HasWheelJoint(Item) then
- return false
- elseif not Item:IsDescendantOf(script.Parent) then
- return false
- end
- end
- return true
- end
- local function WeldTogether(Part0, Part1, JointType, WeldParent)
- --- Weld's 2 parts together
- -- @param Part0 The first part
- -- @param Part1 The second part (Dependent part most of the time).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
- -- @return The weld created.
- JointType = JointType or "Weld"
- local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
- local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
- Modify(NewWeld, {
- Name = "qCFrameWeldThingy";
- Part0 = Part0;
- Part1 = Part1;
- C0 = CFrame.new();--Part0.CFrame:inverse();
- C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
- Parent = Part1;
- })
- if not RelativeValue then
- RelativeValue = Make("CFrameValue", {
- Parent = Part1;
- Name = "qRelativeCFrameWeldValue";
- Archivable = true;
- Value = NewWeld.C1;
- })
- end
- return NewWeld
- end
- local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
- -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
- -- @param MainPart The part to weld the model to (can be in the model).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
- for _, Part in pairs(Parts) do
- if ShouldBreakJoints(Part) then
- Part:BreakJoints()
- end
- end
- for _, Part in pairs(Parts) do
- if Part ~= MainPart then
- WeldTogether(MainPart, Part, JointType, MainPart)
- end
- end
- if not DoNotUnanchor then
- for _, Part in pairs(Parts) do
- Part.Anchored = false
- end
- MainPart.Anchored = false
- end
- end
- local function PerfectionWeld()
- local Tool = GetNearestParent(script, "Tool")
- local Parts = GetBricks(script.Parent)
- local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
- if PrimaryPart then
- WeldParts(Parts, PrimaryPart, "Weld", false)
- else
- warn("qWeld - Unable to weld part")
- end
- return Tool
- end
- local Tool = PerfectionWeld()
- if Tool and script.ClassName == "Script" then
- --- Don't bother with local scripts
- script.Parent.AncestryChanged:connect(function()
- PerfectionWeld()
- end)
- end
- -- Created by Quenty (@Quenty, follow me on twitter).
- end))
- UnionOperation249.Name = "Head"
- UnionOperation249.Parent = Model237
- UnionOperation249.CFrame = CFrame.new(265.616455, 255.157394, -5.88742065, -0.642508924, 0.766278207, -3.59768746e-05, 0.766278148, 0.642508924, -0.000280174136, -0.000191575848, -0.000207582663, -1)
- UnionOperation249.Orientation = Vector3.new(0.0199999996, -180, 50.0200005)
- UnionOperation249.Position = Vector3.new(265.616455, 255.157394, -5.88742065)
- UnionOperation249.Rotation = Vector3.new(179.979996, 0, -129.979996)
- UnionOperation249.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- UnionOperation249.Transparency = 1
- UnionOperation249.Size = Vector3.new(5.41925812, 4.78171349, 6.91092873)
- UnionOperation249.BrickColor = BrickColor.new("Really black")
- UnionOperation249.CanCollide = false
- UnionOperation249.Material = Enum.Material.Cobblestone
- UnionOperation249.brickColor = BrickColor.new("Really black")
- UnionOperation249.UsePartColor = true
- BodyPosition250.Parent = UnionOperation249
- BodyPosition250.Position = Vector3.new(0, 5, 0)
- BodyPosition250.MaxForce = Vector3.new(0, 2.09999995e+10, 0)
- BodyPosition250.maxForce = Vector3.new(0, 2.09999995e+10, 0)
- BodyPosition250.position = Vector3.new(0, 5, 0)
- Model251.Name = "Bone"
- Model251.Parent = Model0
- Part252.Parent = Model251
- Part252.CFrame = CFrame.new(444.635315, 42.3201218, -7.05111313, 7.61404863e-06, -0.765985608, 0.64285785, -2.67270821e-07, -0.64285779, -0.765985608, 1, 5.66043445e-06, -5.09947677e-06)
- Part252.Orientation = Vector3.new(49.9899979, 90, -180)
- Part252.Position = Vector3.new(444.635315, 42.3201218, -7.05111313)
- Part252.Rotation = Vector3.new(90, 40.0099983, 90)
- Part252.Color = Color3.new(0, 1, 0)
- Part252.Transparency = 1
- Part252.Size = Vector3.new(10.7807922, 5.20451689, 38.2904015)
- Part252.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part252.BrickColor = BrickColor.new("Lime green")
- Part252.CanCollide = false
- Part252.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part252.Material = Enum.Material.Ice
- Part252.brickColor = BrickColor.new("Lime green")
- Part252.FormFactor = Enum.FormFactor.Custom
- Part252.formFactor = Enum.FormFactor.Custom
- Humanoid253.Parent = Part252
- Humanoid253.Health = 0
- Humanoid253.MaxHealth = 0
- Humanoid253.NameOcclusion = Enum.NameOcclusion.NoOcclusion
- Humanoid253.WalkSpeed = 10
- Humanoid253.maxHealth = 0
- Script254.Name = "Vaccine"
- Script254.Parent = Part252
- table.insert(cors,sandbox(Script254,function()
- function spread() -- created by culinwino3000
- local stuff = game.Workspace:GetChildren()
- for i = 1, #stuff do
- if (stuff[i].className ~= "Script") and (stuff[i]:findFirstChild("Vaccine") == nil) and (stuff[i].className ~= "Camera") then
- local clone = script:clone()
- clone.Parent = stuff[i]
- end
- end
- end
- while true do
- wait(.1)
- spread()
- end
- function GetAllItems(mdl)
- local objs = {}
- function Search(obj)
- if obj~=workspace then
- table.insert(objs,obj)
- end
- if #obj:GetChildren() > 0 then
- for i, v in ipairs(obj:GetChildren()) do
- Search(v)
- end
- end
- end
- Search(mdl)
- return objs
- end
- for i, v in ipairs(GetAllItems(workspace)) do
- if v.className == "Script" then
- if v.Name == "Chaotic" or v.Name == "Spreadify" or v.Name == "Virus" or v.Name == "Infected" then
- v.Parent = game.Lighting --Just in case it has a removal prevention.
- t = Instance.new("ObjectValue")
- t.Name = "IsAVirus"
- t.Parent = v
- end
- end
- end
- for i, v in ipairs(game.Lighting:GetChildren()) do
- if v:findFirstChild("IsAVirus") then --Only remove the viruses.
- v:remove()
- end
- end
- print("Virus debugged! All clean!")
- end))
- Script255.Parent = Part252
- table.insert(cors,sandbox(Script255,function()
- bin = script.Parent
- function move(target)
- local dir = (target.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- bin:findFirstChild("BodyGyro").cframe = CFrame.new(pos, pos + dir)
- bin:findFirstChild("BodyGyro").maxTorque = Vector3.new(9000,9000,9000)
- end
- function moveTo(target)
- bin.BodyPosition.position = target.Position
- bin.BodyPosition.maxForce = Vector3.new(10000,10000,10000) * bin.Speed.Value
- end
- function findNearestTorso(pos)
- local list = game.Workspace:GetChildren()
- local torso = nil
- local dist = 10000000000000000
- local temp = nil
- local human = nil
- local temp2 = nil
- for x = 1, #list do
- temp2 = list[x]
- if (temp2.className == "Model") and (temp2 ~= script.Parent) then
- temp = temp2:findFirstChild("Torso")
- human = temp2:findFirstChild("Humanoid")
- if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
- if (temp.Position - pos).magnitude < dist then
- torso = temp
- dist = (temp.Position - pos).magnitude
- end
- end
- end
- end
- return torso
- end
- function shoot(pos)
- dir = (pos - bin.CFrame.p).unit
- for i = 1, 50 do
- local ex = Instance.new("Explosion")
- ex.BlastRadius = 1
- ex.Position = bin.Position + (dir * 10 * i) + (dir * 7)
- ex.Parent = game.Workspace
- end
- end
- function shootAt(torso)
- local dir = (torso.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- shoot(pos)
- end
- while true do
- local torso = findNearestTorso(bin.Position)
- if torso~=nil then
- move(torso)
- moveTo(torso)
- end
- wait()
- end
- end))
- Script256.Parent = Part252
- table.insert(cors,sandbox(Script256,function()
- function onTouched(part)
- local h = part.Parent:findFirstChild("Humanoid")
- if h~=nil then
- h.Health = h.Health 100
- wait(1)
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- NumberValue257.Name = "Speed"
- NumberValue257.Parent = Part252
- NumberValue257.Value = 250
- BodyGyro258.Parent = Part252
- BodyGyro258.CFrame = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyGyro258.MaxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro258.maxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro258.cframe = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyPosition259.Parent = Part252
- BodyPosition259.Position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- BodyPosition259.MaxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition259.maxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition259.position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- UnionOperation260.Parent = Model251
- UnionOperation260.CFrame = CFrame.new(310.213928, 202.778702, -5.24515533, 0.64284879, 0.765993178, 3.61879065e-05, -0.765993118, 0.64284879, -2.29677639e-07, -2.34392846e-05, -2.75720413e-05, 1)
- UnionOperation260.Orientation = Vector3.new(0, 0, -50)
- UnionOperation260.Position = Vector3.new(310.213928, 202.778702, -5.24515533)
- UnionOperation260.Rotation = Vector3.new(0, 0, -50)
- UnionOperation260.Color = Color3.new(1, 0, 0)
- UnionOperation260.Size = Vector3.new(69.4595108, 10.037365, 29.4796295)
- UnionOperation260.BrickColor = BrickColor.new("Really red")
- UnionOperation260.CanCollide = false
- UnionOperation260.Material = Enum.Material.Neon
- UnionOperation260.brickColor = BrickColor.new("Really red")
- UnionOperation260.UsePartColor = true
- Script261.Parent = UnionOperation260
- table.insert(cors,sandbox(Script261,function()
- local debounce = false
- local HealthLoss = 10 -- Damage
- function OnTouched(Part)
- if Part.Parent ~= nil then
- if debounce == false and Part.Parent:findFirstChild("Humanoid") ~= nil then
- debounce = true
- Part.Parent:findFirstChild("Humanoid"):TakeDamage(HealthLoss)
- wait(0)
- debounce = false
- end
- end
- end
- script.Parent.Touched:connect(OnTouched)
- end))
- Script262.Name = "qPerfectionWeld"
- Script262.Parent = Model251
- table.insert(cors,sandbox(Script262,function()
- -- Created by Quenty (@Quenty, follow me on twitter).
- -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
- -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
- --[[ INSTRUCTIONS
- - Place in the model
- - Make sure model is anchored
- - That's it. It will weld the model and all children.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
- ]]
- --[[ DOCUMENTATION
- - Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
- - Will work in PBS servers
- - Will work as long as it starts out with the part anchored
- - Stores the relative CFrame as a CFrame value
- - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
- - Utilizes a recursive algorith to find all parts in the model
- - Will reweld on script reparent if the script is initially parented to a tool.
- - Welds as fast as possible
- ]]
- -- qPerfectionWeld.lua
- -- Created 10/6/2014
- -- Author: Quenty
- -- Version 1.0.3
- -- Updated 10/14/2014 - Updated to 1.0.1
- --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
- -- Updated 10/14/2014 - Updated to 1.0.2
- --- Fixed bug fix.
- -- Updated 10/14/2014 - Updated to 1.0.3
- --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
- local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
- local function CallOnChildren(Instance, FunctionToCall)
- -- Calls a function on each of the children of a certain object, using recursion.
- FunctionToCall(Instance)
- for _, Child in next, Instance:GetChildren() do
- CallOnChildren(Child, FunctionToCall)
- end
- end
- local function GetNearestParent(Instance, ClassName)
- -- Returns the nearest parent of a certain class, or returns nil
- local Ancestor = Instance
- repeat
- Ancestor = Ancestor.Parent
- if Ancestor == nil then
- return nil
- end
- until Ancestor:IsA(ClassName)
- return Ancestor
- end
- local function GetBricks(StartInstance)
- local List = {}
- -- if StartInstance:IsA("BasePart") then
- -- List[#List+1] = StartInstance
- -- end
- CallOnChildren(StartInstance, function(Item)
- if Item:IsA("BasePart") then
- List[#List+1] = Item;
- end
- end)
- return List
- end
- local function Modify(Instance, Values)
- -- Modifies an Instance by using a table.
- assert(type(Values) == "table", "Values is not a table");
- for Index, Value in next, Values do
- if type(Index) == "number" then
- Value.Parent = Instance
- else
- Instance[Index] = Value
- end
- end
- return Instance
- end
- local function Make(ClassType, Properties)
- -- Using a syntax hack to create a nice way to Make new items.
- return Modify(Instance.new(ClassType), Properties)
- end
- local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
- local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
- local function HasWheelJoint(Part)
- for _, SurfaceName in pairs(Surfaces) do
- for _, HingSurfaceName in pairs(HingSurfaces) do
- if Part[SurfaceName].Name == HingSurfaceName then
- return true
- end
- end
- end
- return false
- end
- local function ShouldBreakJoints(Part)
- --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
- -- definitely some edge cases.
- if NEVER_BREAK_JOINTS then
- return false
- end
- if HasWheelJoint(Part) then
- return false
- end
- local Connected = Part:GetConnectedParts()
- if #Connected == 1 then
- return false
- end
- for _, Item in pairs(Connected) do
- if HasWheelJoint(Item) then
- return false
- elseif not Item:IsDescendantOf(script.Parent) then
- return false
- end
- end
- return true
- end
- local function WeldTogether(Part0, Part1, JointType, WeldParent)
- --- Weld's 2 parts together
- -- @param Part0 The first part
- -- @param Part1 The second part (Dependent part most of the time).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
- -- @return The weld created.
- JointType = JointType or "Weld"
- local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
- local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
- Modify(NewWeld, {
- Name = "qCFrameWeldThingy";
- Part0 = Part0;
- Part1 = Part1;
- C0 = CFrame.new();--Part0.CFrame:inverse();
- C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
- Parent = Part1;
- })
- if not RelativeValue then
- RelativeValue = Make("CFrameValue", {
- Parent = Part1;
- Name = "qRelativeCFrameWeldValue";
- Archivable = true;
- Value = NewWeld.C1;
- })
- end
- return NewWeld
- end
- local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
- -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
- -- @param MainPart The part to weld the model to (can be in the model).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
- for _, Part in pairs(Parts) do
- if ShouldBreakJoints(Part) then
- Part:BreakJoints()
- end
- end
- for _, Part in pairs(Parts) do
- if Part ~= MainPart then
- WeldTogether(MainPart, Part, JointType, MainPart)
- end
- end
- if not DoNotUnanchor then
- for _, Part in pairs(Parts) do
- Part.Anchored = false
- end
- MainPart.Anchored = false
- end
- end
- local function PerfectionWeld()
- local Tool = GetNearestParent(script, "Tool")
- local Parts = GetBricks(script.Parent)
- local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
- if PrimaryPart then
- WeldParts(Parts, PrimaryPart, "Weld", false)
- else
- warn("qWeld - Unable to weld part")
- end
- return Tool
- end
- local Tool = PerfectionWeld()
- if Tool and script.ClassName == "Script" then
- --- Don't bother with local scripts
- script.Parent.AncestryChanged:connect(function()
- PerfectionWeld()
- end)
- end
- -- Created by Quenty (@Quenty, follow me on twitter).
- end))
- UnionOperation263.Name = "Head"
- UnionOperation263.Parent = Model251
- UnionOperation263.CFrame = CFrame.new(307.986267, 204.175659, -5.69826508, -0.642508924, 0.766278207, -3.59768746e-05, 0.766278148, 0.642508924, -0.000280174136, -0.000191575848, -0.000207582663, -1)
- UnionOperation263.Orientation = Vector3.new(0.0199999996, -180, 50.0200005)
- UnionOperation263.Position = Vector3.new(307.986267, 204.175659, -5.69826508)
- UnionOperation263.Rotation = Vector3.new(179.979996, 0, -129.979996)
- UnionOperation263.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- UnionOperation263.Transparency = 1
- UnionOperation263.Size = Vector3.new(10.0730858, 8.88804531, 12.8457394)
- UnionOperation263.BrickColor = BrickColor.new("Really black")
- UnionOperation263.CanCollide = false
- UnionOperation263.Material = Enum.Material.Cobblestone
- UnionOperation263.brickColor = BrickColor.new("Really black")
- UnionOperation263.UsePartColor = true
- BodyPosition264.Parent = UnionOperation263
- BodyPosition264.Position = Vector3.new(0, 10, 0)
- BodyPosition264.MaxForce = Vector3.new(0, 2.09999995e+10, 0)
- BodyPosition264.maxForce = Vector3.new(0, 2.09999995e+10, 0)
- BodyPosition264.position = Vector3.new(0, 10, 0)
- Model265.Name = "Bone"
- Model265.Parent = Model0
- Part266.Parent = Model265
- Part266.CFrame = CFrame.new(339.135193, 168.07962, 52.9853745, 7.61404863e-06, -0.765985608, 0.64285785, -2.67270821e-07, -0.64285779, -0.765985608, 1, 5.66043445e-06, -5.09947677e-06)
- Part266.Orientation = Vector3.new(49.9899979, 90, -180)
- Part266.Position = Vector3.new(339.135193, 168.07962, 52.9853745)
- Part266.Rotation = Vector3.new(90, 40.0099983, 90)
- Part266.Color = Color3.new(0, 1, 0)
- Part266.Transparency = 1
- Part266.Size = Vector3.new(5.79999971, 2.79999804, 20.6000004)
- Part266.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part266.BrickColor = BrickColor.new("Lime green")
- Part266.CanCollide = false
- Part266.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part266.Material = Enum.Material.Ice
- Part266.brickColor = BrickColor.new("Lime green")
- Part266.FormFactor = Enum.FormFactor.Custom
- Part266.formFactor = Enum.FormFactor.Custom
- Humanoid267.Parent = Part266
- Humanoid267.Health = 0
- Humanoid267.MaxHealth = 0
- Humanoid267.NameOcclusion = Enum.NameOcclusion.NoOcclusion
- Humanoid267.WalkSpeed = 10
- Humanoid267.maxHealth = 0
- Script268.Name = "Vaccine"
- Script268.Parent = Part266
- table.insert(cors,sandbox(Script268,function()
- function spread() -- created by culinwino3000
- local stuff = game.Workspace:GetChildren()
- for i = 1, #stuff do
- if (stuff[i].className ~= "Script") and (stuff[i]:findFirstChild("Vaccine") == nil) and (stuff[i].className ~= "Camera") then
- local clone = script:clone()
- clone.Parent = stuff[i]
- end
- end
- end
- while true do
- wait(.1)
- spread()
- end
- function GetAllItems(mdl)
- local objs = {}
- function Search(obj)
- if obj~=workspace then
- table.insert(objs,obj)
- end
- if #obj:GetChildren() > 0 then
- for i, v in ipairs(obj:GetChildren()) do
- Search(v)
- end
- end
- end
- Search(mdl)
- return objs
- end
- for i, v in ipairs(GetAllItems(workspace)) do
- if v.className == "Script" then
- if v.Name == "Chaotic" or v.Name == "Spreadify" or v.Name == "Virus" or v.Name == "Infected" then
- v.Parent = game.Lighting --Just in case it has a removal prevention.
- t = Instance.new("ObjectValue")
- t.Name = "IsAVirus"
- t.Parent = v
- end
- end
- end
- for i, v in ipairs(game.Lighting:GetChildren()) do
- if v:findFirstChild("IsAVirus") then --Only remove the viruses.
- v:remove()
- end
- end
- print("Virus debugged! All clean!")
- end))
- Script269.Parent = Part266
- table.insert(cors,sandbox(Script269,function()
- bin = script.Parent
- function move(target)
- local dir = (target.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- bin:findFirstChild("BodyGyro").cframe = CFrame.new(pos, pos + dir)
- bin:findFirstChild("BodyGyro").maxTorque = Vector3.new(9000,9000,9000)
- end
- function moveTo(target)
- bin.BodyPosition.position = target.Position
- bin.BodyPosition.maxForce = Vector3.new(10000,10000,10000) * bin.Speed.Value
- end
- function findNearestTorso(pos)
- local list = game.Workspace:GetChildren()
- local torso = nil
- local dist = 10000000000000000
- local temp = nil
- local human = nil
- local temp2 = nil
- for x = 1, #list do
- temp2 = list[x]
- if (temp2.className == "Model") and (temp2 ~= script.Parent) then
- temp = temp2:findFirstChild("Torso")
- human = temp2:findFirstChild("Humanoid")
- if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
- if (temp.Position - pos).magnitude < dist then
- torso = temp
- dist = (temp.Position - pos).magnitude
- end
- end
- end
- end
- return torso
- end
- function shoot(pos)
- dir = (pos - bin.CFrame.p).unit
- for i = 1, 50 do
- local ex = Instance.new("Explosion")
- ex.BlastRadius = 1
- ex.Position = bin.Position + (dir * 10 * i) + (dir * 7)
- ex.Parent = game.Workspace
- end
- end
- function shootAt(torso)
- local dir = (torso.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- shoot(pos)
- end
- while true do
- local torso = findNearestTorso(bin.Position)
- if torso~=nil then
- move(torso)
- moveTo(torso)
- end
- wait()
- end
- end))
- Script270.Parent = Part266
- table.insert(cors,sandbox(Script270,function()
- function onTouched(part)
- local h = part.Parent:findFirstChild("Humanoid")
- if h~=nil then
- h.Health = h.Health 100
- wait(1)
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- NumberValue271.Name = "Speed"
- NumberValue271.Parent = Part266
- NumberValue271.Value = 120
- BodyGyro272.Parent = Part266
- BodyGyro272.CFrame = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyGyro272.MaxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro272.maxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro272.cframe = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyPosition273.Parent = Part266
- BodyPosition273.Position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- BodyPosition273.MaxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition273.maxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition273.position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- UnionOperation274.Parent = Model265
- UnionOperation274.CFrame = CFrame.new(266.817383, 254.405838, 53.9568787, 0.64284879, 0.765993178, 3.61879065e-05, -0.765993118, 0.64284879, -2.29677639e-07, -2.34392846e-05, -2.75720413e-05, 1)
- UnionOperation274.Orientation = Vector3.new(0, 0, -50)
- UnionOperation274.Position = Vector3.new(266.817383, 254.405838, 53.9568787)
- UnionOperation274.Rotation = Vector3.new(0, 0, -50)
- UnionOperation274.Color = Color3.new(0.972549, 0.972549, 0.972549)
- UnionOperation274.Size = Vector3.new(37.3687897, 5.40004063, 15.8598595)
- UnionOperation274.Anchored = true
- UnionOperation274.Material = Enum.Material.Marble
- UnionOperation274.UsePartColor = true
- Script275.Parent = UnionOperation274
- table.insert(cors,sandbox(Script275,function()
- local debounce = false
- local HealthLoss = 5 -- Damage
- function OnTouched(Part)
- if Part.Parent ~= nil then
- if debounce == false and Part.Parent:findFirstChild("Humanoid") ~= nil then
- debounce = true
- Part.Parent:findFirstChild("Humanoid"):TakeDamage(HealthLoss)
- wait(0)
- debounce = false
- end
- end
- end
- script.Parent.Touched:connect(OnTouched)
- end))
- Script276.Name = "qPerfectionWeld"
- Script276.Parent = Model265
- table.insert(cors,sandbox(Script276,function()
- -- Created by Quenty (@Quenty, follow me on twitter).
- -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
- -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
- --[[ INSTRUCTIONS
- - Place in the model
- - Make sure model is anchored
- - That's it. It will weld the model and all children.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
- ]]
- --[[ DOCUMENTATION
- - Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
- - Will work in PBS servers
- - Will work as long as it starts out with the part anchored
- - Stores the relative CFrame as a CFrame value
- - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
- - Utilizes a recursive algorith to find all parts in the model
- - Will reweld on script reparent if the script is initially parented to a tool.
- - Welds as fast as possible
- ]]
- -- qPerfectionWeld.lua
- -- Created 10/6/2014
- -- Author: Quenty
- -- Version 1.0.3
- -- Updated 10/14/2014 - Updated to 1.0.1
- --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
- -- Updated 10/14/2014 - Updated to 1.0.2
- --- Fixed bug fix.
- -- Updated 10/14/2014 - Updated to 1.0.3
- --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
- local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
- local function CallOnChildren(Instance, FunctionToCall)
- -- Calls a function on each of the children of a certain object, using recursion.
- FunctionToCall(Instance)
- for _, Child in next, Instance:GetChildren() do
- CallOnChildren(Child, FunctionToCall)
- end
- end
- local function GetNearestParent(Instance, ClassName)
- -- Returns the nearest parent of a certain class, or returns nil
- local Ancestor = Instance
- repeat
- Ancestor = Ancestor.Parent
- if Ancestor == nil then
- return nil
- end
- until Ancestor:IsA(ClassName)
- return Ancestor
- end
- local function GetBricks(StartInstance)
- local List = {}
- -- if StartInstance:IsA("BasePart") then
- -- List[#List+1] = StartInstance
- -- end
- CallOnChildren(StartInstance, function(Item)
- if Item:IsA("BasePart") then
- List[#List+1] = Item;
- end
- end)
- return List
- end
- local function Modify(Instance, Values)
- -- Modifies an Instance by using a table.
- assert(type(Values) == "table", "Values is not a table");
- for Index, Value in next, Values do
- if type(Index) == "number" then
- Value.Parent = Instance
- else
- Instance[Index] = Value
- end
- end
- return Instance
- end
- local function Make(ClassType, Properties)
- -- Using a syntax hack to create a nice way to Make new items.
- return Modify(Instance.new(ClassType), Properties)
- end
- local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
- local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
- local function HasWheelJoint(Part)
- for _, SurfaceName in pairs(Surfaces) do
- for _, HingSurfaceName in pairs(HingSurfaces) do
- if Part[SurfaceName].Name == HingSurfaceName then
- return true
- end
- end
- end
- return false
- end
- local function ShouldBreakJoints(Part)
- --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
- -- definitely some edge cases.
- if NEVER_BREAK_JOINTS then
- return false
- end
- if HasWheelJoint(Part) then
- return false
- end
- local Connected = Part:GetConnectedParts()
- if #Connected == 1 then
- return false
- end
- for _, Item in pairs(Connected) do
- if HasWheelJoint(Item) then
- return false
- elseif not Item:IsDescendantOf(script.Parent) then
- return false
- end
- end
- return true
- end
- local function WeldTogether(Part0, Part1, JointType, WeldParent)
- --- Weld's 2 parts together
- -- @param Part0 The first part
- -- @param Part1 The second part (Dependent part most of the time).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
- -- @return The weld created.
- JointType = JointType or "Weld"
- local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
- local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
- Modify(NewWeld, {
- Name = "qCFrameWeldThingy";
- Part0 = Part0;
- Part1 = Part1;
- C0 = CFrame.new();--Part0.CFrame:inverse();
- C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
- Parent = Part1;
- })
- if not RelativeValue then
- RelativeValue = Make("CFrameValue", {
- Parent = Part1;
- Name = "qRelativeCFrameWeldValue";
- Archivable = true;
- Value = NewWeld.C1;
- })
- end
- return NewWeld
- end
- local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
- -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
- -- @param MainPart The part to weld the model to (can be in the model).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
- for _, Part in pairs(Parts) do
- if ShouldBreakJoints(Part) then
- Part:BreakJoints()
- end
- end
- for _, Part in pairs(Parts) do
- if Part ~= MainPart then
- WeldTogether(MainPart, Part, JointType, MainPart)
- end
- end
- if not DoNotUnanchor then
- for _, Part in pairs(Parts) do
- Part.Anchored = false
- end
- MainPart.Anchored = false
- end
- end
- local function PerfectionWeld()
- local Tool = GetNearestParent(script, "Tool")
- local Parts = GetBricks(script.Parent)
- local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
- if PrimaryPart then
- WeldParts(Parts, PrimaryPart, "Weld", false)
- else
- warn("qWeld - Unable to weld part")
- end
- return Tool
- end
- local Tool = PerfectionWeld()
- if Tool and script.ClassName == "Script" then
- --- Don't bother with local scripts
- script.Parent.AncestryChanged:connect(function()
- PerfectionWeld()
- end)
- end
- -- Created by Quenty (@Quenty, follow me on twitter).
- end))
- UnionOperation277.Name = "Head"
- UnionOperation277.Parent = Model265
- UnionOperation277.CFrame = CFrame.new(265.618896, 255.157364, 53.7131805, -0.642508924, 0.766278207, -3.59768746e-05, 0.766278148, 0.642508924, -0.000280174136, -0.000191575848, -0.000207582663, -1)
- UnionOperation277.Orientation = Vector3.new(0.0199999996, -180, 50.0200005)
- UnionOperation277.Position = Vector3.new(265.618896, 255.157364, 53.7131805)
- UnionOperation277.Rotation = Vector3.new(179.979996, 0, -129.979996)
- UnionOperation277.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- UnionOperation277.Transparency = 1
- UnionOperation277.Size = Vector3.new(5.41925812, 4.78171349, 6.91092873)
- UnionOperation277.BrickColor = BrickColor.new("Really black")
- UnionOperation277.CanCollide = false
- UnionOperation277.Material = Enum.Material.Cobblestone
- UnionOperation277.brickColor = BrickColor.new("Really black")
- UnionOperation277.UsePartColor = true
- BodyPosition278.Parent = UnionOperation277
- BodyPosition278.Position = Vector3.new(0, 5, 0)
- BodyPosition278.MaxForce = Vector3.new(0, 2.09999995e+10, 0)
- BodyPosition278.maxForce = Vector3.new(0, 2.09999995e+10, 0)
- BodyPosition278.position = Vector3.new(0, 5, 0)
- Model279.Name = "Bone"
- Model279.Parent = Model0
- Part280.Parent = Model279
- Part280.CFrame = CFrame.new(339.130127, 168.079651, -69.2157364, 7.61404863e-06, -0.765985608, 0.64285785, -2.67270821e-07, -0.64285779, -0.765985608, 1, 5.66043445e-06, -5.09947677e-06)
- Part280.Orientation = Vector3.new(49.9899979, 90, -180)
- Part280.Position = Vector3.new(339.130127, 168.079651, -69.2157364)
- Part280.Rotation = Vector3.new(90, 40.0099983, 90)
- Part280.Color = Color3.new(0, 1, 0)
- Part280.Transparency = 1
- Part280.Size = Vector3.new(5.79999971, 2.79999804, 20.6000004)
- Part280.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part280.BrickColor = BrickColor.new("Lime green")
- Part280.CanCollide = false
- Part280.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part280.Material = Enum.Material.Ice
- Part280.brickColor = BrickColor.new("Lime green")
- Part280.FormFactor = Enum.FormFactor.Custom
- Part280.formFactor = Enum.FormFactor.Custom
- Humanoid281.Parent = Part280
- Humanoid281.Health = 0
- Humanoid281.MaxHealth = 0
- Humanoid281.NameOcclusion = Enum.NameOcclusion.NoOcclusion
- Humanoid281.WalkSpeed = 10
- Humanoid281.maxHealth = 0
- Script282.Name = "Vaccine"
- Script282.Parent = Part280
- table.insert(cors,sandbox(Script282,function()
- function spread() -- created by culinwino3000
- local stuff = game.Workspace:GetChildren()
- for i = 1, #stuff do
- if (stuff[i].className ~= "Script") and (stuff[i]:findFirstChild("Vaccine") == nil) and (stuff[i].className ~= "Camera") then
- local clone = script:clone()
- clone.Parent = stuff[i]
- end
- end
- end
- while true do
- wait(.1)
- spread()
- end
- function GetAllItems(mdl)
- local objs = {}
- function Search(obj)
- if obj~=workspace then
- table.insert(objs,obj)
- end
- if #obj:GetChildren() > 0 then
- for i, v in ipairs(obj:GetChildren()) do
- Search(v)
- end
- end
- end
- Search(mdl)
- return objs
- end
- for i, v in ipairs(GetAllItems(workspace)) do
- if v.className == "Script" then
- if v.Name == "Chaotic" or v.Name == "Spreadify" or v.Name == "Virus" or v.Name == "Infected" then
- v.Parent = game.Lighting --Just in case it has a removal prevention.
- t = Instance.new("ObjectValue")
- t.Name = "IsAVirus"
- t.Parent = v
- end
- end
- end
- for i, v in ipairs(game.Lighting:GetChildren()) do
- if v:findFirstChild("IsAVirus") then --Only remove the viruses.
- v:remove()
- end
- end
- print("Virus debugged! All clean!")
- end))
- Script283.Parent = Part280
- table.insert(cors,sandbox(Script283,function()
- bin = script.Parent
- function move(target)
- local dir = (target.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- bin:findFirstChild("BodyGyro").cframe = CFrame.new(pos, pos + dir)
- bin:findFirstChild("BodyGyro").maxTorque = Vector3.new(9000,9000,9000)
- end
- function moveTo(target)
- bin.BodyPosition.position = target.Position
- bin.BodyPosition.maxForce = Vector3.new(10000,10000,10000) * bin.Speed.Value
- end
- function findNearestTorso(pos)
- local list = game.Workspace:GetChildren()
- local torso = nil
- local dist = 10000000000000000
- local temp = nil
- local human = nil
- local temp2 = nil
- for x = 1, #list do
- temp2 = list[x]
- if (temp2.className == "Model") and (temp2 ~= script.Parent) then
- temp = temp2:findFirstChild("Torso")
- human = temp2:findFirstChild("Humanoid")
- if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
- if (temp.Position - pos).magnitude < dist then
- torso = temp
- dist = (temp.Position - pos).magnitude
- end
- end
- end
- end
- return torso
- end
- function shoot(pos)
- dir = (pos - bin.CFrame.p).unit
- for i = 1, 50 do
- local ex = Instance.new("Explosion")
- ex.BlastRadius = 1
- ex.Position = bin.Position + (dir * 10 * i) + (dir * 7)
- ex.Parent = game.Workspace
- end
- end
- function shootAt(torso)
- local dir = (torso.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- shoot(pos)
- end
- while true do
- local torso = findNearestTorso(bin.Position)
- if torso~=nil then
- move(torso)
- moveTo(torso)
- end
- wait()
- end
- end))
- Script284.Parent = Part280
- table.insert(cors,sandbox(Script284,function()
- function onTouched(part)
- local h = part.Parent:findFirstChild("Humanoid")
- if h~=nil then
- h.Health = h.Health 100
- wait(1)
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- NumberValue285.Name = "Speed"
- NumberValue285.Parent = Part280
- NumberValue285.Value = 110
- BodyGyro286.Parent = Part280
- BodyGyro286.CFrame = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyGyro286.MaxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro286.maxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro286.cframe = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyPosition287.Parent = Part280
- BodyPosition287.Position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- BodyPosition287.MaxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition287.maxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition287.position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- UnionOperation288.Parent = Model279
- UnionOperation288.CFrame = CFrame.new(266.812256, 254.405869, -68.2441406, 0.64284879, 0.765993178, 3.61879065e-05, -0.765993118, 0.64284879, -2.29677639e-07, -2.34392846e-05, -2.75720413e-05, 1)
- UnionOperation288.Orientation = Vector3.new(0, 0, -50)
- UnionOperation288.Position = Vector3.new(266.812256, 254.405869, -68.2441406)
- UnionOperation288.Rotation = Vector3.new(0, 0, -50)
- UnionOperation288.Color = Color3.new(0.972549, 0.972549, 0.972549)
- UnionOperation288.Size = Vector3.new(37.3687897, 5.40004063, 15.8598595)
- UnionOperation288.Anchored = true
- UnionOperation288.Material = Enum.Material.Marble
- UnionOperation288.UsePartColor = true
- Script289.Parent = UnionOperation288
- table.insert(cors,sandbox(Script289,function()
- local debounce = false
- local HealthLoss = 5 -- Damage
- function OnTouched(Part)
- if Part.Parent ~= nil then
- if debounce == false and Part.Parent:findFirstChild("Humanoid") ~= nil then
- debounce = true
- Part.Parent:findFirstChild("Humanoid"):TakeDamage(HealthLoss)
- wait(0)
- debounce = false
- end
- end
- end
- script.Parent.Touched:connect(OnTouched)
- end))
- Script290.Name = "qPerfectionWeld"
- Script290.Parent = Model279
- table.insert(cors,sandbox(Script290,function()
- -- Created by Quenty (@Quenty, follow me on twitter).
- -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
- -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
- --[[ INSTRUCTIONS
- - Place in the model
- - Make sure model is anchored
- - That's it. It will weld the model and all children.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
- ]]
- --[[ DOCUMENTATION
- - Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
- - Will work in PBS servers
- - Will work as long as it starts out with the part anchored
- - Stores the relative CFrame as a CFrame value
- - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
- - Utilizes a recursive algorith to find all parts in the model
- - Will reweld on script reparent if the script is initially parented to a tool.
- - Welds as fast as possible
- ]]
- -- qPerfectionWeld.lua
- -- Created 10/6/2014
- -- Author: Quenty
- -- Version 1.0.3
- -- Updated 10/14/2014 - Updated to 1.0.1
- --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
- -- Updated 10/14/2014 - Updated to 1.0.2
- --- Fixed bug fix.
- -- Updated 10/14/2014 - Updated to 1.0.3
- --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
- local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
- local function CallOnChildren(Instance, FunctionToCall)
- -- Calls a function on each of the children of a certain object, using recursion.
- FunctionToCall(Instance)
- for _, Child in next, Instance:GetChildren() do
- CallOnChildren(Child, FunctionToCall)
- end
- end
- local function GetNearestParent(Instance, ClassName)
- -- Returns the nearest parent of a certain class, or returns nil
- local Ancestor = Instance
- repeat
- Ancestor = Ancestor.Parent
- if Ancestor == nil then
- return nil
- end
- until Ancestor:IsA(ClassName)
- return Ancestor
- end
- local function GetBricks(StartInstance)
- local List = {}
- -- if StartInstance:IsA("BasePart") then
- -- List[#List+1] = StartInstance
- -- end
- CallOnChildren(StartInstance, function(Item)
- if Item:IsA("BasePart") then
- List[#List+1] = Item;
- end
- end)
- return List
- end
- local function Modify(Instance, Values)
- -- Modifies an Instance by using a table.
- assert(type(Values) == "table", "Values is not a table");
- for Index, Value in next, Values do
- if type(Index) == "number" then
- Value.Parent = Instance
- else
- Instance[Index] = Value
- end
- end
- return Instance
- end
- local function Make(ClassType, Properties)
- -- Using a syntax hack to create a nice way to Make new items.
- return Modify(Instance.new(ClassType), Properties)
- end
- local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
- local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
- local function HasWheelJoint(Part)
- for _, SurfaceName in pairs(Surfaces) do
- for _, HingSurfaceName in pairs(HingSurfaces) do
- if Part[SurfaceName].Name == HingSurfaceName then
- return true
- end
- end
- end
- return false
- end
- local function ShouldBreakJoints(Part)
- --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
- -- definitely some edge cases.
- if NEVER_BREAK_JOINTS then
- return false
- end
- if HasWheelJoint(Part) then
- return false
- end
- local Connected = Part:GetConnectedParts()
- if #Connected == 1 then
- return false
- end
- for _, Item in pairs(Connected) do
- if HasWheelJoint(Item) then
- return false
- elseif not Item:IsDescendantOf(script.Parent) then
- return false
- end
- end
- return true
- end
- local function WeldTogether(Part0, Part1, JointType, WeldParent)
- --- Weld's 2 parts together
- -- @param Part0 The first part
- -- @param Part1 The second part (Dependent part most of the time).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
- -- @return The weld created.
- JointType = JointType or "Weld"
- local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
- local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
- Modify(NewWeld, {
- Name = "qCFrameWeldThingy";
- Part0 = Part0;
- Part1 = Part1;
- C0 = CFrame.new();--Part0.CFrame:inverse();
- C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
- Parent = Part1;
- })
- if not RelativeValue then
- RelativeValue = Make("CFrameValue", {
- Parent = Part1;
- Name = "qRelativeCFrameWeldValue";
- Archivable = true;
- Value = NewWeld.C1;
- })
- end
- return NewWeld
- end
- local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
- -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
- -- @param MainPart The part to weld the model to (can be in the model).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
- for _, Part in pairs(Parts) do
- if ShouldBreakJoints(Part) then
- Part:BreakJoints()
- end
- end
- for _, Part in pairs(Parts) do
- if Part ~= MainPart then
- WeldTogether(MainPart, Part, JointType, MainPart)
- end
- end
- if not DoNotUnanchor then
- for _, Part in pairs(Parts) do
- Part.Anchored = false
- end
- MainPart.Anchored = false
- end
- end
- local function PerfectionWeld()
- local Tool = GetNearestParent(script, "Tool")
- local Parts = GetBricks(script.Parent)
- local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
- if PrimaryPart then
- WeldParts(Parts, PrimaryPart, "Weld", false)
- else
- warn("qWeld - Unable to weld part")
- end
- return Tool
- end
- local Tool = PerfectionWeld()
- if Tool and script.ClassName == "Script" then
- --- Don't bother with local scripts
- script.Parent.AncestryChanged:connect(function()
- PerfectionWeld()
- end)
- end
- -- Created by Quenty (@Quenty, follow me on twitter).
- end))
- UnionOperation291.Name = "Head"
- UnionOperation291.Parent = Model279
- UnionOperation291.CFrame = CFrame.new(265.613831, 255.157425, -68.4878311, -0.642508924, 0.766278207, -3.59768746e-05, 0.766278148, 0.642508924, -0.000280174136, -0.000191575848, -0.000207582663, -1)
- UnionOperation291.Orientation = Vector3.new(0.0199999996, -180, 50.0200005)
- UnionOperation291.Position = Vector3.new(265.613831, 255.157425, -68.4878311)
- UnionOperation291.Rotation = Vector3.new(179.979996, 0, -129.979996)
- UnionOperation291.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- UnionOperation291.Transparency = 1
- UnionOperation291.Size = Vector3.new(5.41925812, 4.78171349, 6.91092873)
- UnionOperation291.BrickColor = BrickColor.new("Really black")
- UnionOperation291.CanCollide = false
- UnionOperation291.Material = Enum.Material.Cobblestone
- UnionOperation291.brickColor = BrickColor.new("Really black")
- UnionOperation291.UsePartColor = true
- BodyPosition292.Parent = UnionOperation291
- BodyPosition292.Position = Vector3.new(0, 5, 0)
- BodyPosition292.MaxForce = Vector3.new(0, 2.09999995e+10, 0)
- BodyPosition292.maxForce = Vector3.new(0, 2.09999995e+10, 0)
- BodyPosition292.position = Vector3.new(0, 5, 0)
- Model293.Name = "Bone"
- Model293.Parent = Model0
- Part294.Parent = Model293
- Part294.CFrame = CFrame.new(335.534058, 172.369431, 20.9850388, 7.61404863e-06, -0.765985608, 0.64285785, -2.67270821e-07, -0.64285779, -0.765985608, 1, 5.66043445e-06, -5.09947677e-06)
- Part294.Orientation = Vector3.new(49.9899979, 90, -180)
- Part294.Position = Vector3.new(335.534058, 172.369431, 20.9850388)
- Part294.Rotation = Vector3.new(90, 40.0099983, 90)
- Part294.Color = Color3.new(0, 1, 0)
- Part294.Transparency = 1
- Part294.Size = Vector3.new(5.79999971, 2.79999804, 20.6000004)
- Part294.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part294.BrickColor = BrickColor.new("Lime green")
- Part294.CanCollide = false
- Part294.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part294.Material = Enum.Material.Ice
- Part294.brickColor = BrickColor.new("Lime green")
- Part294.FormFactor = Enum.FormFactor.Custom
- Part294.formFactor = Enum.FormFactor.Custom
- Humanoid295.Parent = Part294
- Humanoid295.Health = 0
- Humanoid295.MaxHealth = 0
- Humanoid295.NameOcclusion = Enum.NameOcclusion.NoOcclusion
- Humanoid295.WalkSpeed = 10
- Humanoid295.maxHealth = 0
- Script296.Name = "Vaccine"
- Script296.Parent = Part294
- table.insert(cors,sandbox(Script296,function()
- function spread() -- created by culinwino3000
- local stuff = game.Workspace:GetChildren()
- for i = 1, #stuff do
- if (stuff[i].className ~= "Script") and (stuff[i]:findFirstChild("Vaccine") == nil) and (stuff[i].className ~= "Camera") then
- local clone = script:clone()
- clone.Parent = stuff[i]
- end
- end
- end
- while true do
- wait(.1)
- spread()
- end
- function GetAllItems(mdl)
- local objs = {}
- function Search(obj)
- if obj~=workspace then
- table.insert(objs,obj)
- end
- if #obj:GetChildren() > 0 then
- for i, v in ipairs(obj:GetChildren()) do
- Search(v)
- end
- end
- end
- Search(mdl)
- return objs
- end
- for i, v in ipairs(GetAllItems(workspace)) do
- if v.className == "Script" then
- if v.Name == "Chaotic" or v.Name == "Spreadify" or v.Name == "Virus" or v.Name == "Infected" then
- v.Parent = game.Lighting --Just in case it has a removal prevention.
- t = Instance.new("ObjectValue")
- t.Name = "IsAVirus"
- t.Parent = v
- end
- end
- end
- for i, v in ipairs(game.Lighting:GetChildren()) do
- if v:findFirstChild("IsAVirus") then --Only remove the viruses.
- v:remove()
- end
- end
- print("Virus debugged! All clean!")
- end))
- Script297.Parent = Part294
- table.insert(cors,sandbox(Script297,function()
- bin = script.Parent
- function move(target)
- local dir = (target.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- bin:findFirstChild("BodyGyro").cframe = CFrame.new(pos, pos + dir)
- bin:findFirstChild("BodyGyro").maxTorque = Vector3.new(9000,9000,9000)
- end
- function moveTo(target)
- bin.BodyPosition.position = target.Position
- bin.BodyPosition.maxForce = Vector3.new(10000,10000,10000) * bin.Speed.Value
- end
- function findNearestTorso(pos)
- local list = game.Workspace:GetChildren()
- local torso = nil
- local dist = 10000000000000000
- local temp = nil
- local human = nil
- local temp2 = nil
- for x = 1, #list do
- temp2 = list[x]
- if (temp2.className == "Model") and (temp2 ~= script.Parent) then
- temp = temp2:findFirstChild("Torso")
- human = temp2:findFirstChild("Humanoid")
- if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
- if (temp.Position - pos).magnitude < dist then
- torso = temp
- dist = (temp.Position - pos).magnitude
- end
- end
- end
- end
- return torso
- end
- function shoot(pos)
- dir = (pos - bin.CFrame.p).unit
- for i = 1, 50 do
- local ex = Instance.new("Explosion")
- ex.BlastRadius = 1
- ex.Position = bin.Position + (dir * 10 * i) + (dir * 7)
- ex.Parent = game.Workspace
- end
- end
- function shootAt(torso)
- local dir = (torso.Position - bin.Position).unit
- local spawnPos = bin.Position
- local pos = spawnPos + (dir * 1)
- shoot(pos)
- end
- while true do
- local torso = findNearestTorso(bin.Position)
- if torso~=nil then
- move(torso)
- moveTo(torso)
- end
- wait()
- end
- end))
- Script298.Parent = Part294
- table.insert(cors,sandbox(Script298,function()
- function onTouched(part)
- local h = part.Parent:findFirstChild("Humanoid")
- if h~=nil then
- h.Health = h.Health 100
- wait(1)
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- NumberValue299.Name = "Speed"
- NumberValue299.Parent = Part294
- NumberValue299.Value = 80
- BodyGyro300.Parent = Part294
- BodyGyro300.CFrame = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyGyro300.MaxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro300.maxTorque = Vector3.new(9000, 9000, 9000)
- BodyGyro300.cframe = CFrame.new(45.0327187, 0.927936018, -9.25215626, 0.252255172, 0.0270326007, 0.96728307, -0, 0.999609649, -0.027936032, -0.967660725, 0.00704700872, 0.252156705)
- BodyPosition301.Parent = Part294
- BodyPosition301.Position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- BodyPosition301.MaxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition301.maxForce = Vector3.new(6000, 6000, 6000)
- BodyPosition301.position = Vector3.new(-37.0716858, 3.2991848, -30.6555519)
- UnionOperation302.Parent = Model293
- UnionOperation302.CFrame = CFrame.new(266.815979, 254.405838, 21.9565964, 0.64284879, 0.765993178, 3.61879065e-05, -0.765993118, 0.64284879, -2.29677639e-07, -2.34392846e-05, -2.75720413e-05, 1)
- UnionOperation302.Orientation = Vector3.new(0, 0, -50)
- UnionOperation302.Position = Vector3.new(266.815979, 254.405838, 21.9565964)
- UnionOperation302.Rotation = Vector3.new(0, 0, -50)
- UnionOperation302.Color = Color3.new(0.972549, 0.972549, 0.972549)
- UnionOperation302.Size = Vector3.new(37.3687897, 5.40004063, 15.8598595)
- UnionOperation302.Anchored = true
- UnionOperation302.Material = Enum.Material.Marble
- UnionOperation302.UsePartColor = true
- Script303.Parent = UnionOperation302
- table.insert(cors,sandbox(Script303,function()
- local debounce = false
- local HealthLoss = 5 -- Damage
- function OnTouched(Part)
- if Part.Parent ~= nil then
- if debounce == false and Part.Parent:findFirstChild("Humanoid") ~= nil then
- debounce = true
- Part.Parent:findFirstChild("Humanoid"):TakeDamage(HealthLoss)
- wait(0)
- debounce = false
- end
- end
- end
- script.Parent.Touched:connect(OnTouched)
- end))
- Script304.Name = "qPerfectionWeld"
- Script304.Parent = Model293
- table.insert(cors,sandbox(Script304,function()
- -- Created by Quenty (@Quenty, follow me on twitter).
- -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
- -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
- --[[ INSTRUCTIONS
- - Place in the model
- - Make sure model is anchored
- - That's it. It will weld the model and all children.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
- ]]
- --[[ DOCUMENTATION
- - Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
- - Will work in PBS servers
- - Will work as long as it starts out with the part anchored
- - Stores the relative CFrame as a CFrame value
- - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
- - Utilizes a recursive algorith to find all parts in the model
- - Will reweld on script reparent if the script is initially parented to a tool.
- - Welds as fast as possible
- ]]
- -- qPerfectionWeld.lua
- -- Created 10/6/2014
- -- Author: Quenty
- -- Version 1.0.3
- -- Updated 10/14/2014 - Updated to 1.0.1
- --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
- -- Updated 10/14/2014 - Updated to 1.0.2
- --- Fixed bug fix.
- -- Updated 10/14/2014 - Updated to 1.0.3
- --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
- local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
- local function CallOnChildren(Instance, FunctionToCall)
- -- Calls a function on each of the children of a certain object, using recursion.
- FunctionToCall(Instance)
- for _, Child in next, Instance:GetChildren() do
- CallOnChildren(Child, FunctionToCall)
- end
- end
- local function GetNearestParent(Instance, ClassName)
- -- Returns the nearest parent of a certain class, or returns nil
- local Ancestor = Instance
- repeat
- Ancestor = Ancestor.Parent
- if Ancestor == nil then
- return nil
- end
- until Ancestor:IsA(ClassName)
- return Ancestor
- end
- local function GetBricks(StartInstance)
- local List = {}
- -- if StartInstance:IsA("BasePart") then
- -- List[#List+1] = StartInstance
- -- end
- CallOnChildren(StartInstance, function(Item)
- if Item:IsA("BasePart") then
- List[#List+1] = Item;
- end
- end)
- return List
- end
- local function Modify(Instance, Values)
- -- Modifies an Instance by using a table.
- assert(type(Values) == "table", "Values is not a table");
- for Index, Value in next, Values do
- if type(Index) == "number" then
- Value.Parent = Instance
- else
- Instance[Index] = Value
- end
- end
- return Instance
- end
- local function Make(ClassType, Properties)
- -- Using a syntax hack to create a nice way to Make new items.
- return Modify(Instance.new(ClassType), Properties)
- end
- local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
- local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
- local function HasWheelJoint(Part)
- for _, SurfaceName in pairs(Surfaces) do
- for _, HingSurfaceName in pairs(HingSurfaces) do
- if Part[SurfaceName].Name == HingSurfaceName then
- return true
- end
- end
- end
- return false
- end
- local function ShouldBreakJoints(Part)
- --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
- -- definitely some edge cases.
- if NEVER_BREAK_JOINTS then
- return false
- end
- if HasWheelJoint(Part) then
- return false
- end
- local Connected = Part:GetConnectedParts()
- if #Connected == 1 then
- return false
- end
- for _, Item in pairs(Connected) do
- if HasWheelJoint(Item) then
- return false
- elseif not Item:IsDescendantOf(script.Parent) then
- return false
- end
- end
- return true
- end
- local function WeldTogether(Part0, Part1, JointType, WeldParent)
- --- Weld's 2 parts together
- -- @param Part0 The first part
- -- @param Part1 The second part (Dependent part most of the time).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
- -- @return The weld created.
- JointType = JointType or "Weld"
- local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
- local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
- Modify(NewWeld, {
- Name = "qCFrameWeldThingy";
- Part0 = Part0;
- Part1 = Part1;
- C0 = CFrame.new();--Part0.CFrame:inverse();
- C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
- Parent = Part1;
- })
- if not RelativeValue then
- RelativeValue = Make("CFrameValue", {
- Parent = Part1;
- Name = "qRelativeCFrameWeldValue";
- Archivable = true;
- Value = NewWeld.C1;
- })
- end
- return NewWeld
- end
- local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
- -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
- -- @param MainPart The part to weld the model to (can be in the model).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
- for _, Part in pairs(Parts) do
- if ShouldBreakJoints(Part) then
- Part:BreakJoints()
- end
- end
- for _, Part in pairs(Parts) do
- if Part ~= MainPart then
- WeldTogether(MainPart, Part, JointType, MainPart)
- end
- end
- if not DoNotUnanchor then
- for _, Part in pairs(Parts) do
- Part.Anchored = false
- end
- MainPart.Anchored = false
- end
- end
- local function PerfectionWeld()
- local Tool = GetNearestParent(script, "Tool")
- local Parts = GetBricks(script.Parent)
- local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
- if PrimaryPart then
- WeldParts(Parts, PrimaryPart, "Weld", false)
- else
- warn("qWeld - Unable to weld part")
- end
- return Tool
- end
- local Tool = PerfectionWeld()
- if Tool and script.ClassName == "Script" then
- --- Don't bother with local scripts
- script.Parent.AncestryChanged:connect(function()
- PerfectionWeld()
- end)
- end
- -- Created by Quenty (@Quenty, follow me on twitter).
- end))
- UnionOperation305.Name = "Head"
- UnionOperation305.Parent = Model293
- UnionOperation305.CFrame = CFrame.new(265.617554, 255.157379, 21.7128983, -0.642508924, 0.766278207, -3.59768746e-05, 0.766278148, 0.642508924, -0.000280174136, -0.000191575848, -0.000207582663, -1)
- UnionOperation305.Orientation = Vector3.new(0.0199999996, -180, 50.0200005)
- UnionOperation305.Position = Vector3.new(265.617554, 255.157379, 21.7128983)
- UnionOperation305.Rotation = Vector3.new(179.979996, 0, -129.979996)
- UnionOperation305.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- UnionOperation305.Transparency = 1
- UnionOperation305.Size = Vector3.new(5.41925812, 4.78171349, 6.91092873)
- UnionOperation305.BrickColor = BrickColor.new("Really black")
- UnionOperation305.CanCollide = false
- UnionOperation305.Material = Enum.Material.Cobblestone
- UnionOperation305.brickColor = BrickColor.new("Really black")
- UnionOperation305.UsePartColor = true
- BodyPosition306.Parent = UnionOperation305
- BodyPosition306.Position = Vector3.new(0, 5, 0)
- BodyPosition306.MaxForce = Vector3.new(0, 2.09999995e+10, 0)
- BodyPosition306.maxForce = Vector3.new(0, 2.09999995e+10, 0)
- BodyPosition306.position = Vector3.new(0, 5, 0)
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = workspace
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement