Advertisement
CrazIIZen

Katana

Apr 15th, 2016
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.18 KB | None | 0 0
  1.  
  2. Me = game:service("Players").LocalPlayer
  3. Char = Me.Character
  4. Mouse = Me:GetMouse()
  5. Mode={"BloodLust","Normal"}
  6. DTable={}
  7. Combo = 0
  8. Name="WeedFrog's Legendary Katana"
  9. PrimaryColor = "Really black"
  10. SecondaryColor="Lime green"
  11. pcall(function() Char:FindFirstChild("WepModel"):Destroy() Me.Backpack:FindFirstChild(Name):Destroy() end)
  12. Activated = false
  13. Sheathed = true
  14. Dashing = false
  15. Selected = false
  16. ADB=false
  17. DiffColor = false
  18. Camera=game:service("Workspace").CurrentCamera
  19. LeftArm = Char["Left Arm"]
  20. RightArm = Char["Right Arm"]
  21. HRP = Char.HumanoidRootPart["RootJoint"]
  22. SavedRoot = HRP.C0
  23. necko=CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  24. if script.Parent.className ~= "HopperBin" then
  25. h = Instance.new("HopperBin", Me.Backpack)
  26. h.Name = Name
  27. script.Name = "''"
  28. script.Parent = h
  29. end
  30. bin = script.Parent
  31. local WepModel = Instance.new("Model", Char)
  32. WepModel.Name = "WepModel"
  33. local Debz = game:service("Debris")
  34. ------[[ Create Function ]]------
  35. Create = {}
  36. function Create:Part(parent, x,y,z, color, transparency, cancollide, anchored, shape)
  37. c = Instance.new("Part",parent)
  38. c.Material = "SmoothPlastic"
  39. if shape ~= nil then
  40. c.Shape = shape
  41. end
  42. c.TopSurface,c.BottomSurface = 0,0
  43. c.Locked = true
  44. c.formFactor = "Custom"
  45. c.Size = Vector3.new(x,y,z)
  46. if color ~= "random" then
  47. c.BrickColor = color
  48. else c.BrickColor = BrickColor:Random() end
  49. c.Transparency = transparency
  50. c.CanCollide = cancollide
  51. if anchored ~= nil then c.Anchored = anchored end
  52. if parent ~= nil then c.Parent = parent end
  53. return c
  54. end;
  55. function Create:BG(parent)
  56. local c = Instance.new("BodyGyro",parent)
  57. c.P = 20e+003
  58. c.cframe = parent.CFrame
  59. c.maxTorque = Vector3.new(c.P,c.P,c.P)
  60. return c
  61. end;
  62. function Create:BP(parent, pos)
  63. local bp = Instance.new("BodyPosition",parent)
  64. bp.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  65. bp.position = pos
  66. return bp
  67. end;
  68. function Create:F(parent, size, heat, color, secondarycolor, enabled)
  69. f = Instance.new("Fire",parent)
  70. f.Size = size
  71. f.Heat = heat
  72. if enabled ~= nil then f.Enabled = enabled end
  73. if color ~= nil then f.Color = BrickColor.new(color).Color end
  74. if secondarycolor ~= nil then f.SecondaryColor = BrickColor.new(secondarycolor).Color end
  75. return f
  76. end;
  77. function Create:FM(parent, meshid, x,y,z, meshtexture)
  78. if meshid == "cylinder" then
  79. mesh = Instance.new("CylinderMesh",parent)
  80. mesh.Scale = Vector3.new(x,y,z)
  81. return mesh
  82. else
  83. mesh = Instance.new("SpecialMesh",parent)
  84. if meshid ~= "sphere" then
  85. if type(meshid) == "number" then mesh.MeshId = "rbxassetid://"..meshid else
  86. mesh.MeshId = "rbxassetid://"..meshids[meshid]
  87. end
  88. else mesh.MeshType = 3 end
  89. mesh.Scale = Vector3.new(x,y,z)
  90. if meshtexture ~= nil then
  91. if type(meshtexture) == "number" then mesh.TextureId = "rbxassetid://"..meshtexture else
  92. mesh.TextureId = "rbxassetid://"..textureids[meshtexture] end
  93. end
  94. return mesh
  95. end
  96. end
  97. function Create:Weld(parent,P0,P1,nam,c0,c1)
  98. Weld = Instance.new("Weld",parent)
  99. if P0 then Weld.Part0 = P0 else error("Invalid Part0",2) end
  100. if P1 then Weld.Part1 = P1 else print("Invalid Part1") end
  101. if name then Weld.Name = nam else Weld.Name = "Weld" end
  102. if c0 then Weld.C0 = c0 else print("Invalid C0") end
  103. if c1 then Weld.C1 = c1 else Weld.C1 = CFrame.new(0,0.5,0) end
  104. return Weld
  105. end
  106. M = {["Cos"] = function(a) return math.cos(a) end;
  107. ["Sin"] = function(a) return math.sin(a) end;
  108. ["Rad"] = function(a) return math.rad(a) end}
  109. L0L=Create:Part(WepModel,1,1,1,BrickColor.new(PrimaryColor),1,false,false)
  110. L0LWeld=Create:Weld(L0L,Char.Torso,L0L,"L0LWeld",CFrame.new(0,0,0)*CFrame.fromEulerAnglesXYZ(0,math.rad(-90),math.rad(90)),CFrame.new(0,-0.951,0))
  111. coroutine.wrap(function()
  112. for i = 0,1,1/50 do wait()
  113. angle = math.rad(360*i)
  114. end
  115. end)()
  116. local Delete = function(parent,time)
  117. if time then
  118. Debz:AddItem(parent,time)
  119. else
  120. parent:Destroy()
  121. end end
  122. Lite = Instance.new("PointLight")
  123. Lite.Color = Color3.new(0,0,21)
  124. Lite.Range = 10
  125. Lite.Brightness = 10
  126. Lite.Parent = Char.Torso
  127. Handle = Create:Part(WepModel,1,1,1,BrickColor.new(PrimaryColor),0,false,false)
  128. Instance.new("BlockMesh",Handle).Scale = Vector3.new(0.2,1.15,0.275)
  129. HandleWeld=Create:Weld(Handle,Char.Torso,Handle,"HandleWeld",CFrame.new(1.5,1.8,0.65)*CFrame.fromEulerAnglesXYZ(0,0,math.pi/-4.75))
  130. Hitbox = Create:Part(WepModel,1,6,0.5,BrickColor.new(PrimaryColor),1,false,false)
  131. Hitbox.Name = "Hitbox"
  132. Instance.new("BlockMesh", Hitbox)
  133. BoxWeld=Create:Weld(Hitbox,Handle,Hitbox,"Boxweld",CFrame.new(0,-2.5,0),CFrame.new(0,-0.25,0))
  134. Sheath = Create:Part(WepModel,1,1,1,BrickColor.new(PrimaryColor),0,false,false)
  135. Instance.new("BlockMesh",Sheath).Scale = Vector3.new(0.3,3,0.3)
  136. SheathWeld=Create:Weld(Char.Torso,Char.Torso,Sheath,"SheathWeld",CFrame.new(0.25,-0.1,0.65)*CFrame.fromEulerAnglesXYZ(0,0,math.pi/-4.75),CFrame.new(0.2,0.5,0))
  137. for i = 1,6 do
  138. Boxes = Create:Part(WepModel,1,1,1,BrickColor.new(SecondaryColor),0,false,false)
  139. Instance.new("BlockMesh",Boxes).Scale = Vector3.new(0.225,0.2,0.31)
  140. BoxesWeld=Create:Weld(Boxes,Char.Torso,Boxes,"BoxesWeld",CFrame.new(1.95,0,0.65)*CFrame.fromEulerAnglesXYZ(0,0,math.pi/-4.75),CFrame.new(1.55,i*0.5,0))
  141. end
  142. SheathTip = Create:Part(WepModel,1,1,1,BrickColor.new(PrimaryColor),0,false,false)
  143. SheathMesh = Instance.new("SpecialMesh", SheathTip)
  144. SheathMesh.MeshType = "Wedge"
  145. SheathMesh.Scale = Vector3.new(0.3,0.75,0.3)
  146. SheathTipWeld=Create:Weld(Char.Torso,Sheath,SheathTip,"SheathTipWeld",CFrame.new(0.25,-2,0.65)*CFrame.fromEulerAnglesXYZ(0,math.pi/2,3.15),CFrame.new(0.65,0.14,0.25))
  147. print(SheathTip.Position,SheathTip.Transparency)
  148. HandleBase = Create:Part(WepModel,1,1,1,BrickColor.new(PrimaryColor),0,false,false)
  149. Instance.new("BlockMesh",HandleBase).Scale = Vector3.new(0.45,0.25,0.45)
  150. HandleBaseWeld=Create:Weld(HandleBase,Handle,HandleBase,"HandleBaseWeld",CFrame.new(0,-0.175,0))
  151. Blade = Create:Part(WepModel,1,1,1,BrickColor.new(SecondaryColor),0,false,false)
  152. Instance.new("BlockMesh",Blade).Scale = Vector3.new(0.2,3,0.155)
  153. BladeWeld=Create:Weld(Blade,Handle,Blade,"BladeWeld",CFrame.new(0,-1.75,0))
  154. Blade2 = Create:Part(WepModel,1,1,1,BrickColor.new(PrimaryColor),0,false,false)
  155. Instance.new("BlockMesh",Blade2).Scale = Vector3.new(0.1,3,0.156)
  156. Blade2Weld=Create:Weld(Blade2,Handle,Blade2,"Blade2Weld",CFrame.new(0,-1.75,0))
  157. Tip = Create:Part(WepModel,1,1,1,BrickColor.new(SecondaryColor),0,false,false)
  158. TipMesh = Instance.new("SpecialMesh", Tip)
  159. TipMesh.MeshType = "Wedge"
  160. TipMesh.Scale = Vector3.new(0.155,0.5,0.2)
  161. TipWeld=Create:Weld(Tip,Handle,Tip,"TipWeld",CFrame.new(0,-4.5,0)*CFrame.fromEulerAnglesXYZ(0,math.pi/2,3.15),CFrame.new(0.01,0.5,0))
  162. Tip2 = Create:Part(WepModel,1,1,1,BrickColor.new(PrimaryColor),0,false,false)
  163. Tip2Mesh = Instance.new("SpecialMesh", Tip2)
  164. Tip2Mesh.MeshType = "Wedge"
  165. Tip2Mesh.Scale = Vector3.new(0.16,0.3,0.1)
  166. Tip2Weld=Create:Weld(Tip2,Handle,Tip2,"Tip2Weld",CFrame.new(0,-4.4,0)*CFrame.fromEulerAnglesXYZ(0,math.pi/2,3.15),CFrame.new(0.01,0.5,0))
  167. function Dash()
  168. Dashing = true
  169. DBounce=true
  170. playSound(153092348,Hitbox,1,1)
  171. local vel = Instance.new("BodyVelocity", Char.Torso)
  172. vel.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  173. coroutine.resume(coroutine.create(function()
  174. while Dashing == true do wait()
  175. vel.velocity = Char.Head.CFrame.lookVector * 70
  176. Effect(Char.Torso, 1,0.5,1, 0,0,1, 0,0,0,BrickColor.new("Navy blue"),true, 20329976,Char.Torso.CFrame*CFrame.new(0,-2.75,0).p)
  177. end
  178. end))
  179. wait(1)
  180. vel:remove()
  181. Dashing = false
  182. wait(1)
  183. DBounce=false
  184. end
  185. --Sound Func
  186. function playSound(id,parent,volume,pitch)
  187. local sound = Instance.new("Sound",parent or workspace)
  188. sound.SoundId = "http://www.roblox.com/asset?id="..id
  189. sound.Volume = volume or 1
  190. sound.Pitch = pitch or 1
  191. coroutine.wrap(function()
  192. wait()
  193. sound:Play()
  194. wait(10)
  195. sound:Stop()
  196. sound:Destroy()
  197. end)()
  198. return sound
  199. end
  200. --Play Sound
  201. function Shoot()
  202. Activated = true
  203. Charging = true
  204. Idle()
  205. StartTrail(Tip)
  206. for i = 0,1,0.1 do wait()
  207. RW.C0 = CFrame.new(1.5,0.5,0)*CFrame.fromEulerAnglesXYZ(1.5,0,0)
  208. RW.C1 = CFrame.new(0.1,0.4,0)*CFrame.fromEulerAnglesXYZ(0,-i*1.575,i*0.15)
  209. end
  210. coroutine.wrap(function()
  211. while Charging == true do wait()
  212. Effect2(Tip,0.4,0.4,0.4,0,0,0,BrickColor.new(SecondaryColor))
  213. end
  214. end)()
  215. end
  216. function FirstSlash()
  217. playSound(10209645,Hitbox,1,1)
  218. Activated = true
  219. Combo = 1
  220. StartTrail(Tip)
  221. pcall(function() Hitdmg=Hitbox.Touched:connect(function(hit) Damage(hit, math.random(5,10), hit.CFrame.p) end) end)
  222. Walk()
  223. for i = 0,1,0.175 do wait()
  224. LW.C1 = CFrame.new(0,0.5,0)*CFrame.fromEulerAnglesXYZ(0,0,i*0.3)
  225. RW.C1 = CFrame.new(0.1,0.4,0)*CFrame.fromEulerAnglesXYZ(i*2.15,i*-0.75,i*-1.5)
  226. HRP.C0 = SavedRoot*CFrame.fromEulerAnglesXYZ(0,0,i*2)
  227. Char.Torso.Neck.C0=necko*CFrame.fromEulerAnglesXYZ(0,0,-1.45*i)
  228. end
  229. EndTrail()
  230. Hitdmg:disconnect(wait(0.1))
  231. Activated = false
  232. end
  233. function SecondSlash()
  234. playSound(10209645,Hitbox,1,1.2)
  235. Activated = true
  236. Combo = 2
  237. StartTrail(Tip)
  238. pcall(function() Hitdmg=Hitbox.Touched:connect(function(hit) Damage(hit, math.random(5,10), hit.CFrame.p) end) end)
  239. for i = 0,1,0.2 do wait()
  240. RW.C0 = CFrame.new(1.45,0.4,0)*CFrame.fromEulerAnglesXYZ(1.5,0,0)
  241. RW.C1 = CFrame.new(0.1,0.4,0)*CFrame.fromEulerAnglesXYZ(0,-i*1.5,0)
  242. end
  243. for i = 0,1,0.2 do wait()
  244. Char.Torso.Neck.C0=necko*CFrame.fromEulerAnglesXYZ(0,0,0.725*i)
  245. RW.C1 = CFrame.new(0,0.4,0)*CFrame.fromEulerAnglesXYZ(0,-1.5,i*-1.5)
  246. HRP.C0 = HRP.C1*CFrame.fromEulerAnglesXYZ(0,0,i*-0.875)
  247. end
  248. EndTrail()
  249. Hitdmg:disconnect(wait(0.1))
  250. Activated = false
  251. end
  252. function ThirdSlash()
  253. playSound(10209645,Hitbox,1,1.3)
  254. Activated=true
  255. Combo=3
  256. StartTrail(Tip)
  257. for i = 0,1,0.2 do wait()
  258. HRP.C1 = HRP.C1*CFrame.fromEulerAnglesXYZ(0,0,i*-0.25)
  259. RW.C0 = CFrame.new(1.45,0.4,0)*CFrame.fromEulerAnglesXYZ(1.5,0,0)
  260. RW.C1 = CFrame.new(0,i,-0.15)*CFrame.fromEulerAnglesXYZ(i*-1.05,0,i*0.85)
  261. LW.C0 = CFrame.new(-1.45,0.4,0)*CFrame.fromEulerAnglesXYZ(1.5,0,0)
  262. LW.C1 = CFrame.new(0,i,-0.15)*CFrame.fromEulerAnglesXYZ(i*-1.05,0,i*-0.85)
  263. Char.Torso.Neck.C0=necko
  264. HandleWeld.C0 = CFrame.new(0,-1.075,0.6)*CFrame.fromEulerAnglesXYZ(math.rad(45/2),math.rad(90),math.rad(69))
  265. HandleWeld.C1 = CFrame.new(0,0.3,0.25)*CFrame.Angles(math.rad(-40),math.rad(-12),math.rad(-10))
  266. end
  267. pcall(function() Hitdmg=Hitbox.Touched:connect(function(hit) Damage(hit, math.random(5,10), hit.CFrame.p,0)
  268. if hit:IsA("Part") then
  269. local evel = Instance.new("BodyVelocity", hit)
  270. evel.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  271. evel.velocity = Char.Torso.CFrame.lookVector * 100
  272. Delete(evel,0.025)
  273. end end) end)
  274. for i = 0,1,0.2 do wait()
  275. RW.C1 = RW.C1*CFrame.new(0,-0.05,0)*CFrame.fromEulerAnglesXYZ(i*0.75,0,0)
  276. LW.C1 = LW.C1*CFrame.new(0,-0.05,0)*CFrame.fromEulerAnglesXYZ(i*0.75,0,0)
  277. end
  278. Hitdmg:disconnect(wait(0.1))
  279. EndTrail()
  280. Activated=false
  281. end
  282. function BDown()
  283. if Activated then return end
  284. if Combo == 0 then
  285. FirstSlash()
  286. coroutine.wrap(function()
  287. wait(0.2)
  288. if Activated == false then
  289. Combo = 0
  290. end
  291. end)()
  292. elseif Combo == 1 then
  293. SecondSlash()
  294. coroutine.wrap(function()
  295. wait(0.2)
  296. if Activated == false then
  297. Combo = 0
  298. end
  299. end)()
  300. elseif Combo == 2 then
  301. ThirdSlash()
  302. coroutine.wrap(function()
  303. wait(0.2)
  304. if Activated == false then
  305. Combo = 0
  306. end
  307. end)()
  308. end
  309. end
  310. function key(key)
  311. if Activated then return end
  312. if key == "x" and not DBounce then
  313. Dash()
  314. end
  315. end
  316. function Walk()
  317. Camera.CameraSubject=Char.Humanoid
  318. Char.Humanoid.WalkSpeed = 25
  319. RW.C0 = CFrame.new(1.5,0.5,0)*CFrame.fromEulerAnglesXYZ(3.45,0,-0.2)
  320. RW.C1 = CFrame.new(0,0.35,0)*CFrame.fromEulerAnglesXYZ(3.5,0.5,0.9)
  321. LW.C0 = CFrame.new(-1.4,0.45,0)*CFrame.fromEulerAnglesXYZ(0.4,0.25,-0.5)
  322. LW.C1 = CFrame.new(0,0.5,0)
  323. HRP.C0 = SavedRoot*CFrame.fromEulerAnglesXYZ(0,0,-1.5)
  324. HRP.C1=CFrame.new(0,0,0,-1,-0,-0,0,0,1,0,1,0)
  325. Char.Torso.Neck.C0=necko*CFrame.fromEulerAnglesXYZ(0,0,1.5)
  326. HandleWeld.Part0 = RightArm
  327. HandleWeld.C0 = CFrame.new(0,-1.075,0.5)*CFrame.fromEulerAnglesXYZ(math.pi/2,math.pi/2,0)
  328. HandleWeld.C1 = CFrame.new(0,0.5,0)
  329. HandleWeld.Part1 = Handle
  330. end
  331.  
  332. function Idle()
  333. if RW and LW then
  334. RW.Part0 = Char.Torso
  335. RW.C0 = CFrame.new(1.5, 0.5, -0)*CFrame.fromEulerAnglesXYZ(0,0,0.2)
  336. RW.C1 = CFrame.new(0, 0.5, 0)
  337. RW.Part1 = RightArm
  338. LW.Part0 = Char.Torso
  339. LW.C0 = CFrame.new(-1.5, 0.5, 0)*CFrame.fromEulerAnglesXYZ(0,0,-0.2)
  340. LW.C1 = CFrame.new(0, 0.5, 0)
  341. LW.Part1 = LeftArm
  342. Char.Torso.Neck.C0=necko
  343. Camera.CameraSubject=Char.Humanoid
  344. HRP.C0=SavedRoot
  345. HRP.C1=CFrame.new(0,0,0,-1,-0,-0,0,0,1,0,1,0)
  346. Char.Humanoid.WalkSpeed = 18
  347. HandleWeld.Part0 = RightArm
  348. HandleWeld.C0 = CFrame.new(0,-1.075,0.5)*CFrame.fromEulerAnglesXYZ(math.pi/2,math.pi/2,0)
  349. HandleWeld.C1 = CFrame.new(0,0.5,0)
  350. HandleWeld.Part1 = Handle
  351. end
  352. end
  353. function Selection()
  354. for i = 0,1,0.1 do wait()
  355. RW.C0 = CFrame.new(1.5,0.5,0)*CFrame.fromEulerAnglesXYZ(3.45*i,0,i*-0.2)
  356. end
  357. playSound(130785405,Hitbox,1,1)
  358.  
  359. HandleWeld.Part0 = RightArm
  360. HandleWeld.C0 = CFrame.new(0,-1.075,0.5)*CFrame.fromEulerAnglesXYZ(math.pi/2,math.pi/2,0)
  361. HandleWeld.C1 = CFrame.new(0,0.5,0)
  362. HandleWeld.Part1 = Handle
  363. for i = 0,1,0.15 do wait()
  364. RW.C1 = CFrame.new(0,0.35,0)*CFrame.fromEulerAnglesXYZ(i*3.5,i*0.75,i)
  365. LW.C0 = CFrame.new(-1.4,0.45,0)*CFrame.fromEulerAnglesXYZ(i*0.4,i*0.25,i*-0.25)
  366. end
  367. Idle()
  368. Selected = true
  369. Sheathed = false
  370. end
  371. function s(mouse)
  372. if Sheathing then return end
  373. mouse.KeyDown:connect(key)
  374. mouse.Button1Down:connect(function() BDown(mouse) end)
  375. RSH = Char.Torso["Right Shoulder"]
  376. LSH = Char.Torso["Left Shoulder"]
  377. RW=Create:Weld(RightArm,Char.Torso,RightArm,"RW",CFrame.new(1.5, 0.5, -0)*CFrame.fromEulerAnglesXYZ(1.5,1.15,-0.25))
  378. LW=Create:Weld(LeftArm,Char.Torso,LeftArm,"LW",CFrame.new(-1.5, 0.5, 0)*CFrame.fromEulerAnglesXYZ(-0.5,0,-0.1))
  379. Selection()
  380. Idle()
  381. Sheathed = false
  382. end
  383. function ds()
  384. Sheathing = true
  385. RW.C0 = CFrame.new(1.5, 0.5, -0)
  386. RW.C1 = CFrame.new(0, 0.5, 0)
  387. for i =0,1,0.1 do wait()
  388. RW.C0 = CFrame.new(1.5,0.5,0)*CFrame.fromEulerAnglesXYZ(3.45*i,0,i*-0.2)
  389. end
  390. playSound(130785407,Hitbox,1,1)
  391. HandleWeld.Part0 = Char.Torso
  392. HandleWeld.C0 = CFrame.new(1.5,1.8,0.65)*CFrame.fromEulerAnglesXYZ(0,0,math.pi/-4.75)
  393. HandleWeld.C1 = CFrame.new(0,0.5,0)
  394. HandleWeld.Part1 = Handle
  395. pcall(function() HRP.C0 = SavedRoot
  396. RW.Parent = nil
  397. LW.Parent = nil
  398. Char.Torso.Neck.C0 = necko
  399. RSH.Parent = Char.Torso
  400. LSH.Parent = Char.Torso end)
  401. Sheathing = false
  402. Sheathed = true
  403. Char.Humanoid.WalkSpeed = 18
  404. end
  405. bin.Selected:connect(s)
  406. bin.Deselected:connect(ds)
  407. function StartTrail(part,color)
  408. trailin = true
  409. local lastPoint = part.Position
  410. coroutine.wrap(function()
  411. while trailin do wait()
  412. local point = CFrame.new(lastPoint, part.Position) * CFrame.Angles(-math.pi/2, 0, 0)
  413. local mag = (lastPoint - part.Position).magnitude
  414. local p = Create:Part(Char,1,1,1,BrickColor.new(PrimaryColor),0.1,false,true)
  415. if color then p.BrickColor = BrickColor.new(color) end
  416. Instance.new("SpecialMesh",p).Scale=Vector3.new(0.125, mag, 0.125)
  417. p.CFrame = point * CFrame.new(0, mag/1.95, 0)
  418. lastPoint = part.Position
  419. coroutine.wrap(function() for i = 0,1,0.1 do wait() p.Transparency = i end p:Destroy() end)()
  420. end
  421. end)()
  422. end
  423. function EndTrail()
  424. trailin = false
  425. end
  426. Damage = function(hit, dmg, pos,time)
  427. if ADB == false then
  428. ADB = true
  429. coroutine.wrap(function()
  430. if time ==nil then
  431. ADB=false
  432. else
  433. wait(time)
  434. end
  435. ADB = false
  436. end)()
  437. if hit.Parent==nil and hit.Parent.Torso == nil then
  438. return
  439. print("hai")
  440. end
  441. if hit~=nil and hit.Parent ~= Char then
  442. hum = hit.Parent:FindFirstChild("Humanoid")
  443. if hum and hum.Health ~= 0 then
  444. playSound(153092292,Hitbox,1,1)
  445. critcalchance = math.ceil(math.random(1,15))
  446. if critcalchance == 5 then
  447. pcall(function() hum.Health = hum.Health - dmg*2 end)
  448. if hum.Health == 0 then
  449. KO=true
  450. else
  451. KO=false
  452. end
  453. crit = true
  454. else
  455. pcall(function() hum.Health = hum.Health - dmg end)
  456. if hum.Health == 0 then
  457. KO=true
  458. else
  459. KO=false
  460. end
  461. crit = false
  462. end
  463. mod = Instance.new("Model",game:service("Workspace"))
  464. if not KO then
  465. if crit == true then
  466. mod.Name = "-"..(dmg*2)
  467. else
  468. mod.Name = "-"..dmg
  469. end
  470. else
  471. mod.Name = "KO!"
  472. crit=true
  473. end
  474. if not crit then
  475. p = Create:Part(mod,0.25,0.15,0.25, BrickColor.new(SecondaryColor),0.25,false,false)
  476. else
  477. p = Create:Part(mod,0.35,0.25,0.35, BrickColor.new("Really red"),0.25,false,false)
  478. end
  479. p.CFrame = CFrame.new(pos)*CFrame.new(0,1,math.random(-2,2))
  480. BP = Create:BP(p,p.Position+Vector3.new(0,6,0))
  481. BP.P = 1500
  482. s = Instance.new("SelectionBox",p)
  483. s.Adornee = s.Parent
  484. s.Transparency=p.Transparency
  485. s.Color = p.BrickColor
  486. local BGUI = Instance.new("BillboardGui",p)
  487. BGUI.Size = UDim2.new(1,0,1,0)
  488. BGUI.StudsOffset = Vector3.new(0,1,0)
  489. BGUI.Adornee = BGUI.Parent
  490. local frame = Instance.new("Frame",BGUI)
  491. frame.Size = UDim2.new(1, 0, 1, 0)
  492. frame.BackgroundTransparency = 1
  493. frame.BackgroundColor3 = Color3.new(1, 1, 1)
  494. local BText = Instance.new("TextLabel",BGUI)
  495. BText.TextStrokeTransparency = 0
  496. BText.TextStrokeColor3 = BrickColor.new(PrimaryColor).Color
  497. BText.BackgroundTransparency = 1
  498. BText.Position = UDim2.new(0, 0, 0.1, 0)
  499. BText.FontSize = "Size18"
  500. BText.Size = UDim2.new(0.9, 0, 0.4, 0)
  501. if not crit and not KO then
  502. BText.Font = "SourceSans"
  503. BText.TextColor3 = BrickColor.new(SecondaryColor).Color
  504. elseif crit and not KO then
  505. BText.FontSize = "Size24"
  506. BText.Font = "SourceSans"
  507. BText.TextColor3 = BrickColor.new("Really red").Color
  508. elseif KO and crit then
  509. BText.FontSize = "Size36"
  510. BText.Font = "Legacy"
  511. BText.TextColor3 = BrickColor.new("Really red").Color
  512. end
  513. BText.Font = "SourceSans"
  514. BText.Text = mod.Name
  515. Delete(mod,2.5)
  516. coroutine.wrap(function()
  517. wait(0.5)
  518. for i = 0,1,0.035 do wait()
  519. BText.TextTransparency = i
  520. BText.TextStrokeTransparency = BText.TextStrokeTransparency + i
  521. end
  522. end)()
  523. end
  524. end
  525. end
  526. end
  527. function Effect(part,x1,y1,z1,x2,y2,z2,x3,y3,z3,color,meshid,id,pos,collid)
  528. S=Create:Part(Char, 1,1,1, color, 0, false, true)
  529. if collid then
  530. S.CanCollide=collid
  531. else
  532. S.CanCollide=false
  533. end
  534. S.CFrame = CFrame.new(pos)
  535. S.CFrame=S.CFrame*CFrame.new(x2,y2,z2)*CFrame.fromEulerAnglesXYZ(x3,y3,z3)
  536. if meshid == true then
  537. local msh1 = Instance.new("SpecialMesh",S)
  538. msh1.Scale = Vector3.new(1,1,1)
  539. msh1.MeshType = "FileMesh"
  540. msh1.MeshId = "http://www.roblox.com/asset/?id="..id..""
  541. end
  542. if meshid == "block" then
  543. msh1 = Instance.new("BlockMesh",S)
  544. msh1.Scale = Vector3.new(1,1,1)
  545. elseif meshid == "ball" then
  546. local msh1 = Instance.new("SpecialMesh",S)
  547. msh1.Scale = Vector3.new(1,1,1)
  548. msh1.MeshType = "Sphere"
  549. end
  550. coroutine.resume(coroutine.create(function(Part,CF) for i=1, 9 do Part.Mesh.Scale = Part.Mesh.Scale + Vector3.new(x1, y1, z1) Part.Transparency=i*.1 wait() end Part:Destroy() end),S,S.CFrame)
  551. end
  552. Lightning = function(Start,End,Times,Offset,Color,Thickness,Transparency)
  553. local magz = (Start - End).magnitude local curpos = Start local trz = {-Offset,Offset}
  554. for i=1,Times do
  555. local li = Instance.new("Part",workspace)
  556. li.Material = "SmoothPlastic"
  557. li.TopSurface = "SmoothNoOutlines"
  558. li.BottomSurface = "SmoothNoOutlines"
  559. li.RightSurface = "SmoothNoOutlines"
  560. li.LeftSurface = "SmoothNoOutlines"
  561. li.Anchored = true li.Transparency =
  562. Transparency or 0.4 li.BrickColor =
  563. BrickColor.new(Color)
  564. li.formFactor = "Custom"
  565. li.CanCollide = false
  566. li.Size = Vector3.new(1,1,1)
  567. lim = Instance.new("BlockMesh",li)
  568. lim.Scale = Vector3.new(Thickness,Thickness,magz/Times)
  569. local ofz = Vector3.new(trz[math.random(1,2)],trz[math.random(1,2)],trz[math.random(1,2)])
  570. function touch(hit)
  571. if hit.Parent:findFirstChild("Humanoid") ~= nil and hit.Parent ~= Char then
  572. Damage(hit, math.random(5,10), hit.CFrame.p)
  573. end end li.Touched:connect(touch)
  574. local trolpos = CFrame.new(curpos,End)*CFrame.new(0,0,magz/Times).p+ofz
  575. if Times == i then
  576. local magz2 = (curpos - End).magnitude lim.Scale = Vector3.new(Thickness,Thickness,magz2)
  577. li.CFrame = CFrame.new(curpos,End)*CFrame.new(0,0,-magz2/2)
  578. else
  579. li.CFrame = CFrame.new(curpos,trolpos)*CFrame.new(0,0,magz/Times/2)
  580. end
  581. curpos = li.CFrame*CFrame.new(0,0,magz/Times/2).p game.Debris:AddItem(li,0.25)
  582. end
  583. end
  584. function Effect2(part,x1,y1,z1,x2,y2,z2,color)
  585. local msh2 = Instance.new("BlockMesh")
  586. msh2.Scale = Vector3.new(x1, y1, z1)
  587. S=Create:Part(Char, 1,1,1, color, 0.5, false, true)
  588. msh2.Parent = S
  589. S.CFrame=part.CFrame*CFrame.new(x2, y2, z2)*CFrame.fromEulerAnglesXYZ(math.random(-50,50),math.random(-50,50),math.random(-50,50))
  590. coroutine.resume(coroutine.create(function(Part,CF) for i=1, 9 do Part.Mesh.Scale = Part.Mesh.Scale + Vector3.new(0.1,0.1,0.1) Part.CFrame=Part.CFrame*CFrame.fromEulerAnglesXYZ(math.random(-50,50),math.random(-50,50),math.random(-50,50)) Part.Transparency=i*.1 wait() end Part.Parent=nil end),S,S.CFrame)
  591. end
  592. coroutine.wrap(function()
  593. game:service("RunService").RenderStepped:connect(function()
  594. if not Sheathed and not Activated and not Sheathing and Combo == 0 then
  595. if Vector3.new(Char.Torso.Velocity.x, 0, Char.Torso.Velocity.z).magnitude > 2 then
  596. Walk()
  597. else
  598. Idle()
  599. end
  600. end
  601. end)
  602. end)()
  603. pcall(function() script.source.Value = "l0l" end)
  604. while true do game:GetService("RunService").RenderStepped:wait(-9001)
  605. if not Sheathed then
  606. wait(math.random(-1,2))
  607. lightswitch = math.random(1,2)
  608. if lightswitch == 1 then
  609. Lightning(HandleBase.CFrame*CFrame.new(0,1,0).p,Tip.CFrame.p,math.random(3,6),math.random(-0.75,0.75),"Navy blue",0.04,0.2)
  610. elseif lightswitch == 2 then
  611. Lightning(HandleBase.CFrame*CFrame.new(0,1,0).p,Tip.CFrame.p,math.random(3,6),math.random(-0.75,0.75),PrimaryColor,0.04,0.2)
  612. end
  613. end
  614. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement