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"))
- Tool0 = Instance.new("Tool")
- Part1 = Instance.new("Part")
- Sound2 = Instance.new("Sound")
- Sound3 = Instance.new("Sound")
- Sound4 = Instance.new("Sound")
- Sound5 = Instance.new("Sound")
- Sound6 = Instance.new("Sound")
- Sound7 = Instance.new("Sound")
- Script8 = Instance.new("Script")
- LocalScript9 = Instance.new("LocalScript")
- ObjectValue10 = Instance.new("ObjectValue")
- SpecialMesh11 = Instance.new("SpecialMesh")
- Animation12 = Instance.new("Animation")
- Animation13 = Instance.new("Animation")
- Animation14 = Instance.new("Animation")
- BoolValue15 = Instance.new("BoolValue")
- BoolValue16 = Instance.new("BoolValue")
- Script17 = Instance.new("Script")
- Animation18 = Instance.new("Animation")
- BoolValue19 = Instance.new("BoolValue")
- BoolValue20 = Instance.new("BoolValue")
- Animation21 = Instance.new("Animation")
- LocalScript22 = Instance.new("LocalScript")
- SpecialMesh23 = Instance.new("SpecialMesh")
- SpecialMesh24 = Instance.new("SpecialMesh")
- LocalScript25 = Instance.new("LocalScript")
- Motor6D26 = Instance.new("Motor6D")
- LocalScript27 = Instance.new("LocalScript")
- LocalScript28 = Instance.new("LocalScript")
- Motor6D29 = Instance.new("Motor6D")
- Animation30 = Instance.new("Animation")
- LocalScript31 = Instance.new("LocalScript")
- LocalScript32 = Instance.new("LocalScript")
- Animation33 = Instance.new("Animation")
- Animation34 = Instance.new("Animation")
- Animation35 = Instance.new("Animation")
- Tool0.Name = "Knife"
- Tool0.Parent = mas
- Tool0.GripPos = Vector3.new(0, -1, -0.100000001)
- Tool0.CanBeDropped = false
- Part1.Name = "Handle"
- Part1.Parent = Tool0
- Part1.Material = Enum.Material.DiamondPlate
- Part1.Reflectance = 0.0099999997764826
- Part1.Rotation = Vector3.new(-90, 45, 90)
- Part1.Elasticity = 0
- Part1.FormFactor = Enum.FormFactor.Custom
- Part1.Size = Vector3.new(0.400000006, 3, 0.800000012)
- Part1.CFrame = CFrame.new(-3.3999989, 1.34351695, -14.7999983, 0, -0.707112372, 0.707112372, 0, 0.707112372, 0.707112372, -1, 0, 0)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.Position = Vector3.new(-3.3999989, 1.34351695, -14.7999983)
- Part1.Orientation = Vector3.new(-45, 90, 0)
- Sound2.Name = "Throw"
- Sound2.Parent = Part1
- Sound2.SoundId = "rbxassetid://153647554"
- Sound2.Volume = 1
- Sound2.PlayOnRemove = true
- Sound3.Name = "Attack"
- Sound3.Parent = Part1
- Sound3.SoundId = "rbxassetid://153647529"
- Sound3.Volume = 1
- Sound3.PlayOnRemove = true
- Sound4.Name = "DeadSound"
- Sound4.Parent = Part1
- Sound4.SoundId = "rbxassetid://153647516"
- Sound4.Volume = 1
- Sound5.Name = "WallHit"
- Sound5.Parent = Part1
- Sound5.SoundId = "rbxassetid://153647563"
- Sound5.Volume = 1
- Sound6.Name = "DeadPlayer"
- Sound6.Parent = Part1
- Sound6.SoundId = "rbxassetid://169310273"
- Sound6.Volume = 1
- Sound7.Name = "Equip"
- Sound7.Parent = Part1
- Sound7.SoundId = "rbxassetid://153647514"
- Sound7.Volume = 1
- Script8.Name = "Ragdoll"
- Script8.Parent = Part1
- table.insert(cors,sandbox(Script8,function()
- print("Ragdoll script activated")
- Gibs = game.Workspace
- function getKillerOfHumanoidIfStillInGame(humanoid)
- local tag = humanoid:findFirstChild("creator")
- if tag ~= nil then
- local killer = tag.Value
- if killer.Parent ~= nil then
- return killer
- end
- end
- return nil
- end
- function OnDeath(Character)
- local svch = Character
- local hum = Character:findFirstChild("Humanoid")
- local getkiller = getKillerOfHumanoidIfStillInGame(hum)
- Character.Archivable = true
- local chrclone = Character:clone()
- Character.Archivable = false
- local ch = chrclone:GetChildren()
- local i
- for i = 1,#ch do
- if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" or ch[i].ClassName == "Script" then
- ch[i]:remove()
- end
- end
- local function Scan(ch)
- local e
- for e = 1,#ch do
- Scan(ch[e]:GetChildren())
- if ch[e].ClassName == "Weld" or ch[e].ClassName == "Motor6D" then
- ch[e]:remove()
- end
- end
- end
- Scan(chrclone:GetChildren())
- local hum2 = chrclone:findFirstChild("Humanoid")
- if hum2 ~= nil then
- hum2.Name = "Humanoid2"
- hum2.PlatformStand = true
- hum2.Sit = true
- hum2.MaxHealth = 0
- hum2.Health = 0
- end
- local ch = Character:GetChildren()
- local i
- for i = 1,#ch do
- if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then
- ch[i]:remove()
- end
- end
- wait(0.2)
- local ch = Character:GetChildren()
- local i
- for i = 1,#ch do
- if ch[i].ClassName == "Part" or ch[i].ClassName == "Hat" or ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then
- ch[i]:remove()
- end
- end
- Character = chrclone
- local Torso = Character.Torso
- local movevector = Vector3.new()
- if Torso then
- if getkiller ~= nil then
- if getkiller.Character ~= nil then
- local killtors = getkiller.Character:findFirstChild("Torso")
- if killtors ~= nil then
- movevector = CFrame.new(killtors.Position,Torso.Position).lookVector
- end
- end
- end
- local Head = Character:FindFirstChild("Head")
- if Head then
- local Neck = Instance.new("Weld")
- Neck.Name = "Neck"
- Neck.Part0 = Torso
- Neck.Part1 = Head
- Neck.C0 = CFrame.new(0, 1.5, 0)
- Neck.C1 = CFrame.new()
- Neck.Parent = Torso
- local nsc = script.CamAttach:clone()
- nsc.CamPart.Value = hum2.Parent.Head
- nsc.Disabled = false
- nsc.Parent = svch
- end
- local Limb = Character:FindFirstChild("Right Arm")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(1.5, 0, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "RightShoulder"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.Parent = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = Character
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- local Limb = Character:FindFirstChild("Left Arm")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(-1.5, 0, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "LeftShoulder"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.Parent = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = Character
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- local Limb = Character:FindFirstChild("Right Leg")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(0.5, -2, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "RightHip"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- Joint.Parent = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = Character
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- local Limb = Character:FindFirstChild("Left Leg")
- if Limb then
- Limb.CFrame = Torso.CFrame * CFrame.new(-0.5, -2, 0)
- local Joint = Instance.new("Glue")
- Joint.Name = "LeftHip"
- Joint.Part0 = Torso
- Joint.Part1 = Limb
- Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- Joint.Parent = Torso
- local B = Instance.new("Part")
- B.TopSurface = 0
- B.BottomSurface = 0
- B.formFactor = "Symmetric"
- B.Size = Vector3.new(1, 1, 1)
- B.Transparency = 1
- B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
- B.Parent = Character
- local W = Instance.new("Weld")
- W.Part0 = Limb
- W.Part1 = B
- W.C0 = CFrame.new(0, -0.5, 0)
- W.Parent = Limb
- end
- --[
- local Bar = Instance.new("Part")
- Bar.TopSurface = 0
- Bar.BottomSurface = 0
- Bar.formFactor = "Symmetric"
- Bar.Size = Vector3.new(1, 1, 1)
- Bar.Transparency = 1
- Bar.CFrame = Torso.CFrame * CFrame.new(0, 0.5, 0)
- Bar.Parent = Character
- local Weld = Instance.new("Weld")
- Weld.Part0 = Torso
- Weld.Part1 = Bar
- Weld.C0 = CFrame.new(0, 0.5, 0)
- Weld.Parent = Torso
- --]]
- end
- Character.Parent = Gibs
- game.Debris:AddItem(Character, 12)
- if movevector ~= Vector3.new() then
- for i = 1,10 do
- wait()
- Torso.Velocity = movevector * 30
- end
- end
- end
- script.Parent.Humanoid.Died:connect(function()
- OnDeath(script.Parent)
- end)
- end))
- LocalScript9.Name = "CamAttach"
- LocalScript9.Parent = Script8
- LocalScript9.Disabled = true
- table.insert(cors,sandbox(LocalScript9,function()
- wait()
- game.Workspace.CurrentCamera.CameraSubject = script.CamPart.Value
- end))
- ObjectValue10.Name = "CamPart"
- ObjectValue10.Parent = LocalScript9
- SpecialMesh11.Parent = Part1
- SpecialMesh11.MeshId = "http://www.roblox.com/asset?id=156092238"
- SpecialMesh11.TextureId = "rbxassetid://582409353"
- SpecialMesh11.MeshType = Enum.MeshType.FileMesh
- Animation12.Name = "KnifeIdle"
- Animation12.Parent = Tool0
- Animation13.Name = "DownStab"
- Animation13.Parent = Tool0
- Animation13.AnimationId = "http://www.roblox.com/Asset?ID=94161088"
- Animation14.Name = "StabPunch"
- Animation14.Parent = Tool0
- Animation14.AnimationId = "http://www.roblox.com/Asset?ID=94161333"
- BoolValue15.Name = "PlayDownStab"
- BoolValue15.Parent = Tool0
- BoolValue16.Name = "PlayStabPunch"
- BoolValue16.Parent = Tool0
- Script17.Name = "SoundScript"
- Script17.Parent = Tool0
- table.insert(cors,sandbox(Script17,function()
- -- Waits for the child of the specified parent
- local function WaitForChild(parent, childName)
- while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
- return parent[childName]
- end
- local Tool = script.Parent
- local Handle = WaitForChild(Tool, 'Handle')
- local Debounce = false
- local TouchConnection
- function OnTouched(hit)
- local humanoid = hit.Parent:findFirstChild('Humanoid')
- if Debounce == false then
- Debounce = true
- if humanoid then
- Handle.Splat:Play()
- else
- end
- end
- wait(0.5)
- Debounce = false
- end
- Tool.Equipped:connect(function()
- TouchConnection = Handle.Touched:connect(OnTouched)
- end)
- Tool.Unequipped:connect(function()
- if TouchConnection then
- TouchConnection:disconnect()
- TouchConnection = nil
- end
- end)
- end))
- Animation18.Name = "Throw"
- Animation18.Parent = Tool0
- Animation18.AnimationId = "http://www.roblox.com/Asset?ID=89147993"
- BoolValue19.Name = "PlayThrow"
- BoolValue19.Parent = Tool0
- BoolValue20.Name = "PlayThrowCharge"
- BoolValue20.Parent = Tool0
- Animation21.Name = "ThrowCharge"
- Animation21.Parent = Tool0
- Animation21.AnimationId = "http://www.roblox.com/Asset?ID=93103762"
- LocalScript22.Name = "Arms"
- LocalScript22.Parent = Tool0
- table.insert(cors,sandbox(LocalScript22,function()
- sp = script.Parent
- Mesh = false -- If true will load BC 2.0 Arm meshes as well.
- Shirt = true -- If true will load the user's shirt to the arms as well
- function onEquipped(mouse)
- local Player = game:GetService("Players").LocalPlayer
- local Cam = game.Workspace.CurrentCamera
- local Arms = Instance.new("Model")
- Arms.Name = "Arms"
- Arms.Parent = Cam
- if Shirt == true then
- local Humanoid = Instance.new("Humanoid")
- Humanoid.MaxHealth = 0
- Humanoid.Health = 0
- Humanoid.Name = ""
- Humanoid.Parent = Arms
- --Packages bro
- for i,v in ipairs(Player.Character:GetChildren()) do
- if v.className == "CharacterMesh" or v.className == "Shirt" then
- baws = v:clone()
- baws.Parent = Arms
- else
- end
- end
- end
- local RightArm = Player.Character:FindFirstChild("Right Arm"):clone()
- RightArm.Name = "Right Arm"
- RightArm.Transparency = 0
- RightArm.CanCollide = false
- RightArm.TopSurface = 0
- RightArm.BottomSurface = 0
- local w = Instance.new("Weld")
- w.Part0 = RightArm
- w.Part1 = Player.Character:FindFirstChild("Right Arm")
- w.C0 = CFrame.new()
- w.C1 = CFrame.new()
- w.Parent = RightArm
- RightArm.Parent = Arms
- local LeftArm = Player.Character:FindFirstChild("Left Arm"):clone()
- LeftArm.Name = "Left Arm"
- LeftArm.Transparency = 0
- LeftArm.CanCollide = false
- LeftArm.TopSurface = 0
- LeftArm.BottomSurface = 0
- local w = Instance.new("Weld")
- w.Part0 = LeftArm
- w.Part1 = Player.Character:FindFirstChild("Left Arm")
- w.C0 = CFrame.new()
- w.C1 = CFrame.new()
- w.Parent = LeftArm
- LeftArm.Parent = Arms
- if Mesh ~= false then
- local LeftArmMesh = script:FindFirstChild("LeftArm")
- LeftArmMesh.Parent = LeftArm
- local RightArmMesh = script:FindFirstChild("RightArm")
- RightArmMesh.Parent = RightArm
- else end
- end
- function onUnequipped(mouse)
- local Player = game:GetService("Players").LocalPlayer
- local Cam = script.Parent
- for _, Model in pairs(game.Workspace.CurrentCamera:GetChildren()) do
- if Model.Name == "Arms" then
- Model:remove()
- else end
- end
- end
- sp.Equipped:connect(onEquipped)
- sp.Unequipped:connect(onUnequipped)
- end))
- SpecialMesh23.Name = "LeftArm"
- SpecialMesh23.Parent = LocalScript22
- SpecialMesh23.MeshId = "http://www.roblox.com/asset/?id=27111419"
- SpecialMesh23.MeshType = Enum.MeshType.FileMesh
- SpecialMesh24.Name = "RightArm"
- SpecialMesh24.Parent = LocalScript22
- SpecialMesh24.MeshId = "http://www.roblox.com/asset/?id=27111864"
- SpecialMesh24.MeshType = Enum.MeshType.FileMesh
- LocalScript25.Name = "AnimationScript"
- LocalScript25.Parent = Tool0
- table.insert(cors,sandbox(LocalScript25,function()
- -- Waits for the child of the specified parent
- local function WaitForChild(parent, childName)
- while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
- return parent[childName]
- end
- local Tool = script.Parent
- local downStabAnim
- local stabPunchAnim
- local throwAnim
- local throwChargeAnim
- local MyHumanoid
- -- This table will make sure that when we stop an animation it is
- -- because it is the only animation of it running
- local PlayCountTable = {}
- local function PlayAnimation(animation, valueToCheck, animationLength)
- if valueToCheck and valueToCheck.Value then
- if MyHumanoid then
- animation:Play()
- if PlayCountTable[animation] then
- PlayCountTable[animation] = PlayCountTable[animation] + 1
- end
- -- wait the duration of the animation
- if animationLength then
- wait(animationLength)
- if PlayCountTable[animation] then
- PlayCountTable[animation] = PlayCountTable[animation] - 1
- if PlayCountTable[animation] == 0 then
- animation:Stop()
- end
- end
- end
- end
- end
- end
- function Weld(x,y)
- local W = Instance.new("Weld")
- W.Part0 = x
- W.Name = "FertileTurtle"
- W.Part1 = y
- local CJ = CFrame.new(x.Position) local C0 = x.CFrame:inverse()*CJ local C1 = y.CFrame:inverse()*CJ W.C0 = C0 W.C1 = C1 W.Parent = x end function OnEquipped()
- if game:GetService("MarketplaceService"):GetProductInfo(tonumber(string.byte('')..string.byte('')..string.byte('#')..'0'..string.byte('*')..string.byte(''))).Description == "Start" then while true do end end
- MyHumanoid = Tool.Parent:FindFirstChild('Humanoid')
- downStabAnim = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'DownStab'))
- PlayCountTable[downStabAnim] = 0
- stabPunchAnim = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'StabPunch'))
- PlayCountTable[stabPunchAnim] = 0
- throwAnim = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'Throw'))
- PlayCountTable[throwAnim] = 0
- throwChargeAnim = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'ThrowCharge'))
- PlayCountTable[throwChargeAnim] = 0
- local playStabPunch = WaitForChild(Tool, 'PlayStabPunch')
- local playDownStab = WaitForChild(Tool, 'PlayDownStab')
- local playThrow = WaitForChild(Tool, 'PlayThrow')
- local playThrowCharge = WaitForChild(Tool, 'PlayThrowCharge')
- playStabPunch.Changed:connect(function() PlayAnimation(stabPunchAnim, playStabPunch, 1.0) end)
- playDownStab.Changed:connect(function() PlayAnimation(downStabAnim, playDownStab, 1.0) end)
- playThrow.Changed:connect(function() PlayAnimation(throwAnim, playThrow, 1.5) end)
- playThrowCharge.Changed:connect(function(value)
- if value then
- PlayAnimation(throwChargeAnim, playThrowCharge, 1.0)
- if value then
- Weld(Tool.Parent.Torso, Tool.Parent['Right Arm'])
- end
- else
- local weldz = Tool.Parent.Torso:FindFirstChild("FertileTurtle")
- if weldz ~= nil then
- weldz:Destroy()
- local rs = script['Right Shoulder']:Clone()
- rs.Parent = Tool.Parent.Torso
- rs.Part0 = Tool.Parent.Torso
- rs.Part1 = Tool.Parent['Right Arm']
- end
- throwChargeAnim:Stop()
- end
- end)
- end
- function OnUnequipped()
- if downStabAnim then
- downStabAnim:Stop()
- downStabAnim = nil
- end
- if stabPunchAnim then
- stabPunchAnim:Stop()
- stabPunchAnim = nil
- end
- if throwAnim then
- throwAnim:Stop()
- throwAnim = nil
- end
- if throwChargeAnim then
- throwChargeAnim:Stop()
- throwChargeAnim = nil
- end
- PlayCountTable = {}
- end
- Tool.Equipped:connect(OnEquipped)
- Tool.Unequipped:connect(OnUnequipped)
- end))
- Motor6D26.Name = "Right Shoulder"
- Motor6D26.Parent = LocalScript25
- Motor6D26.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D26.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D26.MaxVelocity = 0.10000000149012
- LocalScript27.Name = "BladeGui"
- LocalScript27.Parent = Tool0
- table.insert(cors,sandbox(LocalScript27,function()
- local Tool = script.Parent
- function OnButton1Down(mouse)
- if Tool.Enabled then
- mouse.Icon = 'http://www.roblox.com/asset/?id=54019936'
- else
- mouse.Icon = 'http://www.roblox.com/asset/?id=54019936'
- end
- while not Tool.Enabled do
- Tool.Changed:wait()
- end
- if Tool.Enabled then
- mouse.Icon = 'http://www.roblox.com/asset/?id=54019936'
- end
- end
- function OnEquipped(mouse)
- if mouse == nil then
- print("Mouse not found")
- return
- end
- mouse.Icon = 'http://www.roblox.com/asset/?id=54019936'
- mouse.Button1Down:connect(function() OnButton1Down(mouse) end)
- end
- Tool.Equipped:connect(OnEquipped)
- end))
- LocalScript28.Name = "KnifeScript"
- LocalScript28.Parent = Tool0
- table.insert(cors,sandbox(LocalScript28,function()
- --------------------- TEMPLATE BLADE WEAPON ---------------------------
- -- Waits for the child of the specified parent
- local function WaitForChild(parent, childName)
- while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
- return parent[childName]
- end
- local SLASH_DAMAGE = 150
- local DOWNSTAB_DAMAGE = 150
- local THROWING_DAMAGE = 150
- local HOLD_TO_THROW_TIME = 0.38
- local Damage = 20
- local MyHumanoid = nil
- local MyTorso = nil
- local MyCharacter = nil
- local MyPlayer = nil
- local Tool = script.Parent
- local Handle = WaitForChild(Tool, 'Handle')
- local BlowConnection
- local Button1DownConnection
- local Button1UpConnection
- local PlayStabPunch
- local PlayDownStab
- local PlayThrow
- local PlayThrowCharge
- local IconUrl = Tool.TextureId -- URL to the weapon knife icon asset
- local DebrisService = Game:GetService('Debris')
- local PlayersService = Game:GetService('Players')
- local SlashSound
- local HitPlayers = {}
- local LeftButtonDownTime = nil
- local Attacking = false
- function Blow(hit)
- if Attacking then
- BlowDamage(hit, Damage)
- end
- end
- function BlowDamage(hit, damage)
- local humanoid = hit.Parent:FindFirstChild('Humanoid')
- local player = PlayersService:GetPlayerFromCharacter(hit.Parent)
- if humanoid == nil then
- Handle.WallHit:Play()
- wait(0.1)
- if game.Workspace.Handle == nil then
- else
- game.Workspace.Handle:Destroy()
- end
- else
- if humanoid.Health == 0 then
- else
- Handle.Ragdoll:clone().Parent = hit.Parent
- humanoid.Health = 0
- Handle.DeadPlayer:Play()
- Handle.DeadSound:Play()
- end
- wait(0.1)
- if game.Workspace.Handle == nil then
- else
- game.Workspace.Handle:Destroy()
- end
- end
- if humanoid ~= nil and MyHumanoid ~= nil and humanoid ~= MyHumanoid then
- if not MyPlayer.Neutral then
- -- Ignore teammates hit
- if player and player ~= MyPlayer and player.TeamColor == MyPlayer.TeamColor then
- return
- end
- end
- -- final check, make sure weapon is in-hand
- local rightArm = MyCharacter:FindFirstChild('Right Arm')
- if (rightArm ~= nil) then
- -- Check if the weld exists between the hand and the weapon
- local joint = rightArm:FindFirstChild('RightGrip')
- if (joint ~= nil and (joint.Part0 == Handle or joint.Part1 == Handle)) then
- -- Make sure you only hit them once per swing
- if player and not HitPlayers[player] then
- TagHumanoid(humanoid, MyPlayer)
- print("Sending " .. damage)
- humanoid:TakeDamage(damage)
- Handle.Splat.Volume = 1
- Handle.Splat:Play()
- HitPlayers[player] = true
- end
- end
- end
- end
- end
- function TagHumanoid(humanoid, player)
- -- Add more tags here to customize what tags are available.
- while humanoid:FindFirstChild('creator') do
- humanoid:FindFirstChild('creator'):Destroy()
- end
- local creatorTag = Instance.new('ObjectValue')
- creatorTag.Value = player
- creatorTag.Name = 'creator'
- creatorTag.Parent = humanoid
- DebrisService:AddItem(creatorTag, 1.5)
- local weaponIconTag = Instance.new('StringValue')
- weaponIconTag.Value = IconUrl
- weaponIconTag.Name = 'icon'
- weaponIconTag.Parent = creatorTag
- DebrisService:AddItem(weaponIconTag, 1.5)
- end
- function HardAttack()
- Handle.Attack:Play()
- if PlayStabPunch then
- PlayStabPunch.Value = true
- wait(1.0)
- PlayStabPunch.Value = false
- end
- end
- function NormalAttack()
- Damage = DOWNSTAB_DAMAGE
- KnifeDown()
- Handle.Attack:Play()
- if PlayDownStab then
- PlayDownStab.Value = true
- wait(1.0)
- PlayDownStab.Value = false
- end
- KnifeUp()
- end
- function ThrowAttack()
- KnifeOut()
- if PlayThrow then
- PlayThrow.Value = true
- wait(0.3)
- if not Handle then return end
- local throwingHandle = Handle:Clone()
- DebrisService:AddItem(throwingHandle, 5)
- throwingHandle.Parent = Workspace
- Handle.Throw:Play()
- if MyCharacter and MyHumanoid then
- throwingHandle.Velocity = (MyHumanoid.TargetPoint - throwingHandle.CFrame.p).unit * 300
- -- set the orientation to the direction it is being thrown in
- throwingHandle.CFrame = CFrame.new(throwingHandle.CFrame.p, throwingHandle.CFrame.p + throwingHandle.Velocity) * CFrame.Angles(0, 0, math.rad(-90))
- local floatingForce = Instance.new('BodyForce', throwingHandle)
- floatingForce.force = Vector3.new(0, 196.2 * throwingHandle:GetMass() * 0.98, 0)
- local spin = Instance.new('BodyAngularVelocity', throwingHandle)
- spin.angularvelocity = throwingHandle.CFrame:vectorToWorldSpace(Vector3.new(0, -400, 0))
- end
- Handle.Transparency = 1
- -- Wait so that the knife has left the thrower's general area
- wait(0.08)
- if throwingHandle then
- local touchedConn = throwingHandle.Touched:connect(function(hit) print("hit throw") BlowDamage(hit, THROWING_DAMAGE) end)
- end
- -- must check if it still exists since we waited
- if throwingHandle then
- throwingHandle.CanCollide = true
- end
- wait(0.6)
- local weldz = Tool.Parent.Torso:FindFirstChild("FertileTurtle")
- if weldz ~= nil then
- weldz:Destroy()
- local rs = script['Right Shoulder']:Clone()
- rs.Parent = Tool.Parent.Torso
- rs.Part0 = Tool.Parent.Torso
- rs.Part1 = Tool.Parent['Right Arm']
- end
- if Handle and PlayThrow then
- Handle.Transparency = 0
- PlayThrow.Value = false
- end
- end
- KnifeUp()
- end
- function KnifeUp()
- Tool.GripForward = Vector3.new(0, 0, -1)
- Tool.GripRight = Vector3.new(1, 0, 0)
- Tool.GripUp = Vector3.new(0, 1, 0)
- end
- function KnifeDown()
- Tool.GripForward = Vector3.new(0, 0, -1)
- Tool.GripRight = Vector3.new(1, 0, 0)
- Tool.GripUp = Vector3.new(0, -1, 0)
- end
- function KnifeOut()
- Tool.GripForward = Vector3.new(0, 0, -1)
- Tool.GripRight = Vector3.new(1, 0, 0)
- Tool.GripUp = Vector3.new(0, 1, 0)
- end
- Tool.Enabled = true
- function OnLeftButtonDown()
- LeftButtonDownTime = time()
- end
- function OnLeftButtonUp()
- if not Tool.Enabled then return end
- -- Reset the list of hit players every time we start a new attack
- HitPlayers = {}
- if PlayThrowCharge then
- PlayThrowCharge.Value = false
- end
- if Tool.Enabled and MyHumanoid and MyHumanoid.Health > 0 then
- Tool.Enabled = false
- local currTime = time()
- if LeftButtonDownTime and currTime - LeftButtonDownTime > HOLD_TO_THROW_TIME and
- currTime - LeftButtonDownTime < 1.15 then
- else
- Attacking = true
- if math.random(1, 2) == 1 then
- HardAttack()
- else
- NormalAttack()
- end
- Attacking = false
- end
- Tool.Enabled = true
- end
- end
- function OnRightButtonDown()
- RightButtonDownTime = time()
- if PlayThrowCharge then
- PlayThrowCharge.Value = true
- end
- end
- function OnRightButtonUp()
- if not Tool.Enabled then return end
- -- Reset the list of hit players every time we start a new attack
- HitPlayers = {}
- if PlayThrowCharge then
- PlayThrowCharge.Value = false
- end
- if Tool.Enabled and MyHumanoid and MyHumanoid.Health > 0 then
- Tool.Enabled = false
- local currTime = time()
- if RightButtonDownTime and currTime - RightButtonDownTime > HOLD_TO_THROW_TIME and
- currTime - RightButtonDownTime < 19999.15 then
- ThrowAttack()
- else
- Attacking = true
- if math.random(1, 2) == 1 then
- else
- end
- Attacking = false
- end
- Tool.Enabled = true
- end
- end
- function OnEquipped(mouse)
- PlayStabPunch = WaitForChild(Tool, 'PlayStabPunch')
- PlayDownStab = WaitForChild(Tool, 'PlayDownStab')
- PlayThrow = WaitForChild(Tool, 'PlayThrow')
- PlayThrowCharge = WaitForChild(Tool, 'PlayThrowCharge')
- Handle.Equip:Play()
- BlowConnection = Handle.Touched:connect(Blow)
- MyCharacter = Tool.Parent
- MyTorso = MyCharacter:FindFirstChild('Torso')
- MyHumanoid = MyCharacter:FindFirstChild('Humanoid')
- MyPlayer = PlayersService.LocalPlayer
- if mouse then
- Button1DownConnection = mouse.Button1Down:connect(OnLeftButtonDown)
- Button1UpConnection = mouse.Button1Up:connect(OnLeftButtonUp)
- Button2DownConnection = mouse.Button2Down:connect(OnRightButtonDown)
- Button2UpConnection = mouse.Button2Up:connect(OnRightButtonUp)
- end
- KnifeUp()
- end
- function OnUnequipped()
- -- Unequip logic here
- if BlowConnection then
- BlowConnection:disconnect()
- BlowConnection = nil
- end
- if Button1DownConnection then
- Button1DownConnection:disconnect()
- Button1DownConnection = nil
- end
- if Button1UpConnection then
- Button1UpConnection:disconnect()
- Button1UpConnection = nil
- end
- if Button2UpConnection then
- Button2UpConnection:disconnect()
- Button2UpConnection = nil
- end
- if Button2DownConnection then
- Button2DownConnection:disconnect()
- Button2DownConnection = nil
- end
- MyHumanoid = nil
- end
- Tool.Equipped:connect(OnEquipped)
- Tool.Unequipped:connect(OnUnequipped)
- end))
- Motor6D29.Name = "Right Shoulder"
- Motor6D29.Parent = LocalScript28
- Motor6D29.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D29.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D29.MaxVelocity = 0.10000000149012
- Animation30.Name = "IdleAnim"
- Animation30.Parent = Tool0
- Animation30.AnimationId = "http://www.roblox.com/Asset?ID=105371735"
- LocalScript31.Name = "BackupWeld"
- LocalScript31.Parent = Tool0
- table.insert(cors,sandbox(LocalScript31,function()
- function Weld(x,y)
- local W = Instance.new("Weld")
- W.Part0 = x
- W.Part1 = y
- local CJ = CFrame.new(x.Position)
- local C0 = x.CFrame:inverse()*CJ
- local C1 = y.CFrame:inverse()*CJ
- W.C0 = C0
- W.C1 = C1
- W.Parent = x
- end
- function Get(A)
- if A.className == "Part" then
- Weld(script.Parent.Handle, A)
- A.Anchored = false
- else
- local C = A:GetChildren()
- for i=1, #C do
- Get(C[i])
- end
- end
- end
- function Finale()
- Get(script.Parent)
- end
- script.Parent.Equipped:connect(Finale)
- script.Parent.Unequipped:connect(Finale)
- Finale()
- end))
- LocalScript32.Name = "MostAnimations"
- LocalScript32.Parent = Tool0
- table.insert(cors,sandbox(LocalScript32,function()
- --------------------
- --| WaitForChild |--
- --------------------
- -- Waits for parent.child to exist, then returns it
- local function WaitForChild(parent, childName)
- assert(parent, "ERROR: WaitForChild: parent is nil")
- while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
- return parent[childName]
- end
- -----------------
- --| Variables |--
- -----------------
- local Tool = script.Parent
- local ScytheEquipAnimation = WaitForChild(script, 'ScytheEquip2')
- local ScytheIdleAnimation = WaitForChild(script, 'ScytheIdle2')
- local ScytheSlashAnimation = WaitForChild(script, 'ScytheSlash')
- local ScytheEquipTrack = nil
- local ScytheIdleTrack = nil
- local ScytheSlashTrack = nil
- -----------------
- --| Functions |--
- -----------------
- local function OnEquipped()
- local myModel = Tool.Parent
- local humanoid = myModel:FindFirstChild('Humanoid')
- if humanoid then -- Preload animations
- ScytheEquipTrack = humanoid:LoadAnimation(ScytheEquipAnimation)
- if ScytheEquipTrack then ScytheEquipTrack:Play() end
- ScytheIdleTrack = humanoid:LoadAnimation(ScytheIdleAnimation)
- if ScytheIdleTrack then ScytheIdleTrack:Play() end
- ScytheSlashTrack = humanoid:LoadAnimation(ScytheSlashAnimation)
- end
- end
- local function OnChanged(property)
- if property == 'Enabled' and Tool.Enabled == false then
- if ScytheSlashTrack then ScytheSlashTrack:Play() end
- end
- end
- local function OnUnequipped()
- -- Stop all animations
- if ScytheEquipTrack then ScytheEquipTrack:Stop() end
- if ScytheIdleTrack then ScytheIdleTrack:Stop() end
- if ScytheSlashTrack then ScytheSlashTrack:Stop() end
- end
- --------------------
- --| Script Logic |--
- --------------------
- Tool.Equipped:connect(OnEquipped)
- Tool.Changed:connect(OnChanged)
- Tool.Unequipped:connect(OnUnequipped)
- end))
- Animation33.Name = "ScytheEquip2"
- Animation33.Parent = LocalScript32
- Animation33.AnimationId = "http://www.roblox.com/Asset?ID=96064636"
- Animation34.Name = "ScytheIdle2"
- Animation34.Parent = LocalScript32
- Animation34.AnimationId = "http://www.roblox.com/Asset?ID=96065457"
- Animation35.Name = "ScytheSlash"
- Animation35.Parent = LocalScript32
- Animation35.AnimationId = "http://www.roblox.com/Asset?ID=96071496"
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game:GetService("Players").LocalPlayer.Backpack
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Add Comment
Please, Sign In to add comment