Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Converted using Mokiros's Model to Script plugin
- -- Converted string size: 7327
- local genv={}
- local Scripts = {
- 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;
- function() -- Script by XcorrectTheDev
- local AlreadyRandom = false
- local PitchSet = false
- while wait() do
- if script.Parent.IsPlaying then
- wait(5)
- local RandomSound = math.random(1,3)
- if RandomSound == 1 or 3 and not AlreadyRandom then
- AlreadyRandom = true
- script.Parent.PlaybackSpeed = math.random(0.8,0.85)
- PitchSet = true
- end
- if RandomSound == 2 and not AlreadyRandom then
- AlreadyRandom = true
- script.Parent.PlaybackSpeed = math.random(0.85,0.8)
- PitchSet = true
- end
- end
- end
- spawn(function()
- while wait() do
- if PitchSet then
- if script.Parent.IsPlaying then
- AlreadyRandom = false
- PitchSet = false
- end
- end
- end
- end)
- end;
- 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;
- function() -- Script by XcorrectTheDev
- local Debounce = false
- local Damage = script.Parent.Parent.Parent.Configuration.Damage.Value
- function OnTouched(Hit)
- if Hit.Parent ~= nil then
- if Debounce == false and Hit.Parent:findFirstChildOfClass("Humanoid") ~= nil then
- if Hit.Parent:findFirstChildOfClass("Humanoid").Health > 0 then
- Debounce = true
- local Animation = script.Parent.Parent.Parent:FindFirstChild("Swing")
- local Rake = script.Parent.Parent.Parent:FindFirstChild("NPC")
- local Attack = Rake:LoadAnimation(Animation)
- Attack:Play()
- Attack:AdjustSpeed(2+(math.random()*0.2))
- script.Parent.Parent.Swing.Pitch=1+(math.random()*0.04);
- script.Parent.Parent.Swing:Play()
- wait(0.2)
- Hit.Parent:findFirstChildOfClass("Humanoid"):TakeDamage(Damage)
- script.Parent.Parent.Hit.Pitch=1+(math.random()*0.04);
- script.Parent.Parent.Hit:Play()
- wait(1)
- Debounce = false
- end
- end
- end
- end
- script.Parent.Touched:Connect(OnTouched) end;
- function() -- Script by XcorrectTheDev
- function Blood()
- script.Parent.Blood.Enabled = true
- script.Parent.Blood2.Enabled = true
- script.Parent.Parent.Head.Eye1 = BrickColor.new("Really black")
- script.Parent.Parent.Head.Eye2 = BrickColor.new("Really black")
- end
- script.Parent.Parent.NPC.Died:Connect(Blood) end;
- 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;
- 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;
- 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;
- function() --[[Script by XcorrectTheDev
- If you set AllowToTakeTheModel to true that allow the player to-
- click the rake head and get the model ]]
- local Head = script.Parent.Parent.Parent.Head
- local AllowToTakeTheModel = script.Parent.Value
- local ItemID = 2813016734 -- This is this model id
- if AllowToTakeTheModel then -- Check if AllowToTakeTheModel is true
- Head.ClickDetector.MaxActivationDistance = 40
- else -- Else mean if AllowToTakeTheModel is false
- Head.ClickDetector.MaxActivationDistance = 0
- end
- Head.ClickDetector.MouseClick:Connect(function(OnClick) -- Check if player mouse is click the rake head
- game:GetService("MarketplaceService"):PromptPurchase(OnClick,ItemID)
- end) end;
- function() -- Script by XcorrectTheDev
- local Config = script.Parent.Parent
- local UsedRakeThemeGui = script.Parent.Value
- while wait(2) do
- if UsedRakeThemeGui then
- Config.RakeThemeVolume = 0
- Config.FoundVolume = 0
- Config.StaticSoundVolume = 0
- end
- end end;
- function() -- Script by XcorrectTheDev
- script.Parent.Value = script.Parent.Parent.Parent.Head.Static.Volume
- wait(1)
- if script.Parent.Value > 0 then
- script.Parent.Parent.Parent.Head.Static:Play()
- end end;
- 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;
- function() -- Script by XcorrectTheDev
- while wait(10) do
- script.Parent.NPC.PlatformStand = false
- script.Parent.Torso.Anchored = false
- end end;
- function() -- Doesn't provide rake animations
- 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 }
- },
- toollunge = {
- { id = "http://www.roblox.com/asset/?id=0", 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"}
- 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 = {}
- local config = script:FindFirstChild(name)
- if (config ~= nil) then
- 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
- idx = idx + 1
- end
- end
- end
- 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
- end
- end
- end
- 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
- 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
- function stopAllAnimations()
- local oldAnim = currentAnim
- 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
- if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
- repeatAnim = "idle"
- end
- local animSpeed = currentAnimSpeed
- playAnimation(repeatAnim, 0.0, Humanoid)
- setAnimationSpeed(animSpeed)
- end
- end
- 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
- local anim = animTable[animName][idx].anim
- if (anim ~= currentAnimInstance) then
- if (currentAnimTrack ~= nil) then
- currentAnimTrack:Stop(transitionTime)
- currentAnimTrack:Destroy()
- end
- currentAnimSpeed = 1.0
- currentAnimTrack = humanoid:LoadAnimation(anim)
- currentAnimTrack:Play(transitionTime)
- currentAnim = animName
- currentAnimInstance = anim
- 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
- 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
- local anim = animTable[animName][idx].anim
- if (toolAnimInstance ~= anim) then
- if (toolAnimTrack ~= nil) then
- toolAnimTrack:Stop()
- toolAnimTrack:Destroy()
- transitionTime = 0
- end
- toolAnimTrack = humanoid:LoadAnimation(anim)
- 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
- local tool = getTool()
- if tool and tool:FindFirstChild("Handle") then
- local animStringValueObject = getToolAnim(tool)
- if animStringValueObject then
- toolAnim = animStringValueObject.Value
- 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
- 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 true do
- local _,time = wait(0)
- move(time)
- end end;
- function() --[[
- CREDITs
- Thanks RVVZ for original base rake model :)
- Model insired by RVVZ
- Animation Scripted by ROBLOX (I'm not sure who is scripted this lol)
- MainScript Scriped by Brutez script fixed by XcorrectTheDev
- Respawn Scriped by Brutez Script Fixed By XcorrectTheDev
- qPerfectionWeld Scripted by Quenty
- Other scripts Scriped by XcorrectTheDev
- ]]
- end;
- function() --[[ Script By: Brutez. Script Fixed By XcorrectTheDev ]]--
- 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.1) until script and script.Parent and script.Parent.ClassName=="Model";
- local JeffTheKiller=AdvancedRespawnScript.Parent;
- 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(10);
- 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; end;
- function() -- Script by XcorrectTheDev
- local AlreadyStun = false
- while wait(0.1) do
- if AlreadyStun then
- script.Parent.NPC.WalkSpeed = 0
- end
- if script.Parent.NPC.Health < 1940 and not AlreadyStun then
- AlreadyStun = true
- script.Parent.MainScript.Disabled = true
- script.Parent.NPC.PlatformStand = true
- script.Parent.Head.Static:Stop()
- wait(0.5)
- local RandomSound = math.random(1,3)
- if RandomSound == 1 then
- script.Parent.Head.RakeHurt:Play()
- end
- if RandomSound == 2 then
- script.Parent.Head.RakeHurt2:Play()
- end
- if RandomSound == 3 then
- script.Parent.Head.RakeHurt3:Play()
- end
- script.Parent:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0,1,0,1,-0)
- script.GetStuns.Value = script.GetStuns.Value + 1
- script.Parent.Torso.Swing:Stop()
- script.Parent.Torso.HitBox.DamageScript.Disabled = true
- script.Parent.Head.RakeTheme:Stop()
- script.Parent.NPC.WalkSpeed = 0
- wait(script.Parent.Configuration.StunTime.Value)
- print("The rake stun ".. script.GetStuns.Value.. " Times")
- script.Parent.NPC.PlatformStand = false
- script.Parent.Torso.Swing:Stop()
- script.Parent.Torso.HitBox.DamageScript.Disabled = false
- script.Parent.NPC.Health = 2000
- script.Parent.NPC.WalkSpeed = script.Parent.Configuration.WalkSpeed.Value
- script.Parent.MainScript.Disabled = false
- if script.Parent.Configuration.StaticSoundVolume > 0 then
- script.Parent.Head.Static:Play()
- end
- wait(script.Parent.Configuration.StunReload.Value)
- AlreadyStun = false
- end
- end end;
- function() -- Script by XcorrectTheDev
- while true do
- script.Parent.NPC:MoveTo(Vector3.new(math.random(-820, 840),
- 0, math.random(-820, 840)), game.Workspace.Terrain)
- for i= 1,10 do
- wait(0.5)
- script.Parent.Head.RakeStep:Play()
- end
- wait(5)
- end end;
- function() --[[ Script by XcorrectTheDev
- Put this script in StarterGui (Don't ungroup the gui)
- This script will make screen shake when you near the rake ]]
- repeat
- script.RakeTheme.Parent = script.Parent
- until
- script.Parent:FindFirstChild("RakeTheme")
- script.Parent:FindFirstChild("RakeTheme").Main.Disabled = false
- wait(1)
- script:Destroy() end;
- function() -- Script by XcorrectTheDev
- local Character = game.Players.LocalPlayer.Character
- local RakeTheme = script.Parent.Theme
- local NearTheme = script.Parent.GetNear
- local Found = script.Parent.Found
- local FlashEffect = script.Parent.FlashEffect
- local ScreenShake = script.Parent.ScreenShake
- local NightTheme = script.Parent.NightTheme
- local Rake = workspace.The_Rake.HumanoidRootPart
- local Camera = workspace.Camera
- local Debounce1 = false
- local Debounce2 = false
- NightTheme:Play()
- -- Better don't change anything. This script is WIP v.0.2
- -- This screen gui doesn't work if your game has day and night loop
- game:GetService("RunService").RenderStepped:Connect(function()
- if (Rake.Position - Character.HumanoidRootPart.Position).magnitude<70 and Debounce1 == false then
- Debounce1 = true
- NightTheme:Pause()
- Found:Play()
- FlashEffect.BackgroundTransparency = 0.6
- wait(0.4)
- ScreenShake.Disabled = false
- FlashEffect.BackgroundTransparency = 1
- RakeTheme:Play()
- end
- if (Rake.Position - Character.HumanoidRootPart.Position).magnitude>70 and Debounce1 == true then
- Debounce1 = false
- NightTheme:Play()
- ScreenShake.Disabled = true
- FlashEffect.BackgroundTransparency = 1
- RakeTheme:Stop()
- end
- end)
- end;
- function() -- Script by XcorrectTheDev
- local Theme = script.Parent.Theme
- local FlashEffect = script.Parent.FlashEffect
- local Camera = workspace.Camera
- local ScreenZoomAmount = 0.025 -- How much screen zoom when music is playing
- local FlashAmount = 0.001 -- How much screen flash when music is playing
- local ScreenAngelsAmount = 0.003 -- How much screen angles change when music is playing
- local StandardFieldOfView = 70 -- Standard FieldOfView on roblox better set it to 70
- game:GetService("RunService").RenderStepped:Connect(function()
- Camera.FieldOfView = StandardFieldOfView - Theme.PlaybackLoudness * ScreenZoomAmount
- FlashEffect.BackgroundTransparency = 1 - Theme.PlaybackLoudness * FlashAmount
- Camera.CFrame = workspace.Camera.CFrame * CFrame.Angles(0,
- 0, math.rad(math.random(- Theme.PlaybackLoudness,
- Theme.PlaybackLoudness) * ScreenAngelsAmount)) + Vector3.new(
- math.rad(math.random( - Theme.PlaybackLoudness * ScreenAngelsAmount,
- Theme.PlaybackLoudness * ScreenAngelsAmount) * ScreenAngelsAmount ),
- math.rad(math.random( - Theme.PlaybackLoudness * ScreenAngelsAmount,
- Theme.PlaybackLoudness * ScreenAngelsAmount) * ScreenAngelsAmount ),
- math.rad(math.random( - Theme.PlaybackLoudness * ScreenAngelsAmount,
- Theme.PlaybackLoudness * ScreenAngelsAmount) * ScreenAngelsAmount )
- )
- end)
- end;
- function() --[[ Script By: Brutez. Script Fixed By XcorrectTheDev ]]--
- local JeffTheKillerScript=script;
- repeat wait(0.1)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;
- 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("Torso");
- 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=70;
- 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("HumanoidRootPart")and TargetModel:FindFirstChild("Head")then
- local TargetPart=TargetModel:FindFirstChild("HumanoidRootPart");
- 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("Head")and hit.Parent:FindFirstChildOfClass("Humanoid") then
- if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<8 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(2+(math.random()*0.2));
- 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(1.2);
- AttackDebounce=false;
- end);
- end;
- end;
- end;
- end;
- end;
- return TargetMain;
- end;
- while wait(0.1)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
- wait(0.5)
- 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;
- Jumpable=false;
- 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" or Blockage.Parent.Name=="Humanoid" and Blockage.Parent.Name=="HumanoidRootPart" and Blockage.Parent.ClassName=="Humanoid" 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("RakeStep")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("RakeStep"):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 FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<99999999999999999999 then
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("RakeTheme")and not JeffTheKillerHead:FindFirstChild("RakeTheme").IsPlaying then
- JeffTheKillerHead:FindFirstChild("RakeTheme").Volume=JeffTheKiller:FindFirstChild("Configuration"):FindFirstChild("RakeThemeVolume").Value;
- JeffTheKillerHead:FindFirstChild("RakeTheme"):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>9999999999999999999 then
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("RakeTheme")and JeffTheKillerHead:FindFirstChild("RakeTheme").IsPlaying then
- if not JeffLaughDebounce then
- spawn(function()
- JeffLaughDebounce=true;
- repeat wait(0.1);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("RakeTheme")then JeffTheKillerHead:FindFirstChild("RakeTheme").Volume=JeffTheKillerHead:FindFirstChild("RakeTheme").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("RakeTheme").Volume==0 or JeffTheKillerHead:FindFirstChild("RakeTheme").Volume<0;
- JeffTheKillerHead:FindFirstChild("RakeTheme").Volume=0;
- JeffTheKillerHead:FindFirstChild("RakeTheme"):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;
- 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.1);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.1);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("RakeTheme")then JeffTheKillerHead:FindFirstChild("RakeTheme").Volume=JeffTheKillerHead:FindFirstChild("RakeTheme").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("RakeTheme").Volume==0 or JeffTheKillerHead:FindFirstChild("RakeTheme").Volume<0;
- JeffTheKillerHead:FindFirstChild("RakeTheme").Volume=0;
- JeffTheKillerHead:FindFirstChild("RakeTheme"):Stop();
- JeffLaughDebounce=false;
- end);
- end;
- if not MainTarget and not MusicDebounce then
- spawn(function()
- MusicDebounce=true;
- repeat wait(0.1);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("Found")then
- JeffTheKiller.Target.Value = true;
- JeffTheKillerHead:FindFirstChild("Found").Volume=JeffTheKiller:FindFirstChild("Configuration"):FindFirstChild("FoundVolume").Value;
- JeffTheKillerHead:FindFirstChild("Found"):Play();
- wait(0.4);
- JeffTheKillerHead:FindFirstChild("RakeScream"):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=JeffTheKiller:FindFirstChild("Configuration"):FindFirstChild("RunSpeed").Value;
- elseif MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<5 then
- JeffTheKillerHumanoid.WalkSpeed=2;
- 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.4,0.1,0,0.1,0.9);
- elseif NeckRotation>1.5 then
- JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0.1,0.08,0,0.08,-0.2);
- 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);
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
- JeffTheKillerHumanoid.WalkSpeed=JeffTheKiller:FindFirstChild("Configuration"):FindFirstChild("WalkSpeed").Value;
- JeffTheKiller.Target.Value=false;
- end;
- end;
- spawn(function()
- local AlreadyDo=false;
- while wait(0.1) do
- if JeffTheKiller.Target.Value==false and AlreadyDo==false then
- JeffTheKillerHead.Mouth.Transparency=1;
- JeffTheKillerHead.Mouth2.Transparency=0;
- JeffTheKillerHead.Mouth2.MouthDecal.Transparency=0;
- JeffTheKiller.Wander.Disabled=false;
- AlreadyDo=true;
- wait(5);
- AlreadyDo=false;
- end;
- if JeffTheKiller.Target.Value==true and AlreadyDo==false then
- JeffTheKillerHead.Mouth.Transparency=0;
- JeffTheKillerHead.Mouth2.Transparency=1;
- JeffTheKillerHead.Mouth2.MouthDecal.Transparency=1;
- JeffTheKiller.Wander.Disabled=true;
- AlreadyDo=true;
- wait(5);
- AlreadyDo=false;
- end;
- end;
- end);
- spawn(function()
- while JeffTheKillerHumanoid.Health > 1 do
- wait(1);
- JeffTheKiller:FindFirstChild("Torso").Blood.Enabled = false;
- JeffTheKiller:FindFirstChild("Torso").Blood2.Enabled = false;
- JeffTheKillerHead.Eye1.BrickColor=BrickColor.new("Institutional white");
- JeffTheKillerHead.Eye2.BrickColor=BrickColor.new("Institutional white");
- end;
- end);
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid then
- JeffTheKillerHumanoid.DisplayDistanceType="None";
- JeffTheKillerHumanoid.HealthDisplayDistance=0;
- JeffTheKillerHumanoid.Name="NPC";
- JeffTheKillerHumanoid.NameDisplayDistance=0;
- JeffTheKillerHumanoid.NameOcclusion="EnemyOcclusion";
- JeffTheKillerHumanoid.AutoJumpEnabled=true;
- JeffTheKillerHumanoid.AutoRotate=true;
- JeffTheKillerHumanoid.MaxHealth=2000;
- JeffTheKillerHumanoid.JumpPower=80;
- 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; end;}local ActualScripts = {}
- function s(var)
- local func = table.remove(Scripts,1)
- setfenv(func,setmetatable({script=var,require=fake_require or require,global=genv},{
- __index = getfenv(func),
- }))
- table.insert(ActualScripts,coroutine.wrap(func))
- end
- Decode = function(str,t,props,classes,values,ICList,Model,CurPar,LastIns,split,RemoveAndSplit,InstanceList)
- local tonum,table_remove,inst,parnt,comma,table_foreach = tonumber,table.remove,Instance.new,"Parent",",",
- function(t,f)
- for a,b in pairs(t) do
- f(a,b)
- end
- end
- local Types = {
- Color3 = Color3.new,
- Vector3 = Vector3.new,
- Vector2 = Vector2.new,
- UDim = UDim.new,
- UDim2 = UDim2.new,
- CFrame = CFrame.new,
- Rect = Rect.new,
- NumberRange = NumberRange.new,
- BrickColor = BrickColor.new,
- PhysicalProperties = PhysicalProperties.new,
- NumberSequence = function(...)
- local a = {...}
- local t = {}
- repeat
- t[#t+1] = NumberSequenceKeypoint.new(table_remove(a,1),table_remove(a,1),table_remove(a,1))
- until #a==0
- return NumberSequence.new(t)
- end,
- ColorSequence = function(...)
- local a = {...}
- local t = {}
- repeat
- t[#t+1] = ColorSequenceKeypoint.new(table_remove(a,1),Color3.new(table_remove(a,1),table_remove(a,1),table_remove(a,1)))
- until #a==0
- return ColorSequence.new(t)
- end,
- number = tonumber,
- boolean = function(a)
- return a=="1"
- end
- }
- split = function(str,sep)
- if not str then return end
- local fields = {}
- local ConcatNext = false
- str:gsub(("([^%s]+)"):format(sep),function(c)
- if ConcatNext == true then
- fields[#fields] = fields[#fields]..sep..c
- ConcatNext = false
- else
- fields[#fields+1] = c
- end
- if c:sub(#c)=="\\" then
- c = fields[#fields]
- fields[#fields] = c:sub(1,#c-1)
- ConcatNext = true
- end
- end)
- return fields
- end
- RemoveAndSplit = function(t)
- return split(table_remove(t,1),comma)
- end
- t = split(str,";")
- props = RemoveAndSplit(t)
- classes = RemoveAndSplit(t)
- values = split(table_remove(t,1),'|')
- ICList = RemoveAndSplit(t)
- InstanceList = {}
- Model = inst"Model"
- CurPar = Model
- table_foreach(t,function(ct,c)
- if c=="n" or c=="p" then
- CurPar = c=="n" and LastIns or CurPar[parnt]
- else
- ct = split(c,"|")
- local class = classes[tonum(table_remove(ct,1))]
- if class=="UnionOperation" then
- LastIns = {UsePartColor="1"}
- else
- LastIns = inst(class)
- if LastIns:IsA"Script" then
- s(LastIns)
- elseif LastIns:IsA("ModuleScript") then
- ms(LastIns)
- end
- end
- local function SetProperty(LastIns,p,str,s)
- s = Types[typeof(LastIns[p])]
- if p=="CustomPhysicalProperties" then
- s = PhysicalProperties.new
- end
- if s then
- LastIns[p] = s(unpack(split(str,comma)))
- else
- LastIns[p] = str
- end
- end
- local UnionData
- table_foreach(ct,function(s,p,a,str)
- a = p:find":"
- p,str = props[tonum(p:sub(1,a-1))],values[tonum(p:sub(a+1))]
- if p=="UnionData" then
- UnionData = split(str," ")
- return
- end
- if class=="UnionOperation" then
- LastIns[p] = str
- return
- end
- SetProperty(LastIns,p,str)
- end)
- if UnionData then
- local LI_Data = LastIns
- LastIns = DecodeUnion(UnionData)
- table_foreach(LI_Data,function(p,str)
- SetProperty(LastIns,p,str)
- end)
- end
- table.insert(InstanceList,LastIns)
- LastIns[parnt] = CurPar
- end
- end)
- table_remove(ICList,1)
- table_foreach(ICList,function(a,b)
- b = split(b,">")
- InstanceList[tonum(b[1])][props[tonum(b[2])]] = InstanceList[tonum(b[3])]
- end)
- return Model:GetChildren()
- end
- local Objects = Decode('Name,PrimaryPart,Locked,CustomPhysicalProperties,Color,Material,Transparency,Position,Orientation,Size,BackSurface,BottomSurface,FrontSurface,LeftSurface,RightSurface,TopSurface,MaxActivationDistance,'
- ..'MaxDistance,SoundId,Volume,Scale,MeshId,MeshType,CanCollide,Texture,Face,Looped,Enabled,LightInfluence,Speed,Drag,EmissionDirection,Lifetime,Rate,RotSpeed,Rotation,TextureId,StudsPerTileU,StudsPerTile'
- ..'V,MaxVelocity,C0,C1,Part0,Part1,Offset,Value,AnimationId,BodyPart,DisplayDistanceType,HealthDisplayDistance,NameDisplayDistance,NameOcclusion,Health,MaxHealth,JumpPower,MaxSlopeAngle,WalkSpeed,ZIndexB'
- ..'ehavior,BackgroundColor3,BackgroundTransparency,BorderSizePixel,PlaybackSpeed;Part,Model,Script,ClickDetector,Sound,SpecialMesh,MeshPart,Texture,PitchShiftSoundEffect,ParticleEmitter,Motor6D,Decal,Con'
- ..'figuration,IntValue,NumberValue,BoolValue,Animation,CharacterMesh,Humanoid,StringValue,LocalScript,ScreenGui,Frame;Part|siren head|Head|1|0.6999,2,0,1,1|0.3372,0.2588,0.2117|272|-17.4631,14.8287,-40.8'
- ..'89|0,-89.3601,0|6.2958,3.1479,3.1479|10|qPerfectionWeld|0|RakeStep|100|rbxassetid://481147984|1.5|8.3049,8.3049,8.3049|http://www.roblox.com/asset/?id=17392637|5|-16.9469,17.7348,-41.0988|1.32,-89.81,'
- ..'-0.0701|6.9761,9.2461,4.9552|FrontTexture|0.8|rbxassetid://843920074|BackTexture|2|LeftTexture|3|RightTexture|0|TopTexture|1|BottomTexture|4|Found|80|rbxassetid://0|Static|90|rbxassetid://4804675004|1'
- ..'0|RakeHurt3|rbxassetid://4819881245|3|RakeScream|rbxassetid://428391167|3.5|ScreamPitch|RakeTheme|70|RakeHurt|RakeHurt2|Torso|-17.4633,10.1068,-40.8887|6.2958,6.2958,3.1479|HitBox|-12.9793,8.9973,-40.'
- ..'85|0,89.7399,0|5.5366,17.994,11.9037|DamageScript|Bone|-17.433,10.1506,-40.8955|5.9531,6.2051,4.2187|Blood2|0,0,0,1,0.9875,0|0,0.4374,0,1,1,0|rbxassetid://247766282|4,4|2.5|0.5,0.5|30|130,130|180,180|'
- ..'Blood|0,0.6666,0,0,1,0.6666,0,0|0,0.1249,0,1,0.5,0|1,1|40|Swing|60|rbxassetid://148196278|4|Hit|150|rbxassetid://93591808|2|2.7683,2.7683,2.7683|rbxassetid://27111894|rbxassetid://4056053325|MainTextu'
- ..'re|0.7799|Right Shoulder|0.1|3.1479,1.5739,0,0,0,1,0,1,-0,-1,0,0|-1.574,1.5739,0,0,0,1,0,1,-0,-1,0,0|Right Hip|3.1479,-3.148,0,0,0,1,0,1,-0,-1,0,0|1.5739,3.1479,0,0,0,1,0,1,-0,-1,0,0|Left Hip|-3.148,-'
- ..'3.148,0,0,0,-1,0,1,0,1,0,0|-1.574,3.1479,0,0,0,-1,0,1,0,1,0,0|Left Shoulder|-3.148,1.5739,0,0,0,-1,0,1,0,1,0,0|1.5739,1.5739,0,0,0,-1,0,1,0,1,0,0|Neck|0,3.1479,0,-1,0,0,0,0,1,0,1,-0|0,-1.574,0,-1,0,0,'
- ..'0,0,1,0,1,-0|Left Arm|-17.516,10.1064,-45.6103|3.1479,6.2958,3.1479|0,0.6295,0|4.4071,3.7775,4.0923|http://www.roblox.com/asset/?id=36780032|-17.5031,10.7348,-45.6169|3.633,7.4255,2.1395|Left Leg|-17.'
- ..'481,3.8108,-42.4622|rbxassetid://27111857|Right Leg|-17.4459,3.811,-39.3144|rbxassetid://27111882|WalkSpeed|12|Damage|25|StunTime|RakeThemeVolume|AllowToTakeTheModel|TakeThisModelScript|RunSpeed|UsedR'
- ..'akeThemeGui|AutoSet|FoundVolume|5|StunReload|StaticSoundVolume|0.25|VolumeSet|HumanoidRootPart|RootJoint|0,0,0,-1,0,0,0,0,1,0,1,-0|rbxassetid://243827693|27111894|LeftLeg|27111857|RightLeg|27111882|Ta'
- ..'rget|Right Arm|-17.4105,10.1071,-36.1671|rbxassetid://36780156|-17.4137,10.7385,-36.1296|3.6327,7.4259,2.1405|FixAnchored|NPC|2000|89.9|Animation|climb|ClimbAnim|http://www.roblox.com/asset/?id=180436'
- ..'334|fall|FallAnim|http://www.roblox.com/asset/?id=180436148|idle|Animation1|http://www.roblox.com/asset/?id=180435571|Weight|9|Animation2|http://www.roblox.com/asset/?id=180435792|jump|JumpAnim|http:/'
- ..'/www.roblox.com/asset/?id=125750702|run|RunAnim|http://www.roblox.com/asset/?id=252557606|sit|SitAnim|http://www.roblox.com/asset/?id=178130996|toolnone|ToolNoneAnim|walk|WalkAnim|http://www.roblox.co'
- ..'m/asset/?id=180426354|Credits (ReadMe)|Respawn|Stun|GetStuns|Wander|RakeTheme (ReadMe)|FlashEffect|1,0,1,0|1,1,1|Main|ScreenShake|Theme|rbxassetid://2593956530|rbxassetid://380102473|GetNear|1.2|rbxas'
- ..'setid://468911141|NightTheme|rbxassetid://1501996092|MainScript;0,1>2>2,41>43>23,41>44>88,42>43>23,42>44>62,43>43>23,43>44>57,44>43>23,44>44>46,45>43>23,45>44>2,82>43>81,82>44>23;2|1:2;n;1|1:3|3:4|4:5'
- ..'|5:6|6:7|7:4|8:8|9:9|10:10|11:11|12:11|13:11|14:11|15:11|16:11|5:6|5:6;n;3|1:12;4|17:13;5|1:14|18:15|18:15|19:16|20:17;6|21:18|22:19|23:20;7|1:3|5:6|6:7|8:21|9:22|10:23|24:13|5:6|5:6;n;8|1:24|7:25|25:'
- ..'26;8|1:27|7:25|25:26|26:28;8|1:29|7:25|25:26|26:30;8|1:31|7:25|25:26|26:32;8|1:33|7:25|25:26|26:34;8|1:35|7:25|25:26|26:36;p;5|1:37|18:38|18:38|19:39|20:13;5|1:40|18:41|27:4|18:41|19:42|20:43;n;9;p;5|'
- ..'1:44|19:45|20:46;5|1:47|19:48|20:49;n;3|1:50;p;5|1:51|18:52|27:4|18:52|19:42|20:43;5|1:53|19:45|20:46;5|1:54|19:45|20:46;p;1|1:55|3:4|4:5|5:6|6:7|8:56|9:9|10:57|11:11|12:11|13:11|14:11|15:11|16:11|5:6'
- ..'|5:6;n;3|1:12;1|1:58|5:6|6:7|7:4|8:59|9:60|10:61|24:13|12:32|16:32|5:6|5:6;n;3|1:62;p;7|1:63|5:6|6:7|8:64|9:9|10:65|24:13|5:6|5:6;n;8|1:27|7:25|25:26|26:28;8|1:35|7:25|25:26|26:36;8|1:24|7:25|25:26;8|'
- ..'1:29|7:25|25:26|26:30;8|1:31|7:25|25:26|26:32;8|1:33|7:25|25:26|26:34;p;10|1:66|7:67|10:68|25:69|28:13|29:4|30:70|31:71|32:20|33:72|34:73|35:74|36:75;10|1:76|5:77|7:67|10:78|25:69|28:13|29:4|5:77|30:7'
- ..'0|5:77|31:71|32:20|33:79|34:80|35:74|36:75;3|1:76;5|1:81|18:82|18:82|19:83|20:84;5|1:85|18:86|18:86|19:87|20:88;6|21:89|22:90|37:91|23:20;8|1:92|7:93|38:4|39:4|25:26|26:34;11|1:94|40:95|41:96|42:97;11'
- ..'|1:98|40:95|41:99|42:100;11|1:101|40:95|41:102|42:103;11|1:104|40:95|41:105|42:106;11|1:107|40:95|41:108|42:109;p;1|1:110|3:4|4:5|5:6|6:7|8:111|9:9|10:112|11:11|12:11|13:11|14:11|15:11|16:11|5:6|5:6;n'
- ..';6|45:113|21:114|22:115|23:20;7|1:110|5:6|6:7|8:116|9:9|10:117|24:13|5:6|5:6;n;8|1:27|7:25|25:26|26:28;8|1:35|7:25|25:26|26:36;8|1:24|7:25|25:26;8|1:29|7:25|25:26|26:30;8|1:31|7:25|25:26|26:32;8|1:33|'
- ..'7:25|25:26|26:34;p;3|1:12;12|25:91;p;1|1:118|3:4|4:5|5:6|6:7|8:119|9:9|10:112|11:11|12:11|13:11|14:11|15:11|16:11|5:6|5:6;n;3|1:12;6|21:89|22:120|23:20;8|1:92|7:93|38:4|39:4|25:26|26:34;12|25:91;p;1|1'
- ..':121|3:4|4:5|5:6|6:7|8:122|9:9|10:112|11:11|12:11|13:11|14:11|15:11|16:11|5:6|5:6;n;3|1:12;6|21:89|22:123|23:20;8|1:92|7:93|38:4|39:4|25:26|26:34;12|25:91;p;13;n;14|1:124|46:125;14|1:126|46:127;14|1:1'
- ..'28|46:46;15|1:129|46:88;16|1:130|46:4;n;3|1:131;p;14|1:132|46:73;16|1:133;n;3|1:134;p;15|1:135|46:136;14|1:137|46:136;15|1:138|46:139;n;3|1:140;p;p;1|1:141|3:4|4:5|5:6|6:7|7:4|8:56|9:9|10:57|11:11|12:'
- ..'11|13:11|14:11|15:11|16:11|5:6|5:6;n;11|1:142|40:95|41:143|42:143;p;17|1:81|47:144;18|1:55|22:145|48:34;18|1:146|22:147|48:36;18|1:148|22:149|48:20;16|1:150;1|1:151|3:4|4:5|5:6|6:7|7:4|8:152|9:9|10:11'
- ..'2|11:11|12:11|13:11|14:11|15:11|16:11|5:6|5:6;n;3|1:12;6|45:113|21:114|22:153|23:20;7|1:151|5:6|6:7|8:154|9:9|10:155|24:13|5:6|5:6;n;8|1:27|7:25|25:26|26:28;8|1:35|7:25|25:26|26:36;8|1:24|7:25|25:26;8'
- ..'|1:29|7:25|25:26|26:30;8|1:31|7:25|25:26|26:32;8|1:33|7:25|25:26|26:34;p;12|25:91;p;3|1:156;19|1:157|49:28|50:13|51:13|52:34|53:158|54:158|55:38|56:159|57:13;n;p;3|1:160;n;20|1:161;n;17|1:162|47:163;p'
- ..';20|1:164;n;17|1:165|47:166;p;20|1:167;n;17|1:168|47:169;n;15|1:170|46:171;p;17|1:172|47:173;n;15|1:170|46:4;p;p;20|1:174;n;17|1:175|47:176;p;20|1:177;n;17|1:178|47:179;p;20|1:180;n;17|1:181|47:182;p;'
- ..'20|1:183;n;17|1:184|47:39;p;20|1:185;n;17|1:186|47:187;p;p;3|1:188;3|1:189;3|1:190;n;14|1:191;p;3|1:192;21|1:193;n;22|1:51|58:34;n;23|1:194|10:195|59:196|60:4|61:13;21|1:197;21|1:198;5|1:199|27:4|19:2'
- ..'00|20:88;5|1:37|18:38|18:38|19:201|20:136;5|1:202|18:41|27:4|18:41|62:203|19:204|20:13;5|1:205|27:4|19:206|20:25;p;p;3|1:207;p;')
- for _,Object in pairs(Objects) do
- Object.Parent = script and script.Parent==workspace and script or workspace
- end
- for _,f in pairs(ActualScripts) do f() end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement