Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Model0 = Instance.new("Model")
- Part1 = Instance.new("Part")
- Motor6D2 = Instance.new("Motor6D")
- Part3 = Instance.new("Part")
- Motor6D4 = Instance.new("Motor6D")
- Motor6D5 = Instance.new("Motor6D")
- Motor6D6 = Instance.new("Motor6D")
- Motor6D7 = Instance.new("Motor6D")
- Motor6D8 = Instance.new("Motor6D")
- Sound9 = Instance.new("Sound")
- BillboardGui10 = Instance.new("BillboardGui")
- TextLabel11 = Instance.new("TextLabel")
- BillboardGui12 = Instance.new("BillboardGui")
- Frame13 = Instance.new("Frame")
- Frame14 = Instance.new("Frame")
- Frame15 = Instance.new("Frame")
- Part16 = Instance.new("Part")
- Part17 = Instance.new("Part")
- Part18 = Instance.new("Part")
- Part19 = Instance.new("Part")
- Weld20 = Instance.new("Weld")
- Part21 = Instance.new("Part")
- Sound22 = Instance.new("Sound")
- SpecialMesh23 = Instance.new("SpecialMesh")
- Script24 = Instance.new("Script")
- StringValue25 = Instance.new("StringValue")
- Animation26 = Instance.new("Animation")
- StringValue27 = Instance.new("StringValue")
- Animation28 = Instance.new("Animation")
- StringValue29 = Instance.new("StringValue")
- Animation30 = Instance.new("Animation")
- NumberValue31 = Instance.new("NumberValue")
- Animation32 = Instance.new("Animation")
- NumberValue33 = Instance.new("NumberValue")
- StringValue34 = Instance.new("StringValue")
- Animation35 = Instance.new("Animation")
- StringValue36 = Instance.new("StringValue")
- Animation37 = Instance.new("Animation")
- StringValue38 = Instance.new("StringValue")
- Animation39 = Instance.new("Animation")
- StringValue40 = Instance.new("StringValue")
- Animation41 = Instance.new("Animation")
- Shirt42 = Instance.new("Shirt")
- Animation43 = Instance.new("Animation")
- Script44 = Instance.new("Script")
- BodyColors45 = Instance.new("BodyColors")
- Sound46 = Instance.new("Sound")
- Script47 = Instance.new("Script")
- Script48 = Instance.new("Script")
- Humanoid49 = Instance.new("Humanoid")
- Tool50 = Instance.new("Tool")
- Part51 = Instance.new("Part")
- SpecialMesh52 = Instance.new("SpecialMesh")
- Sound53 = Instance.new("Sound")
- Sound54 = Instance.new("Sound")
- Sound55 = Instance.new("Sound")
- Sound56 = Instance.new("Sound")
- Sound57 = Instance.new("Sound")
- Sound58 = Instance.new("Sound")
- Sound59 = Instance.new("Sound")
- Sound60 = Instance.new("Sound")
- Sound61 = Instance.new("Sound")
- Sound62 = Instance.new("Sound")
- Sound63 = Instance.new("Sound")
- Sound64 = Instance.new("Sound")
- Sound65 = Instance.new("Sound")
- Sound66 = Instance.new("Sound")
- Sound67 = Instance.new("Sound")
- Sound68 = Instance.new("Sound")
- Sound69 = Instance.new("Sound")
- Sound70 = Instance.new("Sound")
- Sound71 = Instance.new("Sound")
- Sound72 = Instance.new("Sound")
- Sound73 = Instance.new("Sound")
- Sound74 = Instance.new("Sound")
- Sound75 = Instance.new("Sound")
- Sound76 = Instance.new("Sound")
- Sound77 = Instance.new("Sound")
- Sound78 = Instance.new("Sound")
- Sound79 = Instance.new("Sound")
- Sound80 = Instance.new("Sound")
- Sound81 = Instance.new("Sound")
- Sound82 = Instance.new("Sound")
- Sound83 = Instance.new("Sound")
- Sound84 = Instance.new("Sound")
- Sound85 = Instance.new("Sound")
- Sound86 = Instance.new("Sound")
- Sound87 = Instance.new("Sound")
- Sound88 = Instance.new("Sound")
- Sound89 = Instance.new("Sound")
- Sound90 = Instance.new("Sound")
- Sound91 = Instance.new("Sound")
- Sound92 = Instance.new("Sound")
- Sound93 = Instance.new("Sound")
- LocalScript94 = Instance.new("LocalScript")
- Script95 = Instance.new("Script")
- ShirtGraphic96 = Instance.new("ShirtGraphic")
- Script97 = Instance.new("Script")
- Model0.Name = "Dipsy Chainsaw"
- Model0.Parent = mas
- Part1.Name = "HumanoidRootPart"
- Part1.Parent = Model0
- Part1.Transparency = 1
- Part1.FormFactor = Enum.FormFactor.Symmetric
- Part1.Size = Vector3.new(2, 2, 1)
- Part1.CFrame = CFrame.new(-30, 3.00001001, -11, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.Position = Vector3.new(-30, 3.00001001, -11)
- Motor6D2.Name = "Root Hip"
- Motor6D2.Parent = Part1
- Motor6D2.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D2.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D2.Part0 = Part1
- Motor6D2.Part1 = Part3
- Motor6D2.MaxVelocity = 0.10000000149012
- Part3.Name = "Torso"
- Part3.Parent = Model0
- Part3.BrickColor = BrickColor.new("Lime green")
- Part3.CanCollide = false
- Part3.FormFactor = Enum.FormFactor.Symmetric
- Part3.Size = Vector3.new(2, 2, 1)
- Part3.CFrame = CFrame.new(-30, 3.00001001, -11, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part3.BottomSurface = Enum.SurfaceType.Smooth
- Part3.TopSurface = Enum.SurfaceType.Smooth
- Part3.Color = Color3.new(0, 1, 0)
- Part3.Position = Vector3.new(-30, 3.00001001, -11)
- Part3.Color = Color3.new(0, 1, 0)
- Motor6D4.Name = "Left Hip"
- Motor6D4.Parent = Part3
- Motor6D4.C0 = CFrame.new(-1, -1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- Motor6D4.C1 = CFrame.new(-0.5, 1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- Motor6D4.Part0 = Part3
- Motor6D4.Part1 = Part16
- Motor6D4.MaxVelocity = 0.10000000149012
- Motor6D5.Name = "Right Hip"
- Motor6D5.Parent = Part3
- Motor6D5.C0 = CFrame.new(1, -1, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- Motor6D5.C1 = CFrame.new(0.5, 1, 0, -4.37113883e-08, 0, 1, 0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- Motor6D5.Part0 = Part3
- Motor6D5.Part1 = Part17
- Motor6D5.MaxVelocity = 0.10000000149012
- Motor6D6.Name = "Left Shoulder"
- Motor6D6.Parent = Part3
- Motor6D6.C0 = CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- Motor6D6.C1 = CFrame.new(0.5, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
- Motor6D6.Part0 = Part3
- Motor6D6.Part1 = Part18
- Motor6D6.MaxVelocity = 0.10000000149012
- Motor6D7.Name = "Right Shoulder"
- Motor6D7.Parent = Part3
- Motor6D7.C0 = CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- Motor6D7.C1 = CFrame.new(-0.5, 0.5, 0, -4.37113883e-08, 0, 1, 0, 0.99999994, 0, -1, 0, -4.37113883e-08)
- Motor6D7.Part0 = Part3
- Motor6D7.Part1 = Part19
- Motor6D7.MaxVelocity = 0.10000000149012
- Motor6D8.Name = "Neck"
- Motor6D8.Parent = Part3
- Motor6D8.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D8.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D8.Part0 = Part3
- Motor6D8.Part1 = Part21
- Motor6D8.MaxVelocity = 0.10000000149012
- Sound9.Name = "HitSound"
- Sound9.Parent = Part3
- Sound9.SoundId = "rbxassetid://2766576"
- Sound9.Volume = 5
- BillboardGui10.Name = "BossGui"
- BillboardGui10.Parent = Part3
- BillboardGui10.Size = UDim2.new(5, 0, 5, 0)
- BillboardGui10.AlwaysOnTop = true
- BillboardGui10.StudsOffset = Vector3.new(0, 10, 0)
- TextLabel11.Parent = BillboardGui10
- TextLabel11.Transparency = 1
- TextLabel11.Size = UDim2.new(1, 0, 1, 0)
- TextLabel11.Text = "BOSS"
- TextLabel11.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel11.BackgroundTransparency = 1
- TextLabel11.Font = Enum.Font.ArialBold
- TextLabel11.FontSize = Enum.FontSize.Size12
- TextLabel11.TextColor3 = Color3.new(1, 0, 0)
- TextLabel11.TextStrokeColor3 = Color3.new(0.784314, 0, 0)
- TextLabel11.TextStrokeTransparency = 0
- BillboardGui12.Name = "Healthbar"
- BillboardGui12.Parent = Part3
- BillboardGui12.Size = UDim2.new(50, 0, 1, 0)
- BillboardGui12.AlwaysOnTop = true
- BillboardGui12.StudsOffset = Vector3.new(0, 20, 0)
- Frame13.Parent = BillboardGui12
- Frame13.Size = UDim2.new(1, 0, 1, 0)
- Frame13.BackgroundColor3 = Color3.new(0, 0, 0)
- Frame13.BorderColor3 = Color3.new(0, 0, 0)
- Frame14.Name = "Full"
- Frame14.Parent = Frame13
- Frame14.Size = UDim2.new(1, 0, 1, 0)
- Frame14.BackgroundColor3 = Color3.new(0, 0.784314, 0)
- Frame14.BorderColor3 = Color3.new(0, 0, 0)
- Frame14.BorderSizePixel = 0
- Frame15.Name = "Reflec"
- Frame15.Parent = Frame14
- Frame15.Transparency = 0.625
- Frame15.Size = UDim2.new(1, 0, 0.370000005, 0)
- Frame15.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame15.BackgroundTransparency = 0.625
- Frame15.BorderSizePixel = 0
- Part16.Name = "Left Leg"
- Part16.Parent = Model0
- Part16.BrickColor = BrickColor.new("Lime green")
- Part16.CanCollide = false
- Part16.FormFactor = Enum.FormFactor.Symmetric
- Part16.Size = Vector3.new(1, 2, 1)
- Part16.CFrame = CFrame.new(-30.5, 1.00001013, -11, 1, 0, 0, 0, 0.999999881, 0, 0, 0, 1)
- Part16.BottomSurface = Enum.SurfaceType.Smooth
- Part16.TopSurface = Enum.SurfaceType.Smooth
- Part16.Color = Color3.new(0, 1, 0)
- Part16.Position = Vector3.new(-30.5, 1.00001013, -11)
- Part16.Color = Color3.new(0, 1, 0)
- Part17.Name = "Right Leg"
- Part17.Parent = Model0
- Part17.BrickColor = BrickColor.new("Lime green")
- Part17.CanCollide = false
- Part17.FormFactor = Enum.FormFactor.Symmetric
- Part17.Size = Vector3.new(1, 2, 1)
- Part17.CFrame = CFrame.new(-29.5, 1.00001013, -11, 1, 0, 0, 0, 0.999999881, 0, 0, 0, 1)
- Part17.BottomSurface = Enum.SurfaceType.Smooth
- Part17.TopSurface = Enum.SurfaceType.Smooth
- Part17.Color = Color3.new(0, 1, 0)
- Part17.Position = Vector3.new(-29.5, 1.00001013, -11)
- Part17.Color = Color3.new(0, 1, 0)
- Part18.Name = "Left Arm"
- Part18.Parent = Model0
- Part18.BrickColor = BrickColor.new("Lime green")
- Part18.CanCollide = false
- Part18.FormFactor = Enum.FormFactor.Symmetric
- Part18.Size = Vector3.new(1, 2, 1)
- Part18.CFrame = CFrame.new(-31.5, 3.00001001, -11, 1, 0, 0, 0, 0.999999881, 0, 0, 0, 1)
- Part18.BottomSurface = Enum.SurfaceType.Smooth
- Part18.TopSurface = Enum.SurfaceType.Smooth
- Part18.Color = Color3.new(0, 1, 0)
- Part18.Position = Vector3.new(-31.5, 3.00001001, -11)
- Part18.Color = Color3.new(0, 1, 0)
- Part19.Name = "Right Arm"
- Part19.Parent = Model0
- Part19.BrickColor = BrickColor.new("Lime green")
- Part19.CanCollide = false
- Part19.FormFactor = Enum.FormFactor.Symmetric
- Part19.Size = Vector3.new(1, 2, 1)
- Part19.CFrame = CFrame.new(-28.5, 3.00001001, -11, 1, 0, 0, 0, 0.999999881, 0, 0, 0, 1)
- Part19.BottomSurface = Enum.SurfaceType.Smooth
- Part19.TopSurface = Enum.SurfaceType.Smooth
- Part19.Color = Color3.new(0, 1, 0)
- Part19.Position = Vector3.new(-28.5, 3.00001001, -11)
- Part19.Color = Color3.new(0, 1, 0)
- Weld20.Name = "RightGrip"
- Weld20.Parent = Part19
- Weld20.C0 = CFrame.new(0, -1, 0, 1, 0, -0, 0, 0, 1, 0, -1, 0)
- Weld20.C1 = CFrame.new(0, 0, 1.5, 0.996545732, 0, -0.0830454826, 0.0830454826, 0, 0.996545732, 0, -1, 0)
- Weld20.Part0 = Part19
- Weld20.Part1 = Part51
- Part21.Name = "Head"
- Part21.Parent = Model0
- Part21.BrickColor = BrickColor.new("Lime green")
- Part21.FormFactor = Enum.FormFactor.Symmetric
- Part21.Size = Vector3.new(2, 1, 1)
- Part21.CFrame = CFrame.new(-30, 4.50001001, -11, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part21.BottomSurface = Enum.SurfaceType.Smooth
- Part21.TopSurface = Enum.SurfaceType.Smooth
- Part21.Color = Color3.new(0, 1, 0)
- Part21.Position = Vector3.new(-30, 4.50001001, -11)
- Part21.Color = Color3.new(0, 1, 0)
- Sound22.Name = "Hurt"
- Sound22.Parent = Part21
- Sound22.SoundId = "rbxassetid://134059106"
- Sound22.Volume = 10
- SpecialMesh23.Parent = Part21
- SpecialMesh23.Offset = Vector3.new(0, -0.5, 0)
- SpecialMesh23.Scale = Vector3.new(0.00999999978, 0.00999999978, 0.00999999978)
- SpecialMesh23.MeshType = Enum.MeshType.Sphere
- SpecialMesh23.Scale = Vector3.new(0.00999999978, 0.00999999978, 0.00999999978)
- Script24.Name = "AnimateSauce"
- Script24.Parent = Model0
- table.insert(cors,sandbox(Script24,function()
- function waitForChild(parent, childName)
- local child = parent:findFirstChild(childName)
- if child then return child end
- while true do
- child = parent.ChildAdded:wait()
- if child.Name==childName then return child end
- end
- end
- local Figure = script.Parent
- local Torso = waitForChild(Figure, "Torso")
- local RightShoulder = waitForChild(Torso, "Right Shoulder")
- local LeftShoulder = waitForChild(Torso, "Left Shoulder")
- local RightHip = waitForChild(Torso, "Right Hip")
- local LeftHip = waitForChild(Torso, "Left Hip")
- local Neck = waitForChild(Torso, "Neck")
- local Humanoid = waitForChild(Figure, "Humanoid")
- local pose = "Standing"
- local currentAnim = ""
- local currentAnimTrack = nil
- local currentAnimKeyframeHandler = nil
- local currentAnimSpeed = 1.0
- local animTable = {}
- local animNames = {
- idle = {
- { id = "http://www.roblox.com/asset/?id=125750544", weight = 9 },
- { id = "http://www.roblox.com/asset/?id=125750618", weight = 1 }
- },
- walk = {
- { id = "http://www.roblox.com/asset/?id=125749145", weight = 10 }
- },
- run = {
- { id = "run.xml", weight = 10 }
- },
- jump = {
- { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
- },
- fall = {
- { id = "http://www.roblox.com/asset/?id=125750759", weight = 10 }
- },
- climb = {
- { id = "http://www.roblox.com/asset/?id=125750800", weight = 10 }
- },
- toolnone = {
- { id = "http://www.roblox.com/asset/?id=125750867", weight = 10 }
- },
- toolslash = {
- { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
- -- { id = "slash.xml", weight = 10 }
- },
- toollunge = {
- { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
- },
- wave = {
- { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
- },
- point = {
- { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
- },
- dance = {
- { id = "http://www.roblox.com/asset/?id=130018893", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=132546839", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=132546884", weight = 10 }
- },
- dance2 = {
- { id = "http://www.roblox.com/asset/?id=160934142", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=160934298", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=160934376", weight = 10 }
- },
- dance3 = {
- { id = "http://www.roblox.com/asset/?id=160934458", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=160934530", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=160934593", weight = 10 }
- },
- laugh = {
- { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
- },
- cheer = {
- { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
- },
- }
- -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
- local emoteNames = { wave = false, point = false, dance = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
- math.randomseed(tick())
- function configureAnimationSet(name, fileList)
- if (animTable[name] ~= nil) then
- for _, connection in pairs(animTable[name].connections) do
- connection:disconnect()
- end
- end
- animTable[name] = {}
- animTable[name].count = 0
- animTable[name].totalWeight = 0
- animTable[name].connections = {}
- -- check for config values
- local config = script:FindFirstChild(name)
- if (config ~= nil) then
- -- print("Loading anims " .. name)
- table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
- table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
- local idx = 1
- for _, childPart in pairs(config:GetChildren()) do
- if (childPart:IsA("Animation")) then
- table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
- animTable[name][idx] = {}
- animTable[name][idx].anim = childPart
- local weightObject = childPart:FindFirstChild("Weight")
- if (weightObject == nil) then
- animTable[name][idx].weight = 1
- else
- animTable[name][idx].weight = weightObject.Value
- end
- animTable[name].count = animTable[name].count + 1
- animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
- -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
- idx = idx + 1
- end
- end
- end
- -- fallback to defaults
- if (animTable[name].count <= 0) then
- for idx, anim in pairs(fileList) do
- animTable[name][idx] = {}
- animTable[name][idx].anim = Instance.new("Animation")
- animTable[name][idx].anim.Name = name
- animTable[name][idx].anim.AnimationId = anim.id
- animTable[name][idx].weight = anim.weight
- animTable[name].count = animTable[name].count + 1
- animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
- -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
- end
- end
- end
- -- Setup animation objects
- function scriptChildModified(child)
- local fileList = animNames[child.Name]
- if (fileList ~= nil) then
- configureAnimationSet(child.Name, fileList)
- end
- end
- script.ChildAdded:connect(scriptChildModified)
- script.ChildRemoved:connect(scriptChildModified)
- for name, fileList in pairs(animNames) do
- configureAnimationSet(name, fileList)
- end
- -- ANIMATION
- -- declarations
- local toolAnim = "None"
- local toolAnimTime = 0
- local jumpAnimTime = 0
- local jumpAnimDuration = 0.3
- local toolTransitionTime = 0.1
- local fallTransitionTime = 0.3
- local jumpMaxLimbVelocity = 0.75
- -- functions
- function stopAllAnimations()
- local oldAnim = currentAnim
- -- return to idle if finishing an emote
- if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
- oldAnim = "idle"
- end
- currentAnim = ""
- 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
- -- print("Keyframe : ".. frameName)
- local repeatAnim = stopAllAnimations()
- local animSpeed = currentAnimSpeed
- playAnimation(repeatAnim, 0.0, Humanoid)
- setAnimationSpeed(animSpeed)
- end
- end
- -- Preload animations
- function playAnimation(animName, transitionTime, humanoid)
- local idleFromEmote = (animName == "idle" and emoteNames[currentAnim] ~= nil)
- if (animName ~= currentAnim and not idleFromEmote) then
- if (currentAnimTrack ~= nil) then
- currentAnimTrack:Stop(transitionTime)
- currentAnimTrack:Destroy()
- end
- currentAnimSpeed = 1.0
- local roll = math.random(1, animTable[animName].totalWeight)
- local origRoll = roll
- local idx = 1
- while (roll > animTable[animName][idx].weight) do
- roll = roll - animTable[animName][idx].weight
- idx = idx + 1
- end
- -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
- local anim = animTable[animName][idx].anim
- -- load it to the humanoid; get AnimationTrack
- currentAnimTrack = humanoid:LoadAnimation(anim)
- -- play the animation
- currentAnimTrack:Play(transitionTime)
- currentAnim = animName
- -- set up keyframe name triggers
- if (currentAnimKeyframeHandler ~= nil) then
- currentAnimKeyframeHandler:disconnect()
- end
- currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
- end
- end
- -------------------------------------------------------------------------------------------
- -------------------------------------------------------------------------------------------
- local toolAnimName = ""
- local toolAnimTrack = nil
- local currentToolAnimKeyframeHandler = nil
- function toolKeyFrameReachedFunc(frameName)
- if (frameName == "End") then
- -- print("Keyframe : ".. frameName)
- local repeatAnim = stopToolAnimations()
- playToolAnimation(repeatAnim, 0.0, Humanoid)
- end
- end
- function playToolAnimation(animName, transitionTime, humanoid)
- if (animName ~= toolAnimName) then
- if (toolAnimTrack ~= nil) then
- toolAnimTrack:Stop()
- toolAnimTrack:Destroy()
- transitionTime = 0
- end
- local roll = math.random(1, animTable[animName].totalWeight)
- local origRoll = roll
- local idx = 1
- while (roll > animTable[animName][idx].weight) do
- roll = roll - animTable[animName][idx].weight
- idx = idx + 1
- end
- -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
- local anim = animTable[animName][idx].anim
- -- load it to the humanoid; get AnimationTrack
- toolAnimTrack = humanoid:LoadAnimation(anim)
- -- play the animation
- toolAnimTrack:Play(transitionTime)
- toolAnimName = animName
- currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
- end
- end
- function stopToolAnimations()
- local oldAnim = toolAnimName
- if (currentToolAnimKeyframeHandler ~= nil) then
- currentToolAnimKeyframeHandler:disconnect()
- end
- toolAnimName = ""
- if (toolAnimTrack ~= nil) then
- toolAnimTrack:Stop()
- toolAnimTrack:Destroy()
- toolAnimTrack = nil
- end
- return oldAnim
- end
- -------------------------------------------------------------------------------------------
- -------------------------------------------------------------------------------------------
- function onRunning(speed)
- if speed>0.01 then
- playAnimation("walk", 0.1, Humanoid)
- 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
- stopAllAnimations()
- moveSit()
- return
- elseif (pose == "Running") then
- playAnimation("walk", 0.1, Humanoid)
- elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
- -- print("Wha " .. pose)
- amplitude = 0.1
- frequency = 1
- setAngles = true
- end
- if (setAngles) then
- desiredAngle = amplitude * math.sin(time * frequency)
- RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
- LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
- RightHip:SetDesiredAngle(-desiredAngle)
- LeftHip:SetDesiredAngle(-desiredAngle)
- end
- -- Tool Animation handling
- local tool = getTool()
- if tool then
- animStringValueObject = getToolAnim(tool)
- if animStringValueObject then
- toolAnim = animStringValueObject.Value
- -- message recieved, delete StringValue
- animStringValueObject.Parent = nil
- toolAnimTime = time + .3
- end
- if time > toolAnimTime then
- toolAnimTime = 0
- toolAnim = "None"
- end
- animateTool()
- else
- stopToolAnimations()
- toolAnim = "None"
- toolAnimTime = 0
- end
- end
- -- connect events
- Humanoid.Died:connect(onDied)
- Humanoid.Running:connect(onRunning)
- Humanoid.Jumping:connect(onJumping)
- Humanoid.Climbing:connect(onClimbing)
- Humanoid.GettingUp:connect(onGettingUp)
- Humanoid.FreeFalling:connect(onFreeFall)
- Humanoid.FallingDown:connect(onFallingDown)
- Humanoid.Seated:connect(onSeated)
- Humanoid.PlatformStanding:connect(onPlatformStanding)
- Humanoid.Swimming:connect(onSwimming)
- -- setup emote chat hook
- -- main program
- local runService = game:service("RunService");
- -- initialize to idle
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- while Figure.Parent~=nil do
- local _, time = wait(0.1)
- move(time)
- end
- end))
- StringValue25.Name = "climb"
- StringValue25.Parent = Script24
- Animation26.Name = "ClimbAnim"
- Animation26.Parent = StringValue25
- Animation26.AnimationId = "http://www.roblox.com/asset/?id=125750800"
- StringValue27.Name = "fall"
- StringValue27.Parent = Script24
- Animation28.Name = "FallAnim"
- Animation28.Parent = StringValue27
- Animation28.AnimationId = "http://www.roblox.com/asset/?id=125750759"
- StringValue29.Name = "idle"
- StringValue29.Parent = Script24
- Animation30.Name = "Animation1"
- Animation30.Parent = StringValue29
- Animation30.AnimationId = "http://www.roblox.com/asset/?id=125750544"
- NumberValue31.Name = "Weight"
- NumberValue31.Parent = Animation30
- NumberValue31.Value = 9
- Animation32.Name = "Animation2"
- Animation32.Parent = StringValue29
- Animation32.AnimationId = "http://www.roblox.com/asset/?id=125750618"
- NumberValue33.Name = "Weight"
- NumberValue33.Parent = Animation32
- NumberValue33.Value = 1
- StringValue34.Name = "jump"
- StringValue34.Parent = Script24
- Animation35.Name = "JumpAnim"
- Animation35.Parent = StringValue34
- Animation35.AnimationId = "http://www.roblox.com/asset/?id=125750702"
- StringValue36.Name = "run"
- StringValue36.Parent = Script24
- Animation37.Name = "RunAnim"
- Animation37.Parent = StringValue36
- Animation37.AnimationId = "http://www.roblox.com/asset/?id=125749145"
- StringValue38.Name = "toolnone"
- StringValue38.Parent = Script24
- Animation39.Name = "ToolNoneAnim"
- Animation39.Parent = StringValue38
- Animation39.AnimationId = "http://www.roblox.com/asset/?id=125750867"
- StringValue40.Name = "walk"
- StringValue40.Parent = Script24
- Animation41.Name = "WalkAnim"
- Animation41.Parent = StringValue40
- Animation41.AnimationId = "http://www.roblox.com/asset/?id=125749145"
- Shirt42.Parent = Model0
- Shirt42.ShirtTemplate = "rbxassetid://1061437532"
- Animation43.Name = "Swing"
- Animation43.Parent = Model0
- Animation43.AnimationId = "rbxassetid://94161088"
- Script44.Name = "MonsterMain"
- Script44.Parent = Model0
- table.insert(cors,sandbox(Script44,function()
- --[[ By: Brutez. ]]--
- local JeffTheKillerScript=script;
- repeat Wait(0)until JeffTheKillerScript and JeffTheKillerScript.Parent and JeffTheKillerScript.Parent.ClassName=="Model"and JeffTheKillerScript.Parent:FindFirstChild("Head")and JeffTheKillerScript.Parent:FindFirstChild("Torso");
- local JeffTheKiller=JeffTheKillerScript.Parent;
- function raycast(Spos,vec,currentdist)
- local hit2,pos2=game.Workspace:FindPartOnRay(Ray.new(Spos+(vec*.05),vec*currentdist),JeffTheKiller);
- if hit2~=nil and pos2 then
- if hit2.Name=="Handle" and not hit2.CanCollide or string.sub(hit2.Name,1,6)=="Effect"and not hit2.CanCollide then
- local currentdist=currentdist-(pos2-Spos).magnitude;
- return raycast(pos2,vec,currentdist);
- end;
- end;
- return hit2,pos2;
- end;
- function RayCast(Position,Direction,MaxDistance,IgnoreList)
- return Game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(Position,Direction.unit*(MaxDistance or 999.999)),IgnoreList);
- end;
- --[[if JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Thumbnail")then]]--
- --[[JeffTheKiller:FindFirstChild("Thumbnail"):Destroy();]]--
- --[[end;]]--
- local JeffTheKillerHumanoid;
- for _,Child in pairs(JeffTheKiller:GetChildren())do
- if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
- JeffTheKillerHumanoid=Child;
- end;
- end;
- local AttackDebounce=false;
- local JeffTheKillerKnife=JeffTheKiller:FindFirstChild("Knife");
- local JeffTheKillerHead=JeffTheKiller:FindFirstChild("Head");
- local JeffTheKillerHumanoidRootPart=JeffTheKiller:FindFirstChild("HumanoidRootPart");
- local WalkDebounce=false;
- local Notice=false;
- local JeffLaughDebounce=false;
- local MusicDebounce=false;
- local NoticeDebounce=false;
- local ChosenMusic;
- JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0,1,0,1,-0);
- local OriginalC0=JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0;
- function FindNearestBae()
- local NoticeDistance=100;
- local TargetMain;
- for _,TargetModel in pairs(Game:GetService("Workspace"):GetChildren())do
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and TargetModel.className=="Model"and TargetModel~=JeffTheKiller and TargetModel.Name~=JeffTheKiller.Name and TargetModel:FindFirstChild("Torso")and TargetModel:FindFirstChild("Head")then
- local TargetPart=TargetModel:FindFirstChild("Torso");
- local FoundHumanoid;
- for _,Child in pairs(TargetModel:GetChildren())do
- if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
- FoundHumanoid=Child;
- end;
- end;
- if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<NoticeDistance then
- TargetMain=TargetPart;
- NoticeDistance=(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude;
- local hit,pos=raycast(JeffTheKillerHumanoidRootPart.Position,(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).unit,500)
- if hit and hit.Parent and hit.Parent.ClassName=="Model"and hit.Parent:FindFirstChild("Torso")and hit.Parent:FindFirstChild("Head")then
- if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<9 and not AttackDebounce then
- Spawn(function()
- AttackDebounce=true;
- local SwingAnimation=JeffTheKillerHumanoid:LoadAnimation(JeffTheKiller:FindFirstChild("Swing"));
- local SwingChoice=math.random(1,2);
- local HitChoice=math.random(1,3);
- SwingAnimation:Play();
- SwingAnimation:AdjustSpeed(1.5+(math.random()*0.1));
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Swing")then
- local SwingSound=JeffTheKillerKnife:FindFirstChild("Swing");
- SwingSound.Pitch=1+(math.random()*0.04);
- SwingSound:Play();
- end;
- Wait(0.3);
- if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<8 then
- FoundHumanoid:TakeDamage(30);
- if HitChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit1")then
- local HitSound=JeffTheKillerKnife:FindFirstChild("Hit1");
- HitSound.Pitch=1+(math.random()*0.04);
- HitSound:Play();
- elseif HitChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit2")then
- local HitSound=JeffTheKillerKnife:FindFirstChild("Hit2");
- HitSound.Pitch=1+(math.random()*0.04);
- HitSound:Play();
- elseif HitChoice==3 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit3")then
- local HitSound=JeffTheKillerKnife:FindFirstChild("Hit3");
- HitSound.Pitch=1+(math.random()*0.04);
- HitSound:Play();
- end;
- end;
- Wait(0.1);
- AttackDebounce=false;
- end);
- end;
- end;
- end;
- end;
- end;
- return TargetMain;
- end;
- while Wait(0)do
- local TargetPoint=JeffTheKillerHumanoid.TargetPoint;
- local Blockage,BlockagePos=RayCast((JeffTheKillerHumanoidRootPart.CFrame+CFrame.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(TargetPoint.X,JeffTheKillerHumanoidRootPart.Position.Y,TargetPoint.Z)).lookVector*(JeffTheKillerHumanoidRootPart.Size.Z/2)).p,JeffTheKillerHumanoidRootPart.CFrame.lookVector,(JeffTheKillerHumanoidRootPart.Size.Z*2.5),{JeffTheKiller,JeffTheKiller})
- local Jumpable=false;
- if Blockage then
- Jumpable=true;
- if Blockage and Blockage.Parent and Blockage.Parent.ClassName~="Workspace"then
- local BlockageHumanoid;
- for _,Child in pairs(Blockage.Parent:GetChildren())do
- if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
- BlockageHumanoid=Child;
- end;
- end;
- if Blockage and Blockage:IsA("Terrain")then
- local CellPos=Blockage:WorldToCellPreferSolid((BlockagePos-Vector3.new(0,2,0)));
- local CellMaterial,CellShape,CellOrientation=Blockage:GetCell(CellPos.X,CellPos.Y,CellPos.Z);
- if CellMaterial==Enum.CellMaterial.Water then
- Jumpable=false;
- end;
- elseif BlockageHumanoid or Blockage.ClassName=="TrussPart"or Blockage.ClassName=="WedgePart"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Hat"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Tool"then
- Jumpable=false;
- end;
- end;
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and not JeffTheKillerHumanoid.Sit and Jumpable then
- JeffTheKillerHumanoid.Jump=true;
- end;
- end;
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHumanoidRootPart and JeffTheKillerHead:FindFirstChild("Jeff_Step")and (JeffTheKillerHumanoidRootPart.Velocity-Vector3.new(0,JeffTheKillerHumanoidRootPart.Velocity.y,0)).magnitude>=5 and not WalkDebounce and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
- Spawn(function()
- WalkDebounce=true;
- local FiredRay=Ray.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(0,-4,0));
- local RayTarget,endPoint=Game:GetService("Workspace"):FindPartOnRay(FiredRay,JeffTheKiller);
- if RayTarget then
- local JeffTheKillerHeadFootStepClone=JeffTheKillerHead:FindFirstChild("Jeff_Step"):Clone();
- JeffTheKillerHeadFootStepClone.Parent=JeffTheKillerHead;
- JeffTheKillerHeadFootStepClone:Play();
- JeffTheKillerHeadFootStepClone:Destroy();
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed<17 then
- Wait(0.4);
- elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed>17 then
- Wait(0.15);
- end
- end;
- WalkDebounce=false;
- end);
- end;
- local MainTarget=FindNearestBae();
- local FoundHumanoid;
- if MainTarget then
- for _,Child in pairs(MainTarget.Parent:GetChildren())do
- if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
- FoundHumanoid=Child;
- end;
- end;
- end;
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and MainTarget.Parent and FoundHumanoid and FoundHumanoid.Jump then
- JeffTheKillerHumanoid.Jump=true;
- end;
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<25 then
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")and not JeffTheKillerHead:FindFirstChild("Jeff_Laugh").IsPlaying then
- JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=1;
- JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Play();
- end;
- elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>25 then
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")and JeffTheKillerHead:FindFirstChild("Jeff_Laugh").IsPlaying then
- if not JeffLaughDebounce then
- Spawn(function()
- JeffLaughDebounce=true;
- repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")then JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume==0 or JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume<0;
- JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=0;
- JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Stop();
- JeffLaughDebounce=false;
- end);
- end;
- end;
- end;
- if not ChosenMusic and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<50 then
- local MusicChoice=math.random(1,2);
- if MusicChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1")then
- ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1");
- elseif MusicChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2")then
- ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2");
- end;
- if JeffTheKillerScript and JeffTheKiller and ChosenMusic and not ChosenMusic.IsPlaying then
- ChosenMusic.Volume=0.5;
- ChosenMusic:Play();
- end;
- elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>50 then
- if JeffTheKillerScript and JeffTheKiller and ChosenMusic and ChosenMusic.IsPlaying then
- if not MusicDebounce then
- Spawn(function()
- MusicDebounce=true;
- repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0;
- if ChosenMusic then
- ChosenMusic.Volume=0;
- ChosenMusic:Stop();
- end;
- ChosenMusic=nil;
- MusicDebounce=false;
- end);
- end;
- end;
- end;
- if not MainTarget and not JeffLaughDebounce then
- Spawn(function()
- JeffLaughDebounce=true;
- repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")then JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume==0 or JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume<0;
- JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=0;
- JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Stop();
- JeffLaughDebounce=false;
- end);
- end;
- if not MainTarget and not MusicDebounce then
- Spawn(function()
- MusicDebounce=true;
- repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0;
- if ChosenMusic then
- ChosenMusic.Volume=0;
- ChosenMusic:Stop();
- end;
- ChosenMusic=nil;
- MusicDebounce=false;
- end);
- end;
- if MainTarget then
- Notice=true;
- if Notice and not NoticeDebounce and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Susto2")then
- JeffTheKillerHead:FindFirstChild("Jeff_Susto2"):Play();
- NoticeDebounce=true;
- end
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
- if MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>5 then
- JeffTheKillerHumanoid.WalkSpeed=30;
- elseif MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<5 then
- JeffTheKillerHumanoid.WalkSpeed=0.004;
- end;
- JeffTheKillerHumanoid:MoveTo(MainTarget.Position+(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).unit*2,Game:GetService("Workspace"):FindFirstChild("Terrain"));
- local NeckRotation=(JeffTheKiller:FindFirstChild("Torso").Position.Y-MainTarget.Parent:FindFirstChild("Head").Position.Y)/10;
- if NeckRotation>-1.5 and NeckRotation<1.5 then
- JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=OriginalC0*CFrame.fromEulerAnglesXYZ(NeckRotation,0,0);
- end;
- if NeckRotation<-1.5 then
- JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,-0.993636549,0.112633869,0,0.112633869,0.993636549);
- elseif NeckRotation>1.5 then
- JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0.996671617,0.081521146,0,0.081521146,-0.996671617);
- end;
- else
- end;
- else
- Notice=false;
- NoticeDebounce=false;
- JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0,1,0,1,-0);
- local RandomWalk=math.random(1,150);
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
- JeffTheKillerHumanoid.WalkSpeed=12;
- if RandomWalk==1 then
- JeffTheKillerHumanoid:MoveTo(Game:GetService("Workspace"):FindFirstChild("Terrain").Position+Vector3.new(math.random(-2048,2048),0,math.random(-2048,2048)),Game:GetService("Workspace"):FindFirstChild("Terrain"));
- end;
- end;
- end;
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid then
- JeffTheKillerHumanoid.DisplayDistanceType="None";
- JeffTheKillerHumanoid.HealthDisplayDistance=0;
- JeffTheKillerHumanoid.Name="ColdBloodedKiller";
- JeffTheKillerHumanoid.NameDisplayDistance=0;
- JeffTheKillerHumanoid.NameOcclusion="EnemyOcclusion";
- JeffTheKillerHumanoid.AutoJumpEnabled=true;
- JeffTheKillerHumanoid.AutoRotate=true;
- JeffTheKillerHumanoid.MaxHealth=500;
- JeffTheKillerHumanoid.JumpPower=60;
- JeffTheKillerHumanoid.MaxSlopeAngle=89.9;
- end;
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoJumpEnabled then
- JeffTheKillerHumanoid.AutoJumpEnabled=true;
- end;
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoRotate then
- JeffTheKillerHumanoid.AutoRotate=true;
- end;
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.PlatformStand then
- JeffTheKillerHumanoid.PlatformStand=false;
- end;
- if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Sit then
- JeffTheKillerHumanoid.Sit=false;
- end;
- end;
- --[[ By: Brutez. ]]--
- end))
- BodyColors45.Parent = Model0
- BodyColors45.HeadColor = BrickColor.new("Lime green")
- BodyColors45.LeftArmColor = BrickColor.new("Lime green")
- BodyColors45.LeftLegColor = BrickColor.new("Lime green")
- BodyColors45.RightArmColor = BrickColor.new("Lime green")
- BodyColors45.RightLegColor = BrickColor.new("Lime green")
- BodyColors45.TorsoColor = BrickColor.new("Lime green")
- Sound46.Name = "BossMusic"
- Sound46.Parent = Model0
- Sound46.SoundId = "rbxassetid://1071438257"
- Sound46.Volume = 2
- Sound46.Looped = true
- Script47.Parent = Sound46
- table.insert(cors,sandbox(Script47,function()
- wait(1)
- script.Parent:Play()
- end))
- Script48.Name = "Sound"
- Script48.Parent = Model0
- table.insert(cors,sandbox(Script48,function()
- -- util
- 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
- function newSound(id)
- local sound = Instance.new("Sound")
- sound.SoundId = id
- sound.archivable = false
- sound.Parent = script.Parent.Head
- return sound
- end
- -- declarations
- local sDied = newSound("rbxassetid://133918674")
- sDied.Pitch = 1
- sDied.Volume = 1
- local sFallingDown = newSound("rbxasset://sounds/splat.wav")
- local sFreeFalling = newSound("rbxasset://sounds/swoosh.wav")
- local sGettingUp = newSound("rbxasset://sounds/hit.wav")
- local sJumping = newSound("rbxasset://sounds/button.wav")
- local sRunning = newSound("rbxasset://sounds/bfsl-minifigfoots1.mp3")
- sRunning.Looped = true
- local Figure = script.Parent
- local Head = waitForChild(Figure, "Head")
- local Humanoid = waitForChild(Figure, "Humanoid")
- -- functions
- function onDied()
- sDied:Play()
- wait(2.5)
- script.Parent:Destroy()
- end
- function onState(state, sound)
- if state then
- sound:Play()
- else
- sound:Pause()
- end
- end
- function onRunning(speed)
- if speed>0 then
- sRunning:Play()
- else
- sRunning:Pause()
- end
- end
- -- connect up
- Humanoid.Died:connect(onDied)
- Humanoid.Running:connect(onRunning)
- Humanoid.Jumping:connect(function(state) onState(state, sJumping) end)
- Humanoid.GettingUp:connect(function(state) onState(state, sGettingUp) end)
- Humanoid.FreeFalling:connect(function(state) onState(state, sFreeFalling) end)
- Humanoid.FallingDown:connect(function(state) onState(state, sFallingDown) end)
- end))
- Humanoid49.Parent = Model0
- Humanoid49.RightLeg = Part17
- Humanoid49.LeftLeg = Part16
- Humanoid49.Torso = Part1
- Humanoid49.Health = 10000
- Humanoid49.MaxHealth = 10000
- Humanoid49.WalkSpeed = 14
- Tool50.Name = "Cain saw"
- Tool50.Parent = Model0
- Tool50.GripForward = Vector3.new(0.0830454826, -0.996545732, -0)
- Tool50.GripPos = Vector3.new(0, 0, 1.5)
- Tool50.GripRight = Vector3.new(0.996545732, 0.0830454826, 0)
- Tool50.GripUp = Vector3.new(0, 0, -1)
- Part51.Name = "Handle"
- Part51.Parent = Tool50
- Part51.BrickColor = BrickColor.new("Dark stone grey")
- Part51.Reflectance = 0.40000000596046
- Part51.Rotation = Vector3.new(0, 0, -4.75999975)
- Part51.CanCollide = false
- Part51.FormFactor = Enum.FormFactor.Plate
- Part51.Size = Vector3.new(1, 0.800000012, 4)
- Part51.CFrame = CFrame.new(-28.5, 2.00001001, -12.5, 0.996545732, 0.0830454826, 0, -0.0830454752, 0.996545613, 0, 0, 0, 1)
- Part51.BottomSurface = Enum.SurfaceType.Smooth
- Part51.TopSurface = Enum.SurfaceType.Smooth
- Part51.Color = Color3.new(0.388235, 0.372549, 0.384314)
- Part51.Position = Vector3.new(-28.5, 2.00001001, -12.5)
- Part51.Orientation = Vector3.new(0, 0, -4.75999975)
- Part51.Color = Color3.new(0.388235, 0.372549, 0.384314)
- SpecialMesh52.Parent = Part51
- SpecialMesh52.MeshId = "http://www.roblox.com/asset/?id=2766469"
- SpecialMesh52.Scale = Vector3.new(1, 1, 1.29999995)
- SpecialMesh52.TextureId = "rbxasset://textures/SwordTexture.png"
- SpecialMesh52.MeshType = Enum.MeshType.FileMesh
- SpecialMesh52.Scale = Vector3.new(1, 1, 1.29999995)
- Sound53.Parent = Part51
- Sound54.Parent = Part51
- Sound55.Parent = Part51
- Sound55.Volume = 0.69999998807907
- Sound56.Parent = Part51
- Sound56.Volume = 1
- Sound57.Parent = Part51
- Sound57.SoundId = "http://www.roblox.com/asset/?id=2766589"
- Sound57.Volume = 1
- Sound58.Parent = Part51
- Sound58.Volume = 0.69999998807907
- Sound59.Parent = Part51
- Sound59.Volume = 1
- Sound60.Parent = Part51
- Sound60.Volume = 0.69999998807907
- Sound61.Parent = Part51
- Sound61.Volume = 1
- Sound62.Parent = Part51
- Sound62.Volume = 0.69999998807907
- Sound63.Parent = Part51
- Sound63.Volume = 1
- Sound64.Parent = Part51
- Sound64.Volume = 0.69999998807907
- Sound65.Parent = Part51
- Sound65.Volume = 1
- Sound66.Parent = Part51
- Sound66.Volume = 0.69999998807907
- Sound67.Parent = Part51
- Sound67.Volume = 1
- Sound68.Parent = Part51
- Sound68.Volume = 0.69999998807907
- Sound69.Parent = Part51
- Sound69.Volume = 1
- Sound70.Parent = Part51
- Sound70.Volume = 0.69999998807907
- Sound71.Parent = Part51
- Sound71.Volume = 1
- Sound72.Parent = Part51
- Sound72.Volume = 0.69999998807907
- Sound73.Parent = Part51
- Sound73.Volume = 1
- Sound74.Parent = Part51
- Sound74.Volume = 0.69999998807907
- Sound75.Parent = Part51
- Sound75.Volume = 1
- Sound76.Parent = Part51
- Sound76.Volume = 0.69999998807907
- Sound77.Parent = Part51
- Sound77.Volume = 1
- Sound78.Parent = Part51
- Sound78.Volume = 0.69999998807907
- Sound79.Parent = Part51
- Sound79.Volume = 1
- Sound80.Parent = Part51
- Sound80.Volume = 0.69999998807907
- Sound81.Parent = Part51
- Sound81.Volume = 1
- Sound82.Parent = Part51
- Sound82.Volume = 0.69999998807907
- Sound83.Parent = Part51
- Sound83.Volume = 1
- Sound84.Parent = Part51
- Sound84.Volume = 0.69999998807907
- Sound85.Parent = Part51
- Sound85.Volume = 1
- Sound86.Parent = Part51
- Sound86.Volume = 0.69999998807907
- Sound87.Parent = Part51
- Sound87.Volume = 1
- Sound88.Parent = Part51
- Sound88.Volume = 0.69999998807907
- Sound89.Parent = Part51
- Sound89.Volume = 1
- Sound90.Parent = Part51
- Sound90.Volume = 0.69999998807907
- Sound91.Parent = Part51
- Sound91.Volume = 1
- Sound92.Parent = Part51
- Sound92.Volume = 0.69999998807907
- Sound93.Parent = Part51
- Sound93.Volume = 1
- LocalScript94.Name = "Local Gui"
- LocalScript94.Parent = Tool50
- Script95.Name = "Sword Script"
- Script95.Parent = Tool50
- table.insert(cors,sandbox(Script95,function()
- -------- OMG HAX
- r = game:service("RunService")
- local damage = 50
- local slash_damage = 50
- sword = script.Parent.Handle
- Tool = script.Parent
- local SlashSound = Instance.new("Sound")
- SlashSound.SoundId = "ca44f4f00def1e47ab481d97fe3586ce"
- SlashSound.Parent = sword
- SlashSound.Volume = .7
- local UnsheathSound = Instance.new("Sound")
- UnsheathSound.SoundId = "db5eaca58f42785dd69a16c6df0e765d"
- UnsheathSound.Parent = sword
- UnsheathSound.Volume = 1
- function blow(hit)
- local humanoid = hit.Parent:findFirstChild("Zombie")
- local vCharacter = Tool.Parent
- local vPlayer = game.Players:playerFromCharacter(vCharacter)
- local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
- if humanoid~=nil and humanoid ~= hum and hum ~= nil then
- print("SWORD HIT")
- tagHumanoid(humanoid, vPlayer)
- humanoid:TakeDamage(damage)
- wait(1)
- untagHumanoid(humanoid)
- end
- end
- function tagHumanoid(humanoid, player)
- local creator_tag = Instance.new("ObjectValue")
- creator_tag.Value = player
- creator_tag.Name = "creator"
- creator_tag.Parent = humanoid
- end
- function untagHumanoid(humanoid)
- if humanoid ~= nil then
- local tag = humanoid:findFirstChild("creator")
- if tag ~= nil then
- tag.Parent = nil
- end
- end
- end
- function attack()
- damage = slash_damage
- SlashSound:play()
- local anim = Instance.new("StringValue")
- anim.Name = "toolanim"
- anim.Value = "Slash"
- anim.Parent = Tool
- end
- function swordUp()
- Tool.GripForward = Vector3.new(-1.1,0,0)
- Tool.GripRight = Vector3.new(0,1,0)
- Tool.GripUp = Vector3.new(0,0,1)
- end
- function swordOut()
- Tool.GripForward = Vector3.new(0,0,1)
- Tool.GripRight = Vector3.new(0,-1,0)
- Tool.GripUp = Vector3.new(-1,0,0)
- end
- function swordAcross()
- -- parry
- end
- Tool.Enabled = true
- local last_attack = 0
- function onActivated()
- if not Tool.Enabled then
- return
- end
- Tool.Enabled = false
- local character = Tool.Parent;
- local humanoid = character.Humanoid
- if humanoid == nil then
- print("Humanoid not found")
- return
- end
- t = r.Stepped:wait()
- attack()
- last_attack = t
- --wait(.5)
- Tool.Enabled = true
- end
- function onEquipped()
- UnsheathSound:play()
- end
- script.Parent.Activated:connect(onActivated)
- script.Parent.Equipped:connect(onEquipped)
- connection = sword.Touched:connect(blow)
- end))
- ShirtGraphic96.Parent = Model0
- ShirtGraphic96.Graphic = "http://www.roblox.com/asset/?id=11149596"
- Script97.Name = "HealthBarGUIScript"
- Script97.Parent = Model0
- table.insert(cors,sandbox(Script97,function()
- Humanoid = script.Parent.Humanoid
- function GainCharge(Humanoid)
- Humanoid.Parent.Torso.Healthbar.Frame.Full.Size = UDim2.new(Humanoid.Health/Humanoid.MaxHealth,0,1,0)
- if Humanoid.Health >= Humanoid.MaxHealth/2 then
- Humanoid.Parent.Torso.Healthbar.Frame.Full.BackgroundColor3 = Color3.new(0,200/255,0)
- elseif Humanoid.Health >= Humanoid.MaxHealth/4 and Humanoid.Health <= Humanoid.MaxHealth/2 then
- Humanoid.Parent.Torso.Healthbar.Frame.Full.BackgroundColor3 = Color3.new(200/255,0,0)
- elseif Humanoid.Health <= Humanoid.MaxHealth/4 then
- Humanoid.Parent.Torso.Healthbar.Frame.Full.BackgroundColor3 = Color3.new(200/255,0,0)
- end
- end
- Humanoid.HealthChanged:connect(function() GainCharge(Humanoid) end)
- end))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = script
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement