Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --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")
- Model2 = Instance.new("Model")
- Model3 = Instance.new("Model")
- Part4 = Instance.new("Part")
- Part5 = Instance.new("Part")
- Part6 = Instance.new("Part")
- Part7 = Instance.new("Part")
- Part8 = Instance.new("Part")
- Model9 = Instance.new("Model")
- Part10 = Instance.new("Part")
- SpecialMesh11 = Instance.new("SpecialMesh")
- Part12 = Instance.new("Part")
- SpecialMesh13 = Instance.new("SpecialMesh")
- Part14 = Instance.new("Part")
- SpecialMesh15 = Instance.new("SpecialMesh")
- Part16 = Instance.new("Part")
- SpecialMesh17 = Instance.new("SpecialMesh")
- Part18 = Instance.new("Part")
- Script19 = Instance.new("Script")
- ClickDetector20 = Instance.new("ClickDetector")
- Script21 = Instance.new("Script")
- Script22 = Instance.new("Script")
- Script23 = Instance.new("Script")
- Script24 = Instance.new("Script")
- Script25 = Instance.new("Script")
- Part26 = Instance.new("Part")
- Script27 = Instance.new("Script")
- ClickDetector28 = Instance.new("ClickDetector")
- Script29 = Instance.new("Script")
- Script30 = Instance.new("Script")
- Script31 = Instance.new("Script")
- Script32 = Instance.new("Script")
- Script33 = Instance.new("Script")
- Part34 = Instance.new("Part")
- SpecialMesh35 = Instance.new("SpecialMesh")
- Part36 = Instance.new("Part")
- SpecialMesh37 = Instance.new("SpecialMesh")
- Part38 = Instance.new("Part")
- SpecialMesh39 = Instance.new("SpecialMesh")
- Part40 = Instance.new("Part")
- SpecialMesh41 = Instance.new("SpecialMesh")
- Part42 = Instance.new("Part")
- SpecialMesh43 = Instance.new("SpecialMesh")
- Part44 = Instance.new("Part")
- SpecialMesh45 = Instance.new("SpecialMesh")
- Part46 = Instance.new("Part")
- SpecialMesh47 = Instance.new("SpecialMesh")
- Part48 = Instance.new("Part")
- SpecialMesh49 = Instance.new("SpecialMesh")
- Part50 = Instance.new("Part")
- SpecialMesh51 = Instance.new("SpecialMesh")
- Part52 = Instance.new("Part")
- SpecialMesh53 = Instance.new("SpecialMesh")
- Part54 = Instance.new("Part")
- SpecialMesh55 = Instance.new("SpecialMesh")
- Part56 = Instance.new("Part")
- SpecialMesh57 = Instance.new("SpecialMesh")
- Part58 = Instance.new("Part")
- Model59 = Instance.new("Model")
- Part60 = Instance.new("Part")
- SpecialMesh61 = Instance.new("SpecialMesh")
- Sound62 = Instance.new("Sound")
- Script63 = Instance.new("Script")
- PointLight64 = Instance.new("PointLight")
- Sound65 = Instance.new("Sound")
- Sound66 = Instance.new("Sound")
- Part67 = Instance.new("Part")
- Decal68 = Instance.new("Decal")
- Motor6D69 = Instance.new("Motor6D")
- Motor6D70 = Instance.new("Motor6D")
- Motor6D71 = Instance.new("Motor6D")
- Motor6D72 = Instance.new("Motor6D")
- Motor6D73 = Instance.new("Motor6D")
- Script74 = Instance.new("Script")
- Part75 = Instance.new("Part")
- Part76 = Instance.new("Part")
- Part77 = Instance.new("Part")
- Part78 = Instance.new("Part")
- Part79 = Instance.new("Part")
- Weld80 = Instance.new("Weld")
- Part81 = Instance.new("Part")
- Part82 = Instance.new("Part")
- Humanoid83 = Instance.new("Humanoid")
- Model84 = Instance.new("Model")
- Model85 = Instance.new("Model")
- Part86 = Instance.new("Part")
- Motor6D87 = Instance.new("Motor6D")
- Script88 = Instance.new("Script")
- Script89 = Instance.new("Script")
- StringValue90 = Instance.new("StringValue")
- Animation91 = Instance.new("Animation")
- StringValue92 = Instance.new("StringValue")
- Animation93 = Instance.new("Animation")
- StringValue94 = Instance.new("StringValue")
- Animation95 = Instance.new("Animation")
- NumberValue96 = Instance.new("NumberValue")
- Animation97 = Instance.new("Animation")
- NumberValue98 = Instance.new("NumberValue")
- StringValue99 = Instance.new("StringValue")
- Animation100 = Instance.new("Animation")
- StringValue101 = Instance.new("StringValue")
- Animation102 = Instance.new("Animation")
- StringValue103 = Instance.new("StringValue")
- Animation104 = Instance.new("Animation")
- StringValue105 = Instance.new("StringValue")
- Animation106 = Instance.new("Animation")
- StringValue107 = Instance.new("StringValue")
- Animation108 = Instance.new("Animation")
- Animation109 = Instance.new("Animation")
- Script110 = Instance.new("Script")
- Part111 = Instance.new("Part")
- SpecialMesh112 = Instance.new("SpecialMesh")
- Sound113 = Instance.new("Sound")
- Sound114 = Instance.new("Sound")
- Sound115 = Instance.new("Sound")
- Sound116 = Instance.new("Sound")
- Script117 = Instance.new("Script")
- BodyColors118 = Instance.new("BodyColors")
- Sound119 = Instance.new("Sound")
- Model0.Parent = mas
- Model1.Parent = Model0
- Model2.Parent = Model1
- Model3.Parent = Model2
- Part4.Parent = Model3
- Part4.BrickColor = BrickColor.new("Dark stone grey")
- Part4.Anchored = true
- Part4.FormFactor = Enum.FormFactor.Symmetric
- Part4.Size = Vector3.new(1, 10, 1)
- Part4.CFrame = CFrame.new(34.4000015, 5.39990234, -50.2000084, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part4.BottomSurface = Enum.SurfaceType.Smooth
- Part4.TopSurface = Enum.SurfaceType.Smooth
- Part4.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part4.Position = Vector3.new(34.4000015, 5.39990234, -50.2000084)
- Part4.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part5.Parent = Model3
- Part5.BrickColor = BrickColor.new("Dark stone grey")
- Part5.Anchored = true
- Part5.FormFactor = Enum.FormFactor.Plate
- Part5.Size = Vector3.new(10, 0.400000006, 10)
- Part5.CFrame = CFrame.new(29.9000034, 10.5998802, -54.7000084, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part5.BottomSurface = Enum.SurfaceType.Smooth
- Part5.TopSurface = Enum.SurfaceType.Smooth
- Part5.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part5.Position = Vector3.new(29.9000034, 10.5998802, -54.7000084)
- Part5.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part6.Parent = Model3
- Part6.BrickColor = BrickColor.new("Dark stone grey")
- Part6.Anchored = true
- Part6.FormFactor = Enum.FormFactor.Symmetric
- Part6.Size = Vector3.new(1, 10, 1)
- Part6.CFrame = CFrame.new(25.4000015, 5.39990234, -50.2000084, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part6.BottomSurface = Enum.SurfaceType.Smooth
- Part6.TopSurface = Enum.SurfaceType.Smooth
- Part6.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part6.Position = Vector3.new(25.4000015, 5.39990234, -50.2000084)
- Part6.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part7.Parent = Model3
- Part7.BrickColor = BrickColor.new("Dark stone grey")
- Part7.Anchored = true
- Part7.FormFactor = Enum.FormFactor.Plate
- Part7.Size = Vector3.new(10, 0.400000006, 10)
- Part7.CFrame = CFrame.new(29.9000034, 0.200016022, -54.7000084, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part7.BottomSurface = Enum.SurfaceType.Smooth
- Part7.TopSurface = Enum.SurfaceType.Smooth
- Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part7.Position = Vector3.new(29.9000034, 0.200016022, -54.7000084)
- Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part8.Parent = Model3
- Part8.BrickColor = BrickColor.new("Dark stone grey")
- Part8.Anchored = true
- Part8.FormFactor = Enum.FormFactor.Symmetric
- Part8.Size = Vector3.new(1, 10, 1)
- Part8.CFrame = CFrame.new(25.4000015, 5.39990234, -59.2000084, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part8.BottomSurface = Enum.SurfaceType.Smooth
- Part8.TopSurface = Enum.SurfaceType.Smooth
- Part8.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part8.Position = Vector3.new(25.4000015, 5.39990234, -59.2000084)
- Part8.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Model9.Parent = Model3
- Part10.Name = "l1"
- Part10.Parent = Model9
- Part10.Reflectance = 0.5
- Part10.Transparency = 0.30000001192093
- Part10.Rotation = Vector3.new(0, -90, 0)
- Part10.Anchored = true
- Part10.FormFactor = Enum.FormFactor.Symmetric
- Part10.Size = Vector3.new(1, 10, 2)
- Part10.CFrame = CFrame.new(26.9000015, 5.39990234, -59.2000084, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Part10.Position = Vector3.new(26.9000015, 5.39990234, -59.2000084)
- Part10.Orientation = Vector3.new(0, -90, 0)
- SpecialMesh11.Parent = Part10
- SpecialMesh11.Scale = Vector3.new(0.5, 1, 0.5)
- SpecialMesh11.Scale = Vector3.new(0.5, 1, 0.5)
- Part12.Name = "l2"
- Part12.Parent = Model9
- Part12.Reflectance = 0.5
- Part12.Transparency = 0.30000001192093
- Part12.Rotation = Vector3.new(0, 90, 0)
- Part12.Anchored = true
- Part12.FormFactor = Enum.FormFactor.Symmetric
- Part12.Size = Vector3.new(1, 10, 2)
- Part12.CFrame = CFrame.new(28.9000034, 5.39990234, -59.2000084, 0, 0, 1, 0, 1, 0, -1, 0, 0)
- Part12.Position = Vector3.new(28.9000034, 5.39990234, -59.2000084)
- Part12.Orientation = Vector3.new(0, 90, 0)
- SpecialMesh13.Parent = Part12
- SpecialMesh13.Scale = Vector3.new(0.5, 1, 0.5)
- SpecialMesh13.Scale = Vector3.new(0.5, 1, 0.5)
- Part14.Name = "l3"
- Part14.Parent = Model9
- Part14.Reflectance = 0.5
- Part14.Transparency = 0.30000001192093
- Part14.Rotation = Vector3.new(0, 90, 0)
- Part14.Anchored = true
- Part14.FormFactor = Enum.FormFactor.Symmetric
- Part14.Size = Vector3.new(1, 10, 2)
- Part14.CFrame = CFrame.new(30.9000034, 5.39990234, -59.2000084, 0, 0, 1, 0, 1, 0, -1, 0, 0)
- Part14.Position = Vector3.new(30.9000034, 5.39990234, -59.2000084)
- Part14.Orientation = Vector3.new(0, 90, 0)
- SpecialMesh15.Parent = Part14
- SpecialMesh15.Scale = Vector3.new(0.5, 1, 0.5)
- SpecialMesh15.Scale = Vector3.new(0.5, 1, 0.5)
- Part16.Name = "l4"
- Part16.Parent = Model9
- Part16.Reflectance = 0.5
- Part16.Transparency = 0.30000001192093
- Part16.Rotation = Vector3.new(0, 90, 0)
- Part16.Anchored = true
- Part16.FormFactor = Enum.FormFactor.Symmetric
- Part16.Size = Vector3.new(1, 10, 2)
- Part16.CFrame = CFrame.new(32.9000015, 5.39990234, -59.2000084, 0, 0, 1, 0, 1, 0, -1, 0, 0)
- Part16.Position = Vector3.new(32.9000015, 5.39990234, -59.2000084)
- Part16.Orientation = Vector3.new(0, 90, 0)
- SpecialMesh17.Parent = Part16
- SpecialMesh17.Scale = Vector3.new(0.5, 1, 0.5)
- SpecialMesh17.Scale = Vector3.new(0.5, 1, 0.5)
- Part18.Name = "Smooth Block Model"
- Part18.Parent = Model9
- Part18.BrickColor = BrickColor.new("Bright red")
- Part18.Rotation = Vector3.new(-90, 0, 0)
- Part18.Anchored = true
- Part18.FormFactor = Enum.FormFactor.Plate
- Part18.Size = Vector3.new(1, 0.400000006, 1)
- Part18.CFrame = CFrame.new(25.4000015, 3.90001726, -59.9000053, 1, 0, 0, 0, 0, 1, 0, -1, 0)
- Part18.TopSurface = Enum.SurfaceType.Smooth
- Part18.Color = Color3.new(0.768628, 0.156863, 0.109804)
- Part18.Position = Vector3.new(25.4000015, 3.90001726, -59.9000053)
- Part18.Orientation = Vector3.new(-90, 0, 0)
- Part18.Color = Color3.new(0.768628, 0.156863, 0.109804)
- Script19.Parent = Part18
- table.insert(cors,sandbox(Script19,function()
- function onClicked()
- script.Parent.Parent.l1.Transparency = 0.3
- script.Parent.Parent.l1.CanCollide = true
- end
- script.Parent.ClickDetector.MouseClick:connect (onClicked)
- end))
- ClickDetector20.Parent = Part18
- Script21.Parent = Part18
- table.insert(cors,sandbox(Script21,function()
- function onClicked()
- script.Parent.Parent.l2.Transparency = 0.3
- script.Parent.Parent.l2.CanCollide = true
- end
- script.Parent.ClickDetector.MouseClick:connect (onClicked)
- end))
- Script22.Parent = Part18
- table.insert(cors,sandbox(Script22,function()
- function onClicked()
- script.Parent.Parent.l3.Transparency = 0.3
- script.Parent.Parent.l3.CanCollide = true
- end
- script.Parent.ClickDetector.MouseClick:connect (onClicked)
- end))
- Script23.Parent = Part18
- table.insert(cors,sandbox(Script23,function()
- function onClicked()
- script.Parent.Parent.l4.Transparency = 0.3
- script.Parent.Parent.l4.CanCollide = true
- end
- script.Parent.ClickDetector.MouseClick:connect (onClicked)
- end))
- Script24.Parent = Part18
- table.insert(cors,sandbox(Script24,function()
- function onClicked()
- script.Parent.Parent.l5.Transparency = 0.3
- script.Parent.Parent.l5.CanCollide = true
- end
- script.Parent.ClickDetector.MouseClick:connect (onClicked)
- end))
- Script25.Parent = Part18
- table.insert(cors,sandbox(Script25,function()
- function onClicked()
- script.Parent.Parent.l6.Transparency = 0.3
- script.Parent.Parent.l6.CanCollide = true
- end
- script.Parent.ClickDetector.MouseClick:connect (onClicked)
- end))
- Part26.Name = "Smooth Block Model"
- Part26.Parent = Model9
- Part26.BrickColor = BrickColor.new("Dark green")
- Part26.Rotation = Vector3.new(90, -90, 0)
- Part26.Anchored = true
- Part26.FormFactor = Enum.FormFactor.Plate
- Part26.Size = Vector3.new(1, 0.400000006, 1)
- Part26.CFrame = CFrame.new(25.4000015, 4.89758825, -59.8999596, 0, 0, -1, -1, 0, 0, 0, 1, 0)
- Part26.BottomSurface = Enum.SurfaceType.Smooth
- Part26.TopSurface = Enum.SurfaceType.Smooth
- Part26.Color = Color3.new(0.156863, 0.498039, 0.278431)
- Part26.Position = Vector3.new(25.4000015, 4.89758825, -59.8999596)
- Part26.Orientation = Vector3.new(0, -90, -90)
- Part26.Color = Color3.new(0.156863, 0.498039, 0.278431)
- Script27.Parent = Part26
- table.insert(cors,sandbox(Script27,function()
- function onClicked()
- script.Parent.Parent.l1.Transparency = 1
- script.Parent.Parent.l1.CanCollide = false
- end
- script.Parent.ClickDetector.MouseClick:connect (onClicked)
- end))
- ClickDetector28.Parent = Part26
- Script29.Parent = Part26
- table.insert(cors,sandbox(Script29,function()
- function onClicked()
- script.Parent.Parent.l2.Transparency = 1
- script.Parent.Parent.l2.CanCollide = false
- end
- script.Parent.ClickDetector.MouseClick:connect (onClicked)
- end))
- Script30.Parent = Part26
- table.insert(cors,sandbox(Script30,function()
- function onClicked()
- script.Parent.Parent.l3.Transparency = 1
- script.Parent.Parent.l3.CanCollide = false
- end
- script.Parent.ClickDetector.MouseClick:connect (onClicked)
- end))
- Script31.Parent = Part26
- table.insert(cors,sandbox(Script31,function()
- function onClicked()
- script.Parent.Parent.l4.Transparency = 1
- script.Parent.Parent.l4.CanCollide = false
- end
- script.Parent.ClickDetector.MouseClick:connect (onClicked)
- end))
- Script32.Parent = Part26
- table.insert(cors,sandbox(Script32,function()
- function onClicked()
- script.Parent.Parent.l5.Transparency = 1
- script.Parent.Parent.l5.CanCollide = false
- end
- script.Parent.ClickDetector.MouseClick:connect (onClicked)
- end))
- Script33.Parent = Part26
- table.insert(cors,sandbox(Script33,function()
- function onClicked()
- script.Parent.Parent.l6.Transparency = 1
- script.Parent.Parent.l6.CanCollide = false
- end
- script.Parent.ClickDetector.MouseClick:connect (onClicked)
- end))
- Part34.Parent = Model9
- Part34.BrickColor = BrickColor.new("Dark stone grey")
- Part34.Reflectance = 0.5
- Part34.Rotation = Vector3.new(0, 90, 0)
- Part34.Anchored = true
- Part34.FormFactor = Enum.FormFactor.Symmetric
- Part34.Size = Vector3.new(1, 10, 2)
- Part34.CFrame = CFrame.new(26.9000015, 5.39990234, -50.2000084, 0, 0, 1, 0, 1, 0, -1, 0, 0)
- Part34.BottomSurface = Enum.SurfaceType.Smooth
- Part34.TopSurface = Enum.SurfaceType.Smooth
- Part34.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part34.Position = Vector3.new(26.9000015, 5.39990234, -50.2000084)
- Part34.Orientation = Vector3.new(0, 90, 0)
- Part34.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh35.Parent = Part34
- SpecialMesh35.Scale = Vector3.new(0.5, 1, 0.5)
- SpecialMesh35.Scale = Vector3.new(0.5, 1, 0.5)
- Part36.Parent = Model9
- Part36.BrickColor = BrickColor.new("Dark stone grey")
- Part36.Reflectance = 0.5
- Part36.Rotation = Vector3.new(0, 90, 0)
- Part36.Anchored = true
- Part36.FormFactor = Enum.FormFactor.Symmetric
- Part36.Size = Vector3.new(1, 10, 2)
- Part36.CFrame = CFrame.new(28.9000034, 5.39990234, -50.2000084, 0, 0, 1, 0, 1, 0, -1, 0, 0)
- Part36.BottomSurface = Enum.SurfaceType.Smooth
- Part36.TopSurface = Enum.SurfaceType.Smooth
- Part36.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part36.Position = Vector3.new(28.9000034, 5.39990234, -50.2000084)
- Part36.Orientation = Vector3.new(0, 90, 0)
- Part36.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh37.Parent = Part36
- SpecialMesh37.Scale = Vector3.new(0.5, 1, 0.5)
- SpecialMesh37.Scale = Vector3.new(0.5, 1, 0.5)
- Part38.Parent = Model9
- Part38.BrickColor = BrickColor.new("Dark stone grey")
- Part38.Reflectance = 0.5
- Part38.Rotation = Vector3.new(0, 90, 0)
- Part38.Anchored = true
- Part38.FormFactor = Enum.FormFactor.Symmetric
- Part38.Size = Vector3.new(1, 10, 2)
- Part38.CFrame = CFrame.new(30.9000034, 5.39990234, -50.2000084, 0, 0, 1, 0, 1, 0, -1, 0, 0)
- Part38.BottomSurface = Enum.SurfaceType.Smooth
- Part38.TopSurface = Enum.SurfaceType.Smooth
- Part38.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part38.Position = Vector3.new(30.9000034, 5.39990234, -50.2000084)
- Part38.Orientation = Vector3.new(0, 90, 0)
- Part38.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh39.Parent = Part38
- SpecialMesh39.Scale = Vector3.new(0.5, 1, 0.5)
- SpecialMesh39.Scale = Vector3.new(0.5, 1, 0.5)
- Part40.Parent = Model9
- Part40.BrickColor = BrickColor.new("Dark stone grey")
- Part40.Reflectance = 0.5
- Part40.Rotation = Vector3.new(0, 90, 0)
- Part40.Anchored = true
- Part40.FormFactor = Enum.FormFactor.Symmetric
- Part40.Size = Vector3.new(1, 10, 2)
- Part40.CFrame = CFrame.new(32.9000015, 5.39990234, -50.2000084, 0, 0, 1, 0, 1, 0, -1, 0, 0)
- Part40.BottomSurface = Enum.SurfaceType.Smooth
- Part40.TopSurface = Enum.SurfaceType.Smooth
- Part40.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part40.Position = Vector3.new(32.9000015, 5.39990234, -50.2000084)
- Part40.Orientation = Vector3.new(0, 90, 0)
- Part40.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh41.Parent = Part40
- SpecialMesh41.Scale = Vector3.new(0.5, 1, 0.5)
- SpecialMesh41.Scale = Vector3.new(0.5, 1, 0.5)
- Part42.Parent = Model9
- Part42.BrickColor = BrickColor.new("Dark stone grey")
- Part42.Reflectance = 0.5
- Part42.Rotation = Vector3.new(-180, 0, -180)
- Part42.Anchored = true
- Part42.FormFactor = Enum.FormFactor.Symmetric
- Part42.Size = Vector3.new(1, 10, 2)
- Part42.CFrame = CFrame.new(25.4000015, 5.39990234, -51.7000084, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part42.BottomSurface = Enum.SurfaceType.Smooth
- Part42.TopSurface = Enum.SurfaceType.Smooth
- Part42.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part42.Position = Vector3.new(25.4000015, 5.39990234, -51.7000084)
- Part42.Orientation = Vector3.new(0, 180, 0)
- Part42.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh43.Parent = Part42
- SpecialMesh43.Scale = Vector3.new(0.5, 1, 0.5)
- SpecialMesh43.Scale = Vector3.new(0.5, 1, 0.5)
- Part44.Parent = Model9
- Part44.BrickColor = BrickColor.new("Dark stone grey")
- Part44.Reflectance = 0.5
- Part44.Rotation = Vector3.new(-180, 0, -180)
- Part44.Anchored = true
- Part44.FormFactor = Enum.FormFactor.Symmetric
- Part44.Size = Vector3.new(1, 10, 2)
- Part44.CFrame = CFrame.new(25.4000015, 5.39990234, -53.7000084, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part44.BottomSurface = Enum.SurfaceType.Smooth
- Part44.TopSurface = Enum.SurfaceType.Smooth
- Part44.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part44.Position = Vector3.new(25.4000015, 5.39990234, -53.7000084)
- Part44.Orientation = Vector3.new(0, 180, 0)
- Part44.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh45.Parent = Part44
- SpecialMesh45.Scale = Vector3.new(0.5, 1, 0.5)
- SpecialMesh45.Scale = Vector3.new(0.5, 1, 0.5)
- Part46.Parent = Model9
- Part46.BrickColor = BrickColor.new("Dark stone grey")
- Part46.Reflectance = 0.5
- Part46.Rotation = Vector3.new(-180, 0, -180)
- Part46.Anchored = true
- Part46.FormFactor = Enum.FormFactor.Symmetric
- Part46.Size = Vector3.new(1, 10, 2)
- Part46.CFrame = CFrame.new(25.4000015, 5.39990234, -55.7000084, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part46.BottomSurface = Enum.SurfaceType.Smooth
- Part46.TopSurface = Enum.SurfaceType.Smooth
- Part46.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part46.Position = Vector3.new(25.4000015, 5.39990234, -55.7000084)
- Part46.Orientation = Vector3.new(0, 180, 0)
- Part46.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh47.Parent = Part46
- SpecialMesh47.Scale = Vector3.new(0.5, 1, 0.5)
- SpecialMesh47.Scale = Vector3.new(0.5, 1, 0.5)
- Part48.Parent = Model9
- Part48.BrickColor = BrickColor.new("Dark stone grey")
- Part48.Reflectance = 0.5
- Part48.Rotation = Vector3.new(-180, 0, -180)
- Part48.Anchored = true
- Part48.FormFactor = Enum.FormFactor.Symmetric
- Part48.Size = Vector3.new(1, 10, 2)
- Part48.CFrame = CFrame.new(25.4000015, 5.39990234, -57.7000084, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part48.BottomSurface = Enum.SurfaceType.Smooth
- Part48.TopSurface = Enum.SurfaceType.Smooth
- Part48.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part48.Position = Vector3.new(25.4000015, 5.39990234, -57.7000084)
- Part48.Orientation = Vector3.new(0, 180, 0)
- Part48.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh49.Parent = Part48
- SpecialMesh49.Scale = Vector3.new(0.5, 1, 0.5)
- SpecialMesh49.Scale = Vector3.new(0.5, 1, 0.5)
- Part50.Parent = Model9
- Part50.BrickColor = BrickColor.new("Dark stone grey")
- Part50.Reflectance = 0.5
- Part50.Anchored = true
- Part50.FormFactor = Enum.FormFactor.Symmetric
- Part50.Size = Vector3.new(1, 10, 2)
- Part50.CFrame = CFrame.new(34.4000015, 5.39990234, -57.7000084, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part50.BottomSurface = Enum.SurfaceType.Smooth
- Part50.TopSurface = Enum.SurfaceType.Smooth
- Part50.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part50.Position = Vector3.new(34.4000015, 5.39990234, -57.7000084)
- Part50.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh51.Parent = Part50
- SpecialMesh51.Scale = Vector3.new(0.5, 1, 0.5)
- SpecialMesh51.Scale = Vector3.new(0.5, 1, 0.5)
- Part52.Parent = Model9
- Part52.BrickColor = BrickColor.new("Dark stone grey")
- Part52.Reflectance = 0.5
- Part52.Anchored = true
- Part52.FormFactor = Enum.FormFactor.Symmetric
- Part52.Size = Vector3.new(1, 10, 2)
- Part52.CFrame = CFrame.new(34.4000015, 5.39990234, -55.7000084, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part52.BottomSurface = Enum.SurfaceType.Smooth
- Part52.TopSurface = Enum.SurfaceType.Smooth
- Part52.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part52.Position = Vector3.new(34.4000015, 5.39990234, -55.7000084)
- Part52.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh53.Parent = Part52
- SpecialMesh53.Scale = Vector3.new(0.5, 1, 0.5)
- SpecialMesh53.Scale = Vector3.new(0.5, 1, 0.5)
- Part54.Parent = Model9
- Part54.BrickColor = BrickColor.new("Dark stone grey")
- Part54.Reflectance = 0.5
- Part54.Anchored = true
- Part54.FormFactor = Enum.FormFactor.Symmetric
- Part54.Size = Vector3.new(1, 10, 2)
- Part54.CFrame = CFrame.new(34.4000015, 5.39990234, -53.7000084, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part54.BottomSurface = Enum.SurfaceType.Smooth
- Part54.TopSurface = Enum.SurfaceType.Smooth
- Part54.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part54.Position = Vector3.new(34.4000015, 5.39990234, -53.7000084)
- Part54.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh55.Parent = Part54
- SpecialMesh55.Scale = Vector3.new(0.5, 1, 0.5)
- SpecialMesh55.Scale = Vector3.new(0.5, 1, 0.5)
- Part56.Parent = Model9
- Part56.BrickColor = BrickColor.new("Dark stone grey")
- Part56.Reflectance = 0.5
- Part56.Anchored = true
- Part56.FormFactor = Enum.FormFactor.Symmetric
- Part56.Size = Vector3.new(1, 10, 2)
- Part56.CFrame = CFrame.new(34.4000015, 5.39990234, -51.7000084, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part56.BottomSurface = Enum.SurfaceType.Smooth
- Part56.TopSurface = Enum.SurfaceType.Smooth
- Part56.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part56.Position = Vector3.new(34.4000015, 5.39990234, -51.7000084)
- Part56.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh57.Parent = Part56
- SpecialMesh57.Scale = Vector3.new(0.5, 1, 0.5)
- SpecialMesh57.Scale = Vector3.new(0.5, 1, 0.5)
- Part58.Parent = Model3
- Part58.BrickColor = BrickColor.new("Dark stone grey")
- Part58.Anchored = true
- Part58.FormFactor = Enum.FormFactor.Symmetric
- Part58.Size = Vector3.new(1, 10, 1)
- Part58.CFrame = CFrame.new(34.4000015, 5.39990234, -59.2000084, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part58.BottomSurface = Enum.SurfaceType.Smooth
- Part58.TopSurface = Enum.SurfaceType.Smooth
- Part58.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part58.Position = Vector3.new(34.4000015, 5.39990234, -59.2000084)
- Part58.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Model59.Name = "JohnDoe"
- Model59.Parent = Model0
- Model59.PrimaryPart = Part60
- Part60.Name = "Head"
- Part60.Parent = Model59
- Part60.Material = Enum.Material.SmoothPlastic
- Part60.BrickColor = BrickColor.new("Cool yellow")
- Part60.Transparency = 1
- Part60.Rotation = Vector3.new(0, -0.610000014, 0)
- Part60.Velocity = Vector3.new(6.95388889, 0, -0.802138031)
- Part60.CanCollide = false
- Part60.Elasticity = 0
- Part60.FormFactor = Enum.FormFactor.Symmetric
- Part60.Friction = 0
- Part60.Size = Vector3.new(2, 1, 1)
- Part60.CFrame = CFrame.new(29.7974205, 5.39992809, -53.8519211, 0.999942839, 1.63869572e-05, -0.0106916232, -1.58438106e-05, 1, 5.08857556e-05, 0.0106916241, -5.071345e-05, 0.999942839)
- Part60.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- Part60.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part60.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part60.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- Part60.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- Part60.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- Part60.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part60.Position = Vector3.new(29.7974205, 5.39992809, -53.8519211)
- Part60.Orientation = Vector3.new(0, -0.610000014, 0)
- Part60.Color = Color3.new(0.992157, 0.917647, 0.552941)
- SpecialMesh61.Parent = Part60
- SpecialMesh61.Scale = Vector3.new(1.25, 1.25, 1.25)
- SpecialMesh61.Scale = Vector3.new(1.25, 1.25, 1.25)
- Sound62.Name = "Jeff_Step"
- Sound62.Parent = Part60
- Sound62.SoundId = "rbxassetid://379611235"
- Sound62.Volume = 1
- Script63.Name = "qPerfectionWeld"
- Script63.Parent = Part60
- table.insert(cors,sandbox(Script63,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))
- PointLight64.Parent = mas
- Sound65.Name = "Jeff_Susto2"
- Sound65.Parent = Part60
- Sound65.SoundId = "rbxassetid://703451104"
- Sound65.Volume = 10
- Sound66.Name = "Jeff_Laugh"
- Sound66.Parent = Part60
- Sound66.SoundId = "rbxassetid://468911141"
- Part67.Name = "Torso"
- Part67.Parent = Model59
- Part67.Material = Enum.Material.SmoothPlastic
- Part67.BrickColor = BrickColor.new("Bright yellow")
- Part67.Transparency = 1
- Part67.Rotation = Vector3.new(0, -0.610000014, 0)
- Part67.Velocity = Vector3.new(6.95388889, 0, -0.802138031)
- Part67.CanCollide = false
- Part67.Elasticity = 0
- Part67.FormFactor = Enum.FormFactor.Symmetric
- Part67.Friction = 2
- Part67.Size = Vector3.new(2, 2, 1)
- Part67.CFrame = CFrame.new(29.7973957, 3.89992809, -53.8518448, 0.999942839, 1.63869572e-05, -0.0106916232, -1.58438106e-05, 1, 5.08857556e-05, 0.0106916241, -5.071345e-05, 0.999942839)
- Part67.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- Part67.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part67.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part67.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- Part67.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- Part67.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- Part67.Color = Color3.new(0.960784, 0.803922, 0.188235)
- Part67.Position = Vector3.new(29.7973957, 3.89992809, -53.8518448)
- Part67.Orientation = Vector3.new(0, -0.610000014, 0)
- Part67.Color = Color3.new(0.960784, 0.803922, 0.188235)
- Decal68.Name = "roblox"
- Decal68.Parent = Part67
- Motor6D69.Name = "Right Shoulder"
- Motor6D69.Parent = Part67
- Motor6D69.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D69.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D69.Part0 = Part67
- Motor6D69.Part1 = Part79
- Motor6D69.MaxVelocity = 0.10000000149012
- Motor6D70.Name = "Left Shoulder"
- Motor6D70.Parent = Part67
- Motor6D70.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor6D70.C1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor6D70.Part0 = Part67
- Motor6D70.Part1 = Part78
- Motor6D70.MaxVelocity = 0.10000000149012
- Motor6D71.Name = "Right Hip"
- Motor6D71.Parent = Part67
- Motor6D71.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D71.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D71.Part0 = Part67
- Motor6D71.Part1 = Part82
- Motor6D71.MaxVelocity = 0.10000000149012
- Motor6D72.Name = "Left Hip"
- Motor6D72.Parent = Part67
- Motor6D72.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor6D72.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor6D72.Part0 = Part67
- Motor6D72.Part1 = Part81
- Motor6D72.MaxVelocity = 0.10000000149012
- Motor6D73.Name = "Neck"
- Motor6D73.Parent = Part67
- Motor6D73.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D73.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D73.Part0 = Part67
- Motor6D73.Part1 = Part60
- Motor6D73.MaxVelocity = 0.10000000149012
- Script74.Name = "qPerfectionWeld"
- Script74.Parent = Part67
- table.insert(cors,sandbox(Script74,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))
- Part75.Parent = Part67
- Part75.Material = Enum.Material.SmoothPlastic
- Part75.BrickColor = BrickColor.new("Cool yellow")
- Part75.Anchored = true
- Part75.Size = Vector3.new(0.819999576, 1.62999952, 0.880000174)
- Part75.CFrame = CFrame.new(28.4873962, 3.78946233, -54.7761269, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part75.BottomSurface = Enum.SurfaceType.Smooth
- Part75.TopSurface = Enum.SurfaceType.Smooth
- Part75.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part75.Position = Vector3.new(28.4873962, 3.78946233, -54.7761269)
- Part75.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part76.Parent = Part67
- Part76.Material = Enum.Material.SmoothPlastic
- Part76.BrickColor = BrickColor.new("Bright yellow")
- Part76.Rotation = Vector3.new(-30.9099998, 0, 0)
- Part76.Anchored = true
- Part76.Size = Vector3.new(1.88999903, 1.86999917, 0.880000174)
- Part76.CFrame = CFrame.new(29.8250484, 3.71242833, -54.3488007, 1, 0, 0, 0, 0.857937694, 0.513753831, 0, -0.513753831, 0.857937694)
- Part76.BottomSurface = Enum.SurfaceType.Smooth
- Part76.TopSurface = Enum.SurfaceType.Smooth
- Part76.Color = Color3.new(0.960784, 0.803922, 0.188235)
- Part76.Position = Vector3.new(29.8250484, 3.71242833, -54.3488007)
- Part76.Orientation = Vector3.new(-30.9099998, 0, 0)
- Part76.Color = Color3.new(0.960784, 0.803922, 0.188235)
- Part77.Parent = Part67
- Part77.Material = Enum.Material.SmoothPlastic
- Part77.BrickColor = BrickColor.new("Cool yellow")
- Part77.Anchored = true
- Part77.Size = Vector3.new(0.819999576, 1.62999952, 0.880000174)
- Part77.CFrame = CFrame.new(31.1939869, 3.77529454, -54.7761269, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part77.BottomSurface = Enum.SurfaceType.Smooth
- Part77.TopSurface = Enum.SurfaceType.Smooth
- Part77.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part77.Position = Vector3.new(31.1939869, 3.77529454, -54.7761269)
- Part77.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part78.Name = "Left Arm"
- Part78.Parent = Model59
- Part78.Material = Enum.Material.SmoothPlastic
- Part78.BrickColor = BrickColor.new("Cool yellow")
- Part78.Transparency = 1
- Part78.Rotation = Vector3.new(0, -0.610000014, 0)
- Part78.Velocity = Vector3.new(6.95388889, 0, -0.802138031)
- Part78.CanCollide = false
- Part78.Elasticity = 0
- Part78.FormFactor = Enum.FormFactor.Symmetric
- Part78.Friction = 2
- Part78.Size = Vector3.new(1, 2, 1)
- Part78.CFrame = CFrame.new(28.2974815, 3.89995193, -53.8678818, 0.999942839, 1.63869572e-05, -0.0106916232, -1.58438106e-05, 1, 5.08857556e-05, 0.0106916241, -5.071345e-05, 0.999942839)
- Part78.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- Part78.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part78.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part78.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- Part78.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- Part78.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- Part78.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part78.Position = Vector3.new(28.2974815, 3.89995193, -53.8678818)
- Part78.Orientation = Vector3.new(0, -0.610000014, 0)
- Part78.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part79.Name = "Right Arm"
- Part79.Parent = Model59
- Part79.Material = Enum.Material.SmoothPlastic
- Part79.BrickColor = BrickColor.new("Cool yellow")
- Part79.Transparency = 1
- Part79.Rotation = Vector3.new(0, -0.610000014, 0)
- Part79.Velocity = Vector3.new(6.95388889, 0, -0.802138031)
- Part79.CanCollide = false
- Part79.Elasticity = 0
- Part79.FormFactor = Enum.FormFactor.Symmetric
- Part79.Friction = 2
- Part79.Size = Vector3.new(1, 2, 1)
- Part79.CFrame = CFrame.new(31.2973099, 3.89990425, -53.8358078, 0.999942839, 1.63869572e-05, -0.0106916232, -1.58438106e-05, 1, 5.08857556e-05, 0.0106916241, -5.071345e-05, 0.999942839)
- Part79.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- Part79.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part79.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part79.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- Part79.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- Part79.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- Part79.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part79.Position = Vector3.new(31.2973099, 3.89990425, -53.8358078)
- Part79.Orientation = Vector3.new(0, -0.610000014, 0)
- Part79.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Weld80.Name = "RightGripWeld"
- Weld80.Parent = Part79
- Weld80.C0 = CFrame.new(-1.29999995, 1.16840947, 0.750634551, 1, 0, 0, 0, 0.968409479, 0.249365434, 0, -0.249365434, 0.968409479)
- Weld80.C1 = CFrame.new(-1.5, -0, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Weld80.Part0 = Part111
- Weld80.Part1 = Part79
- Part81.Name = "Left Leg"
- Part81.Parent = Model59
- Part81.Material = Enum.Material.SmoothPlastic
- Part81.BrickColor = BrickColor.new("Medium blue")
- Part81.Rotation = Vector3.new(0, -0.610000014, 0)
- Part81.Velocity = Vector3.new(6.95388889, 0, -0.802138031)
- Part81.CanCollide = false
- Part81.Elasticity = 0
- Part81.FormFactor = Enum.FormFactor.Symmetric
- Part81.Friction = 2
- Part81.Size = Vector3.new(1, 2, 1)
- Part81.CFrame = CFrame.new(29.2973919, 1.89993596, -53.85709, 0.999942839, 1.63869572e-05, -0.0106916232, -1.58438106e-05, 1, 5.08857556e-05, 0.0106916241, -5.071345e-05, 0.999942839)
- Part81.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- Part81.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part81.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part81.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- Part81.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- Part81.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- Part81.Color = Color3.new(0.431373, 0.6, 0.792157)
- Part81.Position = Vector3.new(29.2973919, 1.89993596, -53.85709)
- Part81.Orientation = Vector3.new(0, -0.610000014, 0)
- Part81.Color = Color3.new(0.431373, 0.6, 0.792157)
- Part82.Name = "Right Leg"
- Part82.Parent = Model59
- Part82.Material = Enum.Material.SmoothPlastic
- Part82.BrickColor = BrickColor.new("Medium blue")
- Part82.Rotation = Vector3.new(0, -0.610000014, 0)
- Part82.Velocity = Vector3.new(6.95388889, 0, -0.802138031)
- Part82.CanCollide = false
- Part82.Elasticity = 0
- Part82.FormFactor = Enum.FormFactor.Symmetric
- Part82.Friction = 2
- Part82.Size = Vector3.new(1, 2, 1)
- Part82.CFrame = CFrame.new(30.2973347, 1.89992023, -53.8463974, 0.999942839, 1.63869572e-05, -0.0106916232, -1.58438106e-05, 1, 5.08857556e-05, 0.0106916241, -5.071345e-05, 0.999942839)
- Part82.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- Part82.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part82.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part82.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- Part82.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- Part82.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- Part82.Color = Color3.new(0.431373, 0.6, 0.792157)
- Part82.Position = Vector3.new(30.2973347, 1.89992023, -53.8463974)
- Part82.Orientation = Vector3.new(0, -0.610000014, 0)
- Part82.Color = Color3.new(0.431373, 0.6, 0.792157)
- Humanoid83.Name = "ColdBloodedKiller"
- Humanoid83.Parent = Model59
- Humanoid83.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
- Humanoid83.HealthDisplayDistance = 0
- Humanoid83.NameDisplayDistance = 0
- Humanoid83.NameOcclusion = Enum.NameOcclusion.EnemyOcclusion
- Humanoid83.RightLeg = Part82
- Humanoid83.LeftLeg = Part81
- Humanoid83.Torso = Part86
- Humanoid83.Health = 500
- Humanoid83.MaxHealth = 500
- Model84.Name = "Status"
- Model84.Parent = Humanoid83
- Model85.Name = "AvalibleSpawns"
- Model85.Parent = Model84
- Part86.Name = "HumanoidRootPart"
- Part86.Parent = Model59
- Part86.Material = Enum.Material.SmoothPlastic
- Part86.BrickColor = BrickColor.new("Bright blue")
- Part86.Transparency = 1
- Part86.Rotation = Vector3.new(0, -0.610000014, 0)
- Part86.Velocity = Vector3.new(6.95388889, 0, -0.802138031)
- Part86.CanCollide = false
- Part86.Elasticity = 0
- Part86.FormFactor = Enum.FormFactor.Symmetric
- Part86.Friction = 0
- Part86.Size = Vector3.new(2, 2, 1)
- Part86.CFrame = CFrame.new(29.7973957, 3.89992809, -53.8518448, 0.999942839, 1.63869572e-05, -0.0106916232, -1.58438106e-05, 1, 5.08857556e-05, 0.0106916241, -5.071345e-05, 0.999942839)
- Part86.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- Part86.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part86.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part86.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- Part86.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- Part86.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- Part86.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Part86.Position = Vector3.new(29.7973957, 3.89992809, -53.8518448)
- Part86.Orientation = Vector3.new(0, -0.610000014, 0)
- Part86.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Motor6D87.Name = "RootJoint"
- Motor6D87.Parent = Part86
- Motor6D87.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D87.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D87.Part0 = Part86
- Motor6D87.Part1 = Part67
- Motor6D87.MaxVelocity = 0.10000000149012
- Script88.Name = "Health"
- Script88.Parent = Model59
- table.insert(cors,sandbox(Script88,function()
- --Responsible for regening a player's humanoid's health
- -- declarations
- local Figure = script.Parent
- local Head = Figure:WaitForChild("Head")
- local Humanoid;
- for _,Child in pairs(Figure:GetChildren())do
- if Child and Child.ClassName=="Humanoid"then
- Humanoid=Child;
- end;
- end;
- local regening = false
- -- regeneration
- function regenHealth()
- if regening then return end
- regening = true
- while Humanoid.Health < Humanoid.MaxHealth do
- local s = wait(1)
- local health = Humanoid.Health
- if health~=0 and health < Humanoid.MaxHealth then
- local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
- health = health + newHealthDelta
- Humanoid.Health = math.min(health,Humanoid.MaxHealth)
- end
- end
- if Humanoid.Health > Humanoid.MaxHealth then
- Humanoid.Health = Humanoid.MaxHealth
- end
- regening = false
- end
- Humanoid.HealthChanged:connect(regenHealth)
- end))
- Script89.Name = "AnimateSauce"
- Script89.Parent = Model59
- table.insert(cors,sandbox(Script89,function()
- function waitForChild(parent, childName)
- local child = parent:findFirstChild(childName)
- if child then return child end
- while true do
- child = parent.ChildAdded:wait()
- if child.Name==childName then return child end
- end
- end
- local Figure = script.Parent
- local Torso = waitForChild(Figure, "Torso")
- local RightShoulder = waitForChild(Torso, "Right Shoulder")
- local LeftShoulder = waitForChild(Torso, "Left Shoulder")
- local RightHip = waitForChild(Torso, "Right Hip")
- local LeftHip = waitForChild(Torso, "Left Hip")
- local Neck = waitForChild(Torso, "Neck")
- local Humanoid;
- for _,Child in pairs(Figure:GetChildren())do
- if Child and Child.ClassName=="Humanoid"then
- Humanoid=Child;
- end;
- end;
- local pose = "Standing"
- local currentAnim = ""
- local currentAnimInstance = nil
- local currentAnimTrack = nil
- local currentAnimKeyframeHandler = nil
- local currentAnimSpeed = 1.0
- local animTable = {}
- local animNames = {
- idle = {
- { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
- { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
- },
- walk = {
- { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
- },
- run = {
- { id = "http://www.roblox.com/asset/?id=252557606", weight = 20 }
- },
- jump = {
- { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
- },
- fall = {
- { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
- },
- climb = {
- { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
- },
- sit = {
- { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
- },
- toolnone = {
- { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
- },
- toolslash = {
- { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
- --{ id = "slash.xml", weight = 10 }
- },
- toollunge = {
- { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
- },
- wave = {
- { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
- },
- point = {
- { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
- },
- dance1 = {
- { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
- },
- dance2 = {
- { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
- },
- dance3 = {
- { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
- },
- laugh = {
- { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
- },
- cheer = {
- { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
- },
- }
- local dances = {"dance1", "dance2", "dance3"}
- -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
- local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
- function configureAnimationSet(name, fileList)
- if (animTable[name] ~= nil) then
- for _, connection in pairs(animTable[name].connections) do
- connection:disconnect()
- end
- end
- animTable[name] = {}
- animTable[name].count = 0
- animTable[name].totalWeight = 0
- animTable[name].connections = {}
- -- check for config values
- local config = script:FindFirstChild(name)
- if (config ~= nil) then
- --print("Loading anims " .. name)
- table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
- table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
- local idx = 1
- for _, childPart in pairs(config:GetChildren()) do
- if (childPart:IsA("Animation")) then
- table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
- animTable[name][idx] = {}
- animTable[name][idx].anim = childPart
- local weightObject = childPart:FindFirstChild("Weight")
- if (weightObject == nil) then
- animTable[name][idx].weight = 1
- else
- animTable[name][idx].weight = weightObject.Value
- end
- animTable[name].count = animTable[name].count + 1
- animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
- --print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
- idx = idx + 1
- end
- end
- end
- -- fallback to defaults
- if (animTable[name].count <= 0) then
- for idx, anim in pairs(fileList) do
- animTable[name][idx] = {}
- animTable[name][idx].anim = Instance.new("Animation")
- animTable[name][idx].anim.Name = name
- animTable[name][idx].anim.AnimationId = anim.id
- animTable[name][idx].weight = anim.weight
- animTable[name].count = animTable[name].count + 1
- animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
- --print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
- end
- end
- end
- -- Setup animation objects
- function scriptChildModified(child)
- local fileList = animNames[child.Name]
- if (fileList ~= nil) then
- configureAnimationSet(child.Name, fileList)
- end
- end
- script.ChildAdded:connect(scriptChildModified)
- script.ChildRemoved:connect(scriptChildModified)
- for name, fileList in pairs(animNames) do
- configureAnimationSet(name, fileList)
- end
- -- ANIMATION
- -- declarations
- local toolAnim = "None"
- local toolAnimTime = 0
- local jumpAnimTime = 0
- local jumpAnimDuration = 0.3
- local toolTransitionTime = 0.1
- local fallTransitionTime = 0.3
- local jumpMaxLimbVelocity = 0.75
- -- functions
- function stopAllAnimations()
- local oldAnim = currentAnim
- -- return to idle if finishing an emote
- if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
- oldAnim = "idle"
- end
- currentAnim = ""
- currentAnimInstance = nil
- if (currentAnimKeyframeHandler ~= nil) then
- currentAnimKeyframeHandler:disconnect()
- end
- if (currentAnimTrack ~= nil) then
- currentAnimTrack:Stop()
- currentAnimTrack:Destroy()
- currentAnimTrack = nil
- end
- return oldAnim
- end
- function setAnimationSpeed(speed)
- if speed ~= currentAnimSpeed then
- currentAnimSpeed = speed
- currentAnimTrack:AdjustSpeed(currentAnimSpeed)
- end
- end
- function keyFrameReachedFunc(frameName)
- if (frameName == "End") then
- local repeatAnim = currentAnim
- -- return to idle if finishing an emote
- if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
- repeatAnim = "idle"
- end
- local animSpeed = currentAnimSpeed
- playAnimation(repeatAnim, 0.0, Humanoid)
- setAnimationSpeed(animSpeed)
- end
- end
- -- Preload animations
- function playAnimation(animName, transitionTime, humanoid)
- local roll = math.random(1, animTable[animName].totalWeight)
- local origRoll = roll
- local idx = 1
- while (roll > animTable[animName][idx].weight) do
- roll = roll - animTable[animName][idx].weight
- idx = idx + 1
- end
- --print(animName .. " " .. idx .. " [" .. origRoll .. "]")
- local anim = animTable[animName][idx].anim
- -- switch animation
- if (anim ~= currentAnimInstance) then
- if (currentAnimTrack ~= nil) then
- currentAnimTrack:Stop(transitionTime)
- currentAnimTrack:Destroy()
- end
- currentAnimSpeed = 1.0
- -- load it to the humanoid; get AnimationTrack
- currentAnimTrack = humanoid:LoadAnimation(anim)
- -- play the animation
- currentAnimTrack:Play(transitionTime)
- currentAnim = animName
- currentAnimInstance = anim
- -- set up keyframe name triggers
- if (currentAnimKeyframeHandler ~= nil) then
- currentAnimKeyframeHandler:disconnect()
- end
- currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
- end
- end
- -------------------------------------------------------------------------------------------
- -------------------------------------------------------------------------------------------
- local toolAnimName = ""
- local toolAnimTrack = nil
- local toolAnimInstance = nil
- local currentToolAnimKeyframeHandler = nil
- function toolKeyFrameReachedFunc(frameName)
- if (frameName == "End") then
- --print("Keyframe : ".. frameName)
- playToolAnimation(toolAnimName, 0.0, Humanoid)
- end
- end
- function playToolAnimation(animName, transitionTime, humanoid)
- local roll = math.random(1, animTable[animName].totalWeight)
- local origRoll = roll
- local idx = 1
- while (roll > animTable[animName][idx].weight) do
- roll = roll - animTable[animName][idx].weight
- idx = idx + 1
- end
- --print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
- local anim = animTable[animName][idx].anim
- if (toolAnimInstance ~= anim) then
- if (toolAnimTrack ~= nil) then
- toolAnimTrack:Stop()
- toolAnimTrack:Destroy()
- transitionTime = 0
- end
- -- load it to the humanoid; get AnimationTrack
- toolAnimTrack = humanoid:LoadAnimation(anim)
- -- play the animation
- toolAnimTrack:Play(transitionTime)
- toolAnimName = animName
- toolAnimInstance = anim
- currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
- end
- end
- function stopToolAnimations()
- local oldAnim = toolAnimName
- if (currentToolAnimKeyframeHandler ~= nil) then
- currentToolAnimKeyframeHandler:disconnect()
- end
- toolAnimName = ""
- toolAnimInstance = nil
- if (toolAnimTrack ~= nil) then
- toolAnimTrack:Stop()
- toolAnimTrack:Destroy()
- toolAnimTrack = nil
- end
- return oldAnim
- end
- -------------------------------------------------------------------------------------------
- -------------------------------------------------------------------------------------------
- function onRunning(speed)
- if speed>0.01 then
- if Figure and Humanoid and Humanoid.WalkSpeed<17 then
- playAnimation("walk", 0.1, Humanoid);
- elseif Figure and Humanoid and Humanoid.WalkSpeed>17 then
- playAnimation("run", 0.1, Humanoid);
- end;
- if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
- setAnimationSpeed(speed / 14.5)
- end
- pose = "Running"
- else
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- end
- end
- function onDied()
- pose = "Dead"
- end
- function onJumping()
- playAnimation("jump", 0.1, Humanoid)
- jumpAnimTime = jumpAnimDuration
- pose = "Jumping"
- end
- function onClimbing(speed)
- playAnimation("climb", 0.1, Humanoid)
- setAnimationSpeed(speed / 12.0)
- pose = "Climbing"
- end
- function onGettingUp()
- pose = "GettingUp"
- end
- function onFreeFall()
- if (jumpAnimTime <= 0) then
- playAnimation("fall", fallTransitionTime, Humanoid)
- end
- pose = "FreeFall"
- end
- function onFallingDown()
- pose = "FallingDown"
- end
- function onSeated()
- pose = "Seated"
- end
- function onPlatformStanding()
- pose = "PlatformStanding"
- end
- function onSwimming(speed)
- if speed>0 then
- pose = "Running"
- else
- pose = "Standing"
- end
- end
- function getTool()
- for _, kid in ipairs(Figure:GetChildren()) do
- if kid.className == "Tool" then return kid end
- end
- return nil
- end
- function getToolAnim(tool)
- for _, c in ipairs(tool:GetChildren()) do
- if c.Name == "toolanim" and c.className == "StringValue" then
- return c
- end
- end
- return nil
- end
- function animateTool()
- if (toolAnim == "None") then
- playToolAnimation("toolnone", toolTransitionTime, Humanoid)
- return
- end
- if (toolAnim == "Slash") then
- playToolAnimation("toolslash", 0, Humanoid)
- return
- end
- if (toolAnim == "Lunge") then
- playToolAnimation("toollunge", 0, Humanoid)
- return
- end
- end
- function moveSit()
- RightShoulder.MaxVelocity = 0.15
- LeftShoulder.MaxVelocity = 0.15
- RightShoulder:SetDesiredAngle(3.14 /2)
- LeftShoulder:SetDesiredAngle(-3.14 /2)
- RightHip:SetDesiredAngle(3.14 /2)
- LeftHip:SetDesiredAngle(-3.14 /2)
- end
- local lastTick = 0
- function move(time)
- local amplitude = 1
- local frequency = 1
- local deltaTime = time - lastTick
- lastTick = time
- local climbFudge = 0
- local setAngles = false
- if (jumpAnimTime > 0) then
- jumpAnimTime = jumpAnimTime - deltaTime
- end
- if (pose == "FreeFall" and jumpAnimTime <= 0) then
- playAnimation("fall", fallTransitionTime, Humanoid)
- elseif (pose == "Seated") then
- playAnimation("sit", 0.5, Humanoid)
- return
- elseif (pose == "Running") then
- if Figure and Humanoid and Humanoid.WalkSpeed<17 then
- playAnimation("walk", 0.1, Humanoid);
- elseif Figure and Humanoid and Humanoid.WalkSpeed>17 then
- playAnimation("run", 0.1, Humanoid);
- end;
- elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
- stopAllAnimations()
- amplitude = 0.1
- frequency = 1
- setAngles = true
- end
- if (setAngles) then
- local desiredAngle = amplitude * math.sin(time * frequency)
- RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
- LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
- RightHip:SetDesiredAngle(-desiredAngle)
- LeftHip:SetDesiredAngle(-desiredAngle)
- end
- -- Tool Animation handling
- local tool = getTool()
- if tool and tool:FindFirstChild("Handle") then
- local animStringValueObject = getToolAnim(tool)
- if animStringValueObject then
- toolAnim = animStringValueObject.Value
- -- message recieved, delete StringValue
- animStringValueObject.Parent = nil
- toolAnimTime = time + .3
- end
- if time > toolAnimTime then
- toolAnimTime = 0
- toolAnim = "None"
- end
- animateTool()
- else
- stopToolAnimations()
- toolAnim = "None"
- toolAnimInstance = nil
- toolAnimTime = 0
- end
- end
- -- connect events
- Humanoid.Died:connect(onDied)
- Humanoid.Running:connect(onRunning)
- Humanoid.Jumping:connect(onJumping)
- Humanoid.Climbing:connect(onClimbing)
- Humanoid.GettingUp:connect(onGettingUp)
- Humanoid.FreeFalling:connect(onFreeFall)
- Humanoid.FallingDown:connect(onFallingDown)
- Humanoid.Seated:connect(onSeated)
- Humanoid.PlatformStanding:connect(onPlatformStanding)
- Humanoid.Swimming:connect(onSwimming)
- local runService = game:GetService("RunService");
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- while Wait(0)do
- local _,time=wait(0)
- move(time)
- end
- end))
- StringValue90.Name = "climb"
- StringValue90.Parent = Script89
- Animation91.Name = "ClimbAnim"
- Animation91.Parent = StringValue90
- Animation91.AnimationId = "http://www.roblox.com/asset/?id=180436334"
- StringValue92.Name = "fall"
- StringValue92.Parent = Script89
- Animation93.Name = "FallAnim"
- Animation93.Parent = StringValue92
- Animation93.AnimationId = "http://www.roblox.com/asset/?id=180436148"
- StringValue94.Name = "idle"
- StringValue94.Parent = Script89
- Animation95.Name = "Animation1"
- Animation95.Parent = StringValue94
- Animation95.AnimationId = "http://www.roblox.com/asset/?id=180435571"
- NumberValue96.Name = "Weight"
- NumberValue96.Parent = Animation95
- NumberValue96.Value = 9
- Animation97.Name = "Animation2"
- Animation97.Parent = StringValue94
- Animation97.AnimationId = "http://www.roblox.com/asset/?id=180435792"
- NumberValue98.Name = "Weight"
- NumberValue98.Parent = Animation97
- NumberValue98.Value = 1
- StringValue99.Name = "jump"
- StringValue99.Parent = Script89
- Animation100.Name = "JumpAnim"
- Animation100.Parent = StringValue99
- Animation100.AnimationId = "http://www.roblox.com/asset/?id=125750702"
- StringValue101.Name = "run"
- StringValue101.Parent = Script89
- Animation102.Name = "RunAnim"
- Animation102.Parent = StringValue101
- Animation102.AnimationId = "http://www.roblox.com/asset/?id=252557606"
- StringValue103.Name = "sit"
- StringValue103.Parent = Script89
- Animation104.Name = "SitAnim"
- Animation104.Parent = StringValue103
- Animation104.AnimationId = "http://www.roblox.com/asset/?id=178130996"
- StringValue105.Name = "toolnone"
- StringValue105.Parent = Script89
- Animation106.Name = "ToolNoneAnim"
- Animation106.Parent = StringValue105
- Animation106.AnimationId = "http://www.roblox.com/asset/?id=182393478"
- StringValue107.Name = "walk"
- StringValue107.Parent = Script89
- Animation108.Name = "WalkAnim"
- Animation108.Parent = StringValue107
- Animation108.AnimationId = "http://www.roblox.com/asset/?id=180426354"
- Animation109.Name = "Swing"
- Animation109.Parent = Model59
- Animation109.AnimationId = "rbxassetid://54584713"
- Script110.Name = "JeffTheKillerMain"
- Script110.Parent = Model59
- table.insert(cors,sandbox(Script110,function()
- --[[ By: Brutez. ]]--
- local JeffTheKillerScript=script;
- repeat Wait(0)until JeffTheKillerScript and JeffTheKillerScript.Parent and JeffTheKillerScript.Parent.ClassName=="Model"and JeffTheKillerScript.Parent:FindFirstChild("Head")and JeffTheKillerScript.Parent:FindFirstChild("Torso");
- local JeffTheKiller=JeffTheKillerScript.Parent;
- function raycast(Spos,vec,currentdist)
- local hit2,pos2=game.Workspace:FindPartOnRay(Ray.new(Spos+(vec*.05),vec*currentdist),JeffTheKiller);
- if hit2~=nil and pos2 then
- if hit2.Name=="Handle" and not hit2.CanCollide or string.sub(hit2.Name,1,6)=="Effect"and not hit2.CanCollide then
- local currentdist=currentdist-(pos2-Spos).magnitude;
- return raycast(pos2,vec,currentdist);
- end;
- end;
- return hit2,pos2;
- end;
- function RayCast(Position,Direction,MaxDistance,IgnoreList)
- return Game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(Position,Direction.unit*(MaxDistance or 999.999)),IgnoreList);
- end;
- --[[if JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Thumbnail")then]]--
- --[[JeffTheKiller:FindFirstChild("Thumbnail"):Destroy();]]--
- --[[end;]]--
- local JeffTheKillerHumanoid;
- for _,Child in pairs(JeffTheKiller:GetChildren())do
- if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
- JeffTheKillerHumanoid=Child;
- end;
- end;
- local AttackDebounce=false;
- local JeffTheKillerKnife=JeffTheKiller:FindFirstChild("Knife");
- local JeffTheKillerHead=JeffTheKiller:FindFirstChild("Head");
- local JeffTheKillerHumanoidRootPart=JeffTheKiller:FindFirstChild("HumanoidRootPart");
- local WalkDebounce=false;
- local Notice=false;
- local JeffLaughDebounce=false;
- local MusicDebounce=false;
- local NoticeDebounce=false;
- local ChosenMusic;
- JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0,1,0,1,-0);
- local OriginalC0=JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0;
- function FindNearestBae()
- local NoticeDistance=100;
- local TargetMain;
- for _,TargetModel in pairs(Game:GetService("Workspace"):GetChildren())do
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and TargetModel.className=="Model"and TargetModel~=JeffTheKiller and TargetModel.Name~=JeffTheKiller.Name and TargetModel:FindFirstChild("Torso")and TargetModel:FindFirstChild("Head")then
- local TargetPart=TargetModel:FindFirstChild("Torso");
- local FoundHumanoid;
- for _,Child in pairs(TargetModel:GetChildren())do
- if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
- FoundHumanoid=Child;
- end;
- end;
- if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<NoticeDistance then
- TargetMain=TargetPart;
- NoticeDistance=(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude;
- local hit,pos=raycast(JeffTheKillerHumanoidRootPart.Position,(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).unit,500)
- if hit and hit.Parent and hit.Parent.ClassName=="Model"and hit.Parent:FindFirstChild("Torso")and hit.Parent:FindFirstChild("Head")then
- if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<9 and not AttackDebounce then
- Spawn(function()
- AttackDebounce=true;
- local SwingAnimation=JeffTheKillerHumanoid:LoadAnimation(JeffTheKiller:FindFirstChild("Swing"));
- local SwingChoice=math.random(1,2);
- local HitChoice=math.random(1,3);
- SwingAnimation:Play();
- SwingAnimation:AdjustSpeed(3.5+(math.random()*0.1));
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Swing")then
- local SwingSound=JeffTheKillerKnife:FindFirstChild("Swing");
- SwingSound.Pitch=1+(math.random()*0.04);
- SwingSound:Play();
- end;
- Wait(0.3);
- if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<8 then
- FoundHumanoid:TakeDamage(90);
- if HitChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit1")then
- local HitSound=JeffTheKillerKnife:FindFirstChild("Hit1");
- HitSound.Pitch=1+(math.random()*0.04);
- HitSound:Play();
- elseif HitChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit2")then
- local HitSound=JeffTheKillerKnife:FindFirstChild("Hit2");
- HitSound.Pitch=1+(math.random()*0.04);
- HitSound:Play();
- elseif HitChoice==3 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit3")then
- local HitSound=JeffTheKillerKnife:FindFirstChild("Hit3");
- HitSound.Pitch=1+(math.random()*0.04);
- HitSound:Play();
- end;
- end;
- Wait(0.1);
- AttackDebounce=false;
- end);
- end;
- end;
- end;
- end;
- end;
- return TargetMain;
- end;
- while Wait(0)do
- local TargetPoint=JeffTheKillerHumanoid.TargetPoint;
- local Blockage,BlockagePos=RayCast((JeffTheKillerHumanoidRootPart.CFrame+CFrame.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(TargetPoint.X,JeffTheKillerHumanoidRootPart.Position.Y,TargetPoint.Z)).lookVector*(JeffTheKillerHumanoidRootPart.Size.Z/2)).p,JeffTheKillerHumanoidRootPart.CFrame.lookVector,(JeffTheKillerHumanoidRootPart.Size.Z*2.5),{JeffTheKiller,JeffTheKiller})
- local Jumpable=false;
- if Blockage then
- Jumpable=true;
- if Blockage and Blockage.Parent and Blockage.Parent.ClassName~="Workspace"then
- local BlockageHumanoid;
- for _,Child in pairs(Blockage.Parent:GetChildren())do
- if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
- BlockageHumanoid=Child;
- end;
- end;
- if Blockage and Blockage:IsA("Terrain")then
- local CellPos=Blockage:WorldToCellPreferSolid((BlockagePos-Vector3.new(0,2,0)));
- local CellMaterial,CellShape,CellOrientation=Blockage:GetCell(CellPos.X,CellPos.Y,CellPos.Z);
- if CellMaterial==Enum.CellMaterial.Water then
- Jumpable=false;
- end;
- elseif BlockageHumanoid or Blockage.ClassName=="TrussPart"or Blockage.ClassName=="WedgePart"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Hat"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Tool"then
- Jumpable=false;
- end;
- end;
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and not JeffTheKillerHumanoid.Sit and Jumpable then
- JeffTheKillerHumanoid.Jump=true;
- end;
- end;
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHumanoidRootPart and JeffTheKillerHead:FindFirstChild("Jeff_Step")and (JeffTheKillerHumanoidRootPart.Velocity-Vector3.new(0,JeffTheKillerHumanoidRootPart.Velocity.y,0)).magnitude>=5 and not WalkDebounce and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
- Spawn(function()
- WalkDebounce=true;
- local FiredRay=Ray.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(0,-4,0));
- local RayTarget,endPoint=Game:GetService("Workspace"):FindPartOnRay(FiredRay,JeffTheKiller);
- if RayTarget then
- local JeffTheKillerHeadFootStepClone=JeffTheKillerHead:FindFirstChild("Jeff_Step"):Clone();
- JeffTheKillerHeadFootStepClone.Parent=JeffTheKillerHead;
- JeffTheKillerHeadFootStepClone:Play();
- JeffTheKillerHeadFootStepClone:Destroy();
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed<17 then
- Wait(0.4);
- elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed>17 then
- Wait(0.15);
- end
- end;
- WalkDebounce=false;
- end);
- end;
- local MainTarget=FindNearestBae();
- local FoundHumanoid;
- if MainTarget then
- for _,Child in pairs(MainTarget.Parent:GetChildren())do
- if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
- FoundHumanoid=Child;
- end;
- end;
- end;
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and MainTarget.Parent and FoundHumanoid and FoundHumanoid.Jump then
- JeffTheKillerHumanoid.Jump=true;
- end;
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<25 then
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")and not JeffTheKillerHead:FindFirstChild("Jeff_Laugh").IsPlaying then
- JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=1;
- JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Play();
- end;
- elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>25 then
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")and JeffTheKillerHead:FindFirstChild("Jeff_Laugh").IsPlaying then
- if not JeffLaughDebounce then
- Spawn(function()
- JeffLaughDebounce=true;
- repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")then JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume==0 or JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume<0;
- JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=0;
- JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Stop();
- JeffLaughDebounce=false;
- end);
- end;
- end;
- end;
- if not ChosenMusic and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<50 then
- local MusicChoice=math.random(1,2);
- if MusicChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1")then
- ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1");
- elseif MusicChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2")then
- ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2");
- end;
- if JeffTheKillerScript and JeffTheKiller and ChosenMusic and not ChosenMusic.IsPlaying then
- ChosenMusic.Volume=0.5;
- ChosenMusic:Play();
- end;
- elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>50 then
- if JeffTheKillerScript and JeffTheKiller and ChosenMusic and ChosenMusic.IsPlaying then
- if not MusicDebounce then
- Spawn(function()
- MusicDebounce=true;
- repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0;
- if ChosenMusic then
- ChosenMusic.Volume=0;
- ChosenMusic:Stop();
- end;
- ChosenMusic=nil;
- MusicDebounce=false;
- end);
- end;
- end;
- end;
- if not MainTarget and not JeffLaughDebounce then
- Spawn(function()
- JeffLaughDebounce=true;
- repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")then JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume==0 or JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume<0;
- JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=0;
- JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Stop();
- JeffLaughDebounce=false;
- end);
- end;
- if not MainTarget and not MusicDebounce then
- Spawn(function()
- MusicDebounce=true;
- repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0;
- if ChosenMusic then
- ChosenMusic.Volume=0;
- ChosenMusic:Stop();
- end;
- ChosenMusic=nil;
- MusicDebounce=false;
- end);
- end;
- if MainTarget then
- Notice=true;
- if Notice and not NoticeDebounce and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Susto2")then
- JeffTheKillerHead:FindFirstChild("Jeff_Susto2"):Play();
- NoticeDebounce=true;
- end
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
- if MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>5 then
- JeffTheKillerHumanoid.WalkSpeed=16;
- elseif MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<5 then
- JeffTheKillerHumanoid.WalkSpeed=0.004;
- end;
- JeffTheKillerHumanoid:MoveTo(MainTarget.Position+(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).unit*2,Game:GetService("Workspace"):FindFirstChild("Terrain"));
- local NeckRotation=(JeffTheKiller:FindFirstChild("Torso").Position.Y-MainTarget.Parent:FindFirstChild("Head").Position.Y)/10;
- if NeckRotation>-1.5 and NeckRotation<1.5 then
- JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=OriginalC0*CFrame.fromEulerAnglesXYZ(NeckRotation,0,0);
- end;
- if NeckRotation<-1.5 then
- JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,-0.993636549,0.112633869,0,0.112633869,0.993636549);
- elseif NeckRotation>1.5 then
- JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0.996671617,0.081521146,0,0.081521146,-0.996671617);
- end;
- else
- end;
- else
- Notice=false;
- NoticeDebounce=false;
- JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0,1,0,1,-0);
- local RandomWalk=math.random(1,150);
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
- JeffTheKillerHumanoid.WalkSpeed=30;
- if RandomWalk==1 then
- JeffTheKillerHumanoid:MoveTo(Game:GetService("Workspace"):FindFirstChild("Terrain").Position+Vector3.new(math.random(-2048,2048),0,math.random(-2048,2048)),Game:GetService("Workspace"):FindFirstChild("Terrain"));
- end;
- end;
- end;
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid then
- JeffTheKillerHumanoid.DisplayDistanceType="None";
- JeffTheKillerHumanoid.HealthDisplayDistance=0;
- JeffTheKillerHumanoid.Name="ColdBloodedKiller";
- JeffTheKillerHumanoid.NameDisplayDistance=0;
- JeffTheKillerHumanoid.NameOcclusion="EnemyOcclusion";
- JeffTheKillerHumanoid.AutoJumpEnabled=true;
- JeffTheKillerHumanoid.AutoRotate=true;
- JeffTheKillerHumanoid.MaxHealth=500;
- JeffTheKillerHumanoid.JumpPower=60;
- JeffTheKillerHumanoid.MaxSlopeAngle=89.9;
- end;
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoJumpEnabled then
- JeffTheKillerHumanoid.AutoJumpEnabled=true;
- end;
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoRotate then
- JeffTheKillerHumanoid.AutoRotate=true;
- end;
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.PlatformStand then
- JeffTheKillerHumanoid.PlatformStand=false;
- end;
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Sit then
- JeffTheKillerHumanoid.Sit=false;
- end;
- end;
- --[[ By: Brutez. ]]--
- end))
- Part111.Name = "Knife"
- Part111.Parent = Model59
- Part111.Material = Enum.Material.Metal
- Part111.BrickColor = BrickColor.new("Mid gray")
- Part111.Transparency = 1
- Part111.Rotation = Vector3.new(14.4399996, -0.589999974, 0.149999991)
- Part111.Velocity = Vector3.new(6.95388889, 0, -0.802138031)
- Part111.CanCollide = false
- Part111.Elasticity = 0
- Part111.FormFactor = Enum.FormFactor.Custom
- Part111.Friction = 2
- Part111.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
- Part111.CFrame = CFrame.new(31.1081924, 2.95553923, -54.8561211, 0.999942839, -0.00265025208, -0.0103579555, -1.58438106e-05, 0.968422174, -0.249316156, 0.0106916241, 0.249302059, 0.968366742)
- Part111.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- Part111.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part111.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- Part111.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- Part111.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- Part111.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- Part111.Color = Color3.new(0.803922, 0.803922, 0.803922)
- Part111.Position = Vector3.new(31.1081924, 2.95553923, -54.8561211)
- Part111.Orientation = Vector3.new(14.4399996, -0.610000014, 0)
- Part111.Color = Color3.new(0.803922, 0.803922, 0.803922)
- SpecialMesh112.Name = "KnifeMesh"
- SpecialMesh112.Parent = Part111
- SpecialMesh112.MeshId = "rbxassetid://165710339"
- SpecialMesh112.Scale = Vector3.new(0.5, 0.5, 0.699999988)
- SpecialMesh112.TextureId = "rbxassetid://381626146"
- SpecialMesh112.MeshType = Enum.MeshType.FileMesh
- SpecialMesh112.Scale = Vector3.new(0.5, 0.5, 0.699999988)
- Sound113.Name = "Hit2"
- Sound113.Parent = Part111
- Sound113.SoundId = "rbxassetid://223103466"
- Sound114.Name = "Hit3"
- Sound114.Parent = Part111
- Sound114.SoundId = "rbxassetid://223103466"
- Sound115.Name = "Hit1"
- Sound115.Parent = Part111
- Sound115.SoundId = "rbxassetid://223103466"
- Sound116.Name = "Swing"
- Sound116.Parent = Part111
- Sound116.SoundId = "rbxassetid://176238381"
- Script117.Name = "Respawn"
- Script117.Parent = Model59
- table.insert(cors,sandbox(Script117,function()
- --[[ By: Brutez, 2/28/2015, 1:34 AM, (UTC-08:00) Pacific Time (US & Canada) ]]--
- local PlayerSpawning=false; --[[ Change this to true if you want the NPC to spawn like a player, and change this to false if you want the NPC to spawn at it's current position. ]]--
- local AdvancedRespawnScript=script;
- repeat Wait(0)until script and script.Parent and script.Parent.ClassName=="Model";
- local JeffTheKiller=AdvancedRespawnScript.Parent;
- if AdvancedRespawnScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Thumbnail")then
- JeffTheKiller:FindFirstChild("Thumbnail"):Destroy();
- end;
- local GameDerbis=Game:GetService("Debris");
- local JeffTheKillerHumanoid;
- for _,Child in pairs(JeffTheKiller:GetChildren())do
- if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
- JeffTheKillerHumanoid=Child;
- end;
- end;
- local Respawndant=JeffTheKiller:Clone();
- if PlayerSpawning then --[[ LOOK AT LINE: 2. ]]--
- coroutine.resume(coroutine.create(function()
- if JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid:FindFirstChild("Status")and not JeffTheKillerHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns")then
- SpawnModel=Instance.new("Model");
- SpawnModel.Parent=JeffTheKillerHumanoid.Status;
- SpawnModel.Name="AvalibleSpawns";
- else
- SpawnModel=JeffTheKillerHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns");
- end;
- function FindSpawn(SearchValue)
- local PartsArchivable=SearchValue:GetChildren();
- for AreaSearch=1,#PartsArchivable do
- if PartsArchivable[AreaSearch].className=="SpawnLocation"then
- local PositionValue=Instance.new("Vector3Value",SpawnModel);
- PositionValue.Value=PartsArchivable[AreaSearch].Position;
- PositionValue.Name=PartsArchivable[AreaSearch].Duration;
- end;
- FindSpawn(PartsArchivable[AreaSearch]);
- end;
- end;
- FindSpawn(Game:GetService("Workspace"));
- local SpawnChilden=SpawnModel:GetChildren();
- if#SpawnChilden>0 then
- local SpawnItself=SpawnChilden[math.random(1,#SpawnChilden)];
- local RespawningForceField=Instance.new("ForceField");
- RespawningForceField.Parent=JeffTheKiller;
- RespawningForceField.Name="SpawnForceField";
- GameDerbis:AddItem(RespawningForceField,SpawnItself.Name);
- JeffTheKiller:MoveTo(SpawnItself.Value+Vector3.new(0,3.5,0));
- else
- if JeffTheKiller:FindFirstChild("SpawnForceField")then
- JeffTheKiller:FindFirstChild("SpawnForceField"):Destroy();
- end;
- JeffTheKiller:MoveTo(Vector3.new(0,115,0));
- end;
- end));
- end;
- function Respawn()
- Wait(5);
- Respawndant.Parent=JeffTheKiller.Parent;
- Respawndant:makeJoints();
- Respawndant:FindFirstChild("Head"):MakeJoints();
- Respawndant:FindFirstChild("Torso"):MakeJoints();
- JeffTheKiller:remove();
- end;
- if AdvancedRespawnScript and JeffTheKiller and JeffTheKillerHumanoid then
- JeffTheKillerHumanoid.Died:connect(Respawn);
- end;
- --[[ By: Brutez, 2/28/2015, 1:34 AM, (UTC-08:00) Pacific Time (US & Canada) ]]--
- end))
- BodyColors118.Parent = Model59
- BodyColors118.LeftLegColor = BrickColor.new("Medium blue")
- BodyColors118.RightLegColor = BrickColor.new("Medium blue")
- BodyColors118.TorsoColor = BrickColor.new("Bright yellow")
- Sound119.Name = "Jeff_Scene_Sound2"
- Sound119.Parent = Model59
- Sound119.SoundId = "rbxassetid://656235613"
- Sound119.Volume = 1
- Sound119.Looped = true
- 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