Advertisement
COOLKID1259

Untitled

Apr 21st, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.98 KB | None | 0 0
  1. local plr=game.Players.LocalPlayer
  2. local mouse=plr:GetMouse()
  3. repeat wait() until plr.Character
  4. wait(0.1)
  5. local char=plr.Character
  6. local hum=char:WaitForChild("Humanoid")
  7. local torso=char:WaitForChild("Torso")
  8. local rarm=char:WaitForChild("Right Arm")
  9. local hrp=char:WaitForChild("HumanoidRootPart")
  10. local tool=script.Parent
  11. local ownershipre=workspace.SetOwnership
  12. local target=plr.PlayerGui.Target.TPlayer
  13. local slashanim=hum:LoadAnimation(tool.SlashAnim)
  14. local gstab=hum:LoadAnimation(tool.GroundStab)
  15. local equipped=false
  16. local check=false
  17. local dmgcheck=false
  18. local knife
  19. local eye1
  20. local eye2
  21. local kweld
  22. local closest
  23. local hitpos
  24.  
  25. function Damage(mode,mag,proj)
  26. local dmgcheck2=false
  27. if mode=="Normal" then
  28. for _,v in pairs(game.Players:GetPlayers()) do
  29. if v.Character then
  30. local tchar=v.Character
  31. if (torso.Position-tchar.Torso.Position).magnitude<=mag and tchar.Humanoid.Health>0 and tchar~=char then
  32. tchar.Humanoid:TakeDamage(100)
  33. end
  34. end
  35. end
  36. elseif mode=="Distant" then
  37. proj.Touched:connect(function(hit)
  38. if hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Name~=plr.Name then
  39. if dmgcheck2==false then
  40. dmgcheck2=true
  41. hit.Parent.Humanoid:TakeDamage(50)
  42. end
  43. end
  44. end)
  45. end
  46. end
  47.  
  48. function Loop()
  49. coroutine.resume(coroutine.create(function()
  50. while equipped==true do
  51. if target.Value~="None" then
  52. if game.Players[target.Value].Character then
  53. closest=game.Players[target.Value].Character
  54. end
  55. else
  56. closest=nil
  57. end
  58. wait()
  59. end
  60. end))
  61. end
  62.  
  63. function Slash(mode)
  64. dmgcheck=true
  65. if mode=="Normal" or mode=="Distant" then
  66. slashanim:Play()
  67. local slashsfx=tool.Slash:Clone()
  68. slashsfx.Parent=game.Players.LocalPlayer.Character.Torso
  69. slashsfx:Play()
  70. game.Debris:AddItem(slashsfx,1)
  71. wait(0.4)
  72. knife.PE.Slash.Enabled=true
  73. if mode=="Normal" then
  74. Damage("Normal",6)
  75. end
  76. wait(0.3)
  77. if mode=="Distant" then
  78. local obj=script.DSlash:Clone()
  79. obj.Parent=workspace
  80. obj.Anchored=false
  81. ownershipre:FireServer(plr,obj,"During")
  82. ownershipre:FireServer(plr,obj,"After",2,"Part")
  83. obj.CFrame=hrp.CFrame*CFrame.new(1.5,0.5,2.5)
  84. obj.CFrame=CFrame.new(obj.Position,hitpos)*CFrame.Angles(0,math.pi/2,0)
  85. local bv=Instance.new("BodyVelocity",obj)
  86. bv.MaxForce=Vector3.new(math.huge,math.huge,math.huge)
  87. bv.Velocity=(obj.CFrame*CFrame.Angles(0,-math.pi/2,0)).lookVector*350
  88. Damage("Distant",0,obj)
  89. end
  90. elseif mode=="Area" then
  91. gstab:Play()
  92. wait(0.2)
  93. for i=1,180/18 do
  94. kweld.C0=CFrame.new(0,-1,0)*CFrame.Angles(math.rad(100-(i*20)),-math.pi/2,0)
  95. wait()
  96. end
  97. wait(0.2)
  98. local ef=Instance.new("Part",workspace)
  99. ownershipre:FireServer(plr,ef,"After",8,"Part")
  100. ef.Size=Vector3.new(5,100,100)
  101. ef.Material="Neon"
  102. ef.Transparency=1
  103. ef.BrickColor=BrickColor.new(1,1,0)
  104. ef.CanCollide=false
  105. ef.Anchored=true
  106. ef.CFrame=hrp.CFrame*CFrame.new(0,-5,0)*CFrame.Angles(0,0,math.pi/2)
  107. local efm=Instance.new("SpecialMesh",ef)
  108. efm.MeshType="Cylinder"
  109. for i=1,60 do
  110. ef.Transparency=1-(i/100)
  111. wait()
  112. end
  113. Damage("Normal",100)
  114. coroutine.resume(coroutine.create(function()
  115. wait(0.5)
  116. for i=1,30 do
  117. ef.Transparency=(1-(60/100))+(i/30)
  118. wait()
  119. end
  120. end))
  121. for i=1,50 do
  122. ef.Size=Vector3.new(5+(i*20),55,55)
  123. wait()
  124. end
  125. for i=1,180/18 do
  126. kweld.C0=CFrame.new(0,-1,-1.25)*CFrame.Angles(-math.pi/100,-math.pi/2,0)
  127. wait()
  128. end
  129. end
  130. dmgcheck=false
  131. if knife.PE then
  132. knife.PE.Slash.Enabled=false
  133. end
  134. end
  135.  
  136. mouse.KeyDown:connect(function(key)
  137. if equipped==true and hum.Health>0 then
  138. if closest==nil then
  139. hitpos=mouse.Hit.p
  140. else
  141. hitpos=closest.Torso.Position
  142. end
  143. if key=="e" then
  144. if check==false then
  145. check=true
  146. hum.WalkSpeed=40
  147. Slash("Normal")
  148. hum.WalkSpeed=40
  149. wait(0.01)
  150. check=false
  151. end
  152. elseif key=="r" then
  153. if check==false and (hrp.Position-mouse.Hit.p).magnitude<=150 then
  154. check=true
  155. local currentpos=Vector3.new(hrp.Position.X,hrp.Position.Y,hrp.Position.Z)
  156. local bodyp=Instance.new("BodyPosition",hrp)
  157. bodyp.MaxForce=Vector3.new(math.huge,math.huge,math.huge)
  158. bodyp.D=500
  159. bodyp.Position=mouse.Hit.p+Vector3.new(0,4,0)
  160. local bodygp=Instance.new("BodyGyro",hrp)
  161. bodygp.MaxTorque=Vector3.new(math.huge,math.huge,math.huge)
  162. bodygp.D=160
  163. bodygp.CFrame=CFrame.new(hrp.Position,mouse.Hit.p)
  164. wait(0.01)
  165. Slash("Normal")
  166. bodyp.Position=currentpos
  167. wait(0.01)
  168. bodyp:Destroy()
  169. bodygp:Destroy()
  170. wait(0.01)
  171. check=false
  172. end
  173. elseif key=="t" then
  174. if check==false then
  175. check=true
  176. hum.WalkSpeed=25
  177. Slash("Distant")
  178. hum.WalkSpeed=40
  179. wait(0.01)
  180. check=false
  181. end
  182. elseif key=="f" then
  183. if check==false then
  184. check=true
  185. hum.WalkSpeed=40
  186. Slash("Area")
  187. hum.WalkSpeed=40
  188. wait(1)
  189. check=false
  190. end
  191. end
  192. end
  193. end)
  194.  
  195. tool.Equipped:connect(function()
  196. if dmgcheck==true then repeat wait() until dmgcheck==false end
  197. plr.PlayerGui.Keys.KnifeKeys.Visible=true
  198. equipped=true
  199. knife=tool.KnifeModel:Clone()
  200. knife.Parent=char
  201. knife.Handle.Anchored=false
  202. kweld=Instance.new("Weld",knife.Handle)
  203. kweld.Part0=rarm
  204. kweld.Part1=knife.Handle
  205. kweld.C0=CFrame.new(0,-1,-1.25)*CFrame.Angles(-math.pi/100,-math.pi/2,0)
  206. eye1=script.Eye:Clone()
  207. eye1.Parent=char
  208. eye1.Anchored=false
  209. local eye1f=Instance.new("Weld",eye1)
  210. eye1f.Part0=char.Head
  211. eye1f.Part1=eye1
  212. eye1f.C0=CFrame.new(-0.125,0.22,-0.55)*CFrame.Angles(0,0,math.pi/2)
  213. eye2=script.Eye:Clone()
  214. eye2.Parent=char
  215. eye2.Anchored=false
  216. local eye2f=Instance.new("Weld",eye2)
  217. eye2f.Part0=char.Head
  218. eye2f.Part1=eye2
  219. eye2f.C0=CFrame.new(0.125,0.22,-0.55)*CFrame.Angles(0,0,math.pi/2)
  220. Loop()
  221. end)
  222.  
  223. tool.Unequipped:connect(function()
  224. if dmgcheck==true then repeat wait() until dmgcheck==false end
  225. plr.PlayerGui.Keys.KnifeKeys.Visible=false
  226. equipped=false
  227. knife:Destroy()
  228. eye1:Destroy()
  229. eye2:Destroy()
  230. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement