Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr=game.Players.LocalPlayer
- local mouse=plr:GetMouse()
- repeat wait() until plr.Character
- wait(0.1)
- local char=plr.Character
- local hum=char:WaitForChild("Humanoid")
- local torso=char:WaitForChild("Torso")
- local rarm=char:WaitForChild("Right Arm")
- local hrp=char:WaitForChild("HumanoidRootPart")
- local tool=script.Parent
- local ownershipre=workspace.SetOwnership
- local target=plr.PlayerGui.Target.TPlayer
- local slashanim=hum:LoadAnimation(tool.SlashAnim)
- local gstab=hum:LoadAnimation(tool.GroundStab)
- local equipped=false
- local check=false
- local dmgcheck=false
- local knife
- local eye1
- local eye2
- local kweld
- local closest
- local hitpos
- function Damage(mode,mag,proj)
- local dmgcheck2=false
- if mode=="Normal" then
- for _,v in pairs(game.Players:GetPlayers()) do
- if v.Character then
- local tchar=v.Character
- if (torso.Position-tchar.Torso.Position).magnitude<=mag and tchar.Humanoid.Health>0 and tchar~=char then
- tchar.Humanoid:TakeDamage(100)
- end
- end
- end
- elseif mode=="Distant" then
- proj.Touched:connect(function(hit)
- if hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Name~=plr.Name then
- if dmgcheck2==false then
- dmgcheck2=true
- hit.Parent.Humanoid:TakeDamage(50)
- end
- end
- end)
- end
- end
- function Loop()
- coroutine.resume(coroutine.create(function()
- while equipped==true do
- if target.Value~="None" then
- if game.Players[target.Value].Character then
- closest=game.Players[target.Value].Character
- end
- else
- closest=nil
- end
- wait()
- end
- end))
- end
- function Slash(mode)
- dmgcheck=true
- if mode=="Normal" or mode=="Distant" then
- slashanim:Play()
- local slashsfx=tool.Slash:Clone()
- slashsfx.Parent=game.Players.LocalPlayer.Character.Torso
- slashsfx:Play()
- game.Debris:AddItem(slashsfx,1)
- wait(0.4)
- knife.PE.Slash.Enabled=true
- if mode=="Normal" then
- Damage("Normal",6)
- end
- wait(0.3)
- if mode=="Distant" then
- local obj=script.DSlash:Clone()
- obj.Parent=workspace
- obj.Anchored=false
- ownershipre:FireServer(plr,obj,"During")
- ownershipre:FireServer(plr,obj,"After",2,"Part")
- obj.CFrame=hrp.CFrame*CFrame.new(1.5,0.5,2.5)
- obj.CFrame=CFrame.new(obj.Position,hitpos)*CFrame.Angles(0,math.pi/2,0)
- local bv=Instance.new("BodyVelocity",obj)
- bv.MaxForce=Vector3.new(math.huge,math.huge,math.huge)
- bv.Velocity=(obj.CFrame*CFrame.Angles(0,-math.pi/2,0)).lookVector*350
- Damage("Distant",0,obj)
- end
- elseif mode=="Area" then
- gstab:Play()
- wait(0.2)
- for i=1,180/18 do
- kweld.C0=CFrame.new(0,-1,0)*CFrame.Angles(math.rad(100-(i*20)),-math.pi/2,0)
- wait()
- end
- wait(0.2)
- local ef=Instance.new("Part",workspace)
- ownershipre:FireServer(plr,ef,"After",8,"Part")
- ef.Size=Vector3.new(5,100,100)
- ef.Material="Neon"
- ef.Transparency=1
- ef.BrickColor=BrickColor.new(1,1,0)
- ef.CanCollide=false
- ef.Anchored=true
- ef.CFrame=hrp.CFrame*CFrame.new(0,-5,0)*CFrame.Angles(0,0,math.pi/2)
- local efm=Instance.new("SpecialMesh",ef)
- efm.MeshType="Cylinder"
- for i=1,60 do
- ef.Transparency=1-(i/100)
- wait()
- end
- Damage("Normal",100)
- coroutine.resume(coroutine.create(function()
- wait(0.5)
- for i=1,30 do
- ef.Transparency=(1-(60/100))+(i/30)
- wait()
- end
- end))
- for i=1,50 do
- ef.Size=Vector3.new(5+(i*20),55,55)
- wait()
- end
- for i=1,180/18 do
- kweld.C0=CFrame.new(0,-1,-1.25)*CFrame.Angles(-math.pi/100,-math.pi/2,0)
- wait()
- end
- end
- dmgcheck=false
- if knife.PE then
- knife.PE.Slash.Enabled=false
- end
- end
- mouse.KeyDown:connect(function(key)
- if equipped==true and hum.Health>0 then
- if closest==nil then
- hitpos=mouse.Hit.p
- else
- hitpos=closest.Torso.Position
- end
- if key=="e" then
- if check==false then
- check=true
- hum.WalkSpeed=40
- Slash("Normal")
- hum.WalkSpeed=40
- wait(0.01)
- check=false
- end
- elseif key=="r" then
- if check==false and (hrp.Position-mouse.Hit.p).magnitude<=150 then
- check=true
- local currentpos=Vector3.new(hrp.Position.X,hrp.Position.Y,hrp.Position.Z)
- local bodyp=Instance.new("BodyPosition",hrp)
- bodyp.MaxForce=Vector3.new(math.huge,math.huge,math.huge)
- bodyp.D=500
- bodyp.Position=mouse.Hit.p+Vector3.new(0,4,0)
- local bodygp=Instance.new("BodyGyro",hrp)
- bodygp.MaxTorque=Vector3.new(math.huge,math.huge,math.huge)
- bodygp.D=160
- bodygp.CFrame=CFrame.new(hrp.Position,mouse.Hit.p)
- wait(0.01)
- Slash("Normal")
- bodyp.Position=currentpos
- wait(0.01)
- bodyp:Destroy()
- bodygp:Destroy()
- wait(0.01)
- check=false
- end
- elseif key=="t" then
- if check==false then
- check=true
- hum.WalkSpeed=25
- Slash("Distant")
- hum.WalkSpeed=40
- wait(0.01)
- check=false
- end
- elseif key=="f" then
- if check==false then
- check=true
- hum.WalkSpeed=40
- Slash("Area")
- hum.WalkSpeed=40
- wait(1)
- check=false
- end
- end
- end
- end)
- tool.Equipped:connect(function()
- if dmgcheck==true then repeat wait() until dmgcheck==false end
- plr.PlayerGui.Keys.KnifeKeys.Visible=true
- equipped=true
- knife=tool.KnifeModel:Clone()
- knife.Parent=char
- knife.Handle.Anchored=false
- kweld=Instance.new("Weld",knife.Handle)
- kweld.Part0=rarm
- kweld.Part1=knife.Handle
- kweld.C0=CFrame.new(0,-1,-1.25)*CFrame.Angles(-math.pi/100,-math.pi/2,0)
- eye1=script.Eye:Clone()
- eye1.Parent=char
- eye1.Anchored=false
- local eye1f=Instance.new("Weld",eye1)
- eye1f.Part0=char.Head
- eye1f.Part1=eye1
- eye1f.C0=CFrame.new(-0.125,0.22,-0.55)*CFrame.Angles(0,0,math.pi/2)
- eye2=script.Eye:Clone()
- eye2.Parent=char
- eye2.Anchored=false
- local eye2f=Instance.new("Weld",eye2)
- eye2f.Part0=char.Head
- eye2f.Part1=eye2
- eye2f.C0=CFrame.new(0.125,0.22,-0.55)*CFrame.Angles(0,0,math.pi/2)
- Loop()
- end)
- tool.Unequipped:connect(function()
- if dmgcheck==true then repeat wait() until dmgcheck==false end
- plr.PlayerGui.Keys.KnifeKeys.Visible=false
- equipped=false
- knife:Destroy()
- eye1:Destroy()
- eye2:Destroy()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement