QendrimGraphics

Moonlight Katana [TEST]

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