Advertisement
Dark_EccentricYT

Untitled

May 30th, 2018
1,027
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.71 KB | None | 0 0
  1. --holy sword
  2. local lp = game.Players.LocalPlayer
  3. local chr = lp.Character
  4. local lp = game.Players.LocalPlayer
  5. local chr = lp.Character
  6. local mouse = lp:GetMouse()
  7. local soulsteal = false
  8. local percent = 0
  9. local plr=game.Players.LocalPlayer
  10. local chr=plr.Character
  11. local asin = math.asin
  12. local atan2 = math.atan2
  13. local rad = math.rad
  14. local sin = math.sin
  15. local abs = math.abs
  16. local ceil = math.ceil
  17. local dmg = 3
  18.  
  19. local function getAngles(cf)
  20. local sx,sy,sz,m00,m01,m02,m10,m11,m12,m20,m21,m22 = cf:components()
  21. return atan2(-m12,m22),asin(m02),atan2(-m01,m00)
  22. end
  23. Lerp = {
  24. Number = function(C1,C2,inc)
  25. return C1 + (C2 - C1) * inc
  26. end;
  27. CFrame = function(a,b,m)
  28. local c,d={a:components()},{b:components()}
  29. table.foreach(c,function(a,b)c[a]=c[a]+(d[a]-c[a])*m end)
  30. return CFrame.new(unpack(c))
  31. end;
  32. }
  33. local function genWeld(a,b)
  34. local w = Instance.new("Weld",a)
  35. w.Part0 = a
  36. w.Part1 = b
  37. return w
  38. end
  39.  
  40. anglespeed = 1
  41. yeet = 0
  42. count = 0
  43. angle = 0
  44. local attacking = false
  45. speed = 1
  46. local plr=game.Players.LocalPlayer
  47. local chr=plr.Character
  48. local torso=chr.Torso
  49. local mouse=plr:GetMouse()
  50. local Neck = genWeld(chr.Torso,chr.Head)
  51. Neck.C0 = CFrame.new(0,1,0)
  52. Neck.C1 = CFrame.new(0,-0.5,0)
  53. local LeftShoulder = genWeld(chr.Torso,chr['Left Arm'])
  54. LeftShoulder.C0 = CFrame.new(-1,0.5,0)
  55. LeftShoulder.C1 = CFrame.new(0.5,0.5,0)
  56. RightShoulder = genWeld(chr.Torso,chr['Right Arm'])
  57. RightShoulder.C0 = CFrame.new(1,0.5,0)
  58. RightShoulder.C1 = CFrame.new(-0.5,0.5,0)
  59. local LeftHip = genWeld(chr.Torso,chr['Left Leg'])
  60. LeftHip.C0 = CFrame.new(-1,-1,0)
  61. LeftHip.C1 = CFrame.new(-0.5,1,0)
  62. local RightHip = genWeld(chr.Torso,chr['Right Leg'])
  63. RightHip.C0 = CFrame.new(1,-1,0)
  64. RightHip.C1 = CFrame.new(0.5,1,0)
  65. local RootJoint = genWeld(chr.HumanoidRootPart,chr.Torso)
  66. RootJoint.C0 = CFrame.new(0,0,0) * CFrame.Angles(-math.pi/2,0,math.pi)
  67. RootJoint.C1 = CFrame.new(0,0,0) * CFrame.Angles(-math.pi/2,0,math.pi)
  68. local function newLerpTo(weld)
  69. return {
  70. Weld = weld; -- The weld that will lerp
  71. To = weld.C0; -- Where it will lerp to; a CFrame
  72. Cache = weld.C0; -- Cache of original position; it helps when making anim keyframes
  73. Speed = 0.1; -- Speed of lerp. 0.1 or 0.2 is best
  74. }
  75. end
  76. Lightning = function(Start,End,Times,Offset,Color,Thickness,Transparency)
  77. local magz = (Start - End).magnitude local curpos = Start local trz = {-Offset,Offset}
  78. for i=1,Times do
  79. local li = Instance.new("Part",workspace) li.TopSurface =0 li.BottomSurface = 0 li.Anchored = true li.Transparency = Transparency or 0.4 li.BrickColor = BrickColor.new(Color)
  80. li.formFactor = "Custom" li.CanCollide = false li.Size = Vector3.new(Thickness,Thickness,magz/Times) local ofz = Vector3.new(trz[math.random(1,2)],trz[math.random(1,2)],trz[math.random(1,2)])
  81. local trolpos = CFrame.new(curpos,End)*CFrame.new(0,0,magz/Times).p+ofz
  82. if Times == i then
  83. local magz2 = (curpos - End).magnitude li.Size = Vector3.new(Thickness,Thickness,magz2)
  84. li.CFrame = CFrame.new(curpos,End)*CFrame.new(0,0,-magz2/2)
  85. else
  86. li.CFrame = CFrame.new(curpos,trolpos)*CFrame.new(0,0,magz/Times/2)
  87. end
  88. curpos = li.CFrame*CFrame.new(0,0,magz/Times/2).p game.Debris:AddItem(li,0.25)
  89. end
  90. end
  91. local it = Instance.new
  92. local bc = BrickColor.new
  93. local c3 = Color3.new
  94. local cf = CFrame.new
  95. local ca = CFrame.Angles
  96. local rad = math.rad
  97. local cos = math.cos
  98. local weld = function(p0,p1,x,y,z,ax,ay,az)
  99. p0.Position=p1.Position
  100. local w = it("Motor",p0)
  101. w.Part0=p0
  102. w.Part1=p1
  103. w.C0=cf(x,y,z)*ca(ax,ay,az)
  104. return w
  105. end
  106. for i,v in pairs(chr:GetChildren()) do
  107. if v:IsA("Hat") or v:IsA("ShirtGraphic") or v:IsA("Pants") or v:IsA("Shirt") then
  108. v:Destroy()
  109. end
  110. end
  111. local shirt = it("Shirt",chr)
  112. shirt.ShirtTemplate="http://www.roblox.com/asset/?id=72663531"
  113. local pants = it("Pants",chr)
  114. pants.PantsTemplate="http://www.roblox.com/asset/?id=72664330"
  115. if chr.Torso:FindFirstChild("roblox") then
  116. chr.Torso.roblox:Destroy()
  117. end
  118. for i,v in pairs(chr:GetChildren()) do
  119. if v.Name == "BodyColors" then
  120. v.HeadColor=BrickColor.new("Pastel brown")
  121. else
  122. Instance.new("BodyColors",chr).HeadColor=BrickColor.new("Pastel brown")
  123. end
  124. end
  125. local m = it("Model",chr)
  126. m.Name="MYSTOGAN"
  127. local hat = it("Part",m)
  128. hat.CanCollide=false
  129. hat.FormFactor="Custom"
  130. hat.TopSurface='Smooth'
  131. hat.BottomSurface='Smooth'
  132. hat.Size=Vector3.new(1.5,1.5,1.5)
  133. weld(hat,chr.Head,0,-.3,-.25,0,0,0)
  134. local hatm = it("SpecialMesh",hat)
  135. hatm.MeshId="http://www.roblox.com/asset/?id=62246019"
  136. hatm.TextureId="http://www.roblox.com/asset/?id=65303611"
  137. local bagp1 = it("Part",m)
  138. bagp1.CanCollide=false
  139. bagp1.FormFactor='Custom'
  140. bagp1.TopSurface='Smooth'
  141. bagp1.BottomSurface='Smooth'
  142. bagp1.BrickColor=bc("Pastel brown")
  143. bagp1.Size=Vector3.new(2,2,2)
  144. local p1m = it("CylinderMesh",bagp1)
  145. weld(bagp1,chr['Torso'],0,0,-1.5,0,0,0)
  146. local staff1 = it("Part",m)
  147. staff1.FormFactor='Custom'
  148. staff1.TopSurface='Smooth'
  149. staff1.BottomSurface='Smooth'
  150. staff1.CanCollide=false
  151. staff1.Size=Vector3.new(1, 5.6, 1)
  152. staff1m = it("SpecialMesh",staff1)
  153. staff1m.MeshId="http://www.roblox.com/asset/?id=11383425"
  154. staff1m.TextureId="http://www.roblox.com/asset/?id=11383671"
  155. local staff1w = weld(staff1,bagp1,0,-1.25,0,0,0,0)
  156. local staff2 = it("Part",m)
  157. staff2.FormFactor='Custom'
  158. staff2.TopSurface='Smooth'
  159. staff2.BottomSurface='Smooth'
  160. staff2.CanCollide=false
  161. staff2.Size=Vector3.new(1, 5.6, 1)
  162. staff2m = it("SpecialMesh",staff2)
  163. staff2m.MeshId="http://www.roblox.com/asset/?id=11383425"
  164. staff2m.TextureId="http://www.roblox.com/asset/?id=11383671"
  165. local staff2w = weld(staff2,bagp1,0,-1.25,0,0,0,0)
  166. local staff3 = it("Part",m)
  167. staff3.FormFactor='Custom'
  168. staff3.TopSurface='Smooth'
  169. staff3.BottomSurface='Smooth'
  170. staff3.CanCollide=false
  171. staff3.Size=Vector3.new(1, 5.6, 1)
  172. staff3m = it("SpecialMesh",staff3)
  173. staff3m.MeshId="http://www.roblox.com/asset/?id=11383425"
  174. staff3m.TextureId="http://www.roblox.com/asset/?id=11383671"
  175. local staff3w = weld(staff3,bagp1,0,-1.25,0,0,0,0)
  176. local staff4 = it("Part",m)
  177. staff4.FormFactor='Custom'
  178. staff4.TopSurface='Smooth'
  179. staff4.BottomSurface='Smooth'
  180. staff4.CanCollide=false
  181. staff4.Size=Vector3.new(1, 5.6, 1)
  182. staff4m = it("SpecialMesh",staff4)
  183. staff4m.MeshId="http://www.roblox.com/asset/?id=11383425"
  184. staff4m.TextureId="http://www.roblox.com/asset/?id=11383671"
  185. local staff4w = weld(staff4,bagp1,0,-1.25,0,0,0,0)
  186. LerpTo = {
  187. Neck = newLerpTo(Neck);
  188. LeftArm = newLerpTo(LeftShoulder);
  189. RightArm = newLerpTo(RightShoulder);
  190. LeftLeg = newLerpTo(LeftHip);
  191. RightLeg = newLerpTo(RightHip);
  192. RootJoint = newLerpTo(RootJoint);
  193. Staff1 = newLerpTo(staff1w);
  194. Staff2 = newLerpTo(staff2w);
  195. Staff3 = newLerpTo(staff3w);
  196. Staff4 = newLerpTo(staff4w);
  197. }
  198. LerpTo.Staff1.To=LerpTo.Staff1.Cache*CFrame.Angles(-rad(25),0,rad(25))
  199. LerpTo.Staff2.To=LerpTo.Staff2.Cache*CFrame.Angles(-rad(25),0,-rad(25))
  200. LerpTo.Staff3.To=LerpTo.Staff3.Cache*CFrame.Angles(rad(25),0,-rad(25))
  201. LerpTo.Staff4.To=LerpTo.Staff4.Cache*CFrame.Angles(rad(25),0,rad(25))
  202.  
  203. local effects = Instance.new("Model",chr)--so we can get rid of effects easily, with for i,v
  204. local sound = function(id,looped,parent,pitch)--for effects and stuff :)
  205. local s = Instance.new("Sound",parent)
  206. s.Volume=math.huge
  207. s.Looped=looped
  208. if pitch ~= nil then
  209. s.Pitch=pitch
  210. end
  211. s.SoundId="rbxassetid://"..id
  212. s:Play()
  213. return s
  214. end
  215. local anim = true
  216. local equipped = false
  217. local bin = Instance.new("HopperBin",game.Players.LocalPlayer.Backpack)
  218. bin.Name="Mystogan"
  219. bin.Selected:connect(function()
  220. equipped = true
  221. sound("195464092",true,chr)
  222. LerpTo.Staff4.To=LerpTo.Staff4.Cache*CFrame.Angles(rad(90),rad(45),0)*CFrame.new(-5,0,7)*CFrame.Angles(-rad(25),0,0)
  223. LerpTo.Staff3.To=LerpTo.Staff3.Cache*CFrame.Angles(rad(90),-rad(45),0)*CFrame.new(5,0,7)*CFrame.Angles(-rad(25),0,0)
  224. LerpTo.Staff2.To=LerpTo.Staff2.Cache*CFrame.Angles(-rad(90),rad(45),0)*CFrame.new(5,0,-7)*CFrame.Angles(rad(25),0,0)
  225. LerpTo.Staff1.To=LerpTo.Staff1.Cache*CFrame.Angles(-rad(90),-rad(45),0)*CFrame.new(-5,0,-7)*CFrame.Angles(rad(25),0,0)
  226. end)
  227. bin.Deselected:connect(function()
  228. equipped = false
  229. for i,v in pairs(chr:GetChildren()) do
  230. if v:IsA("Sound") then
  231. v:Stop()
  232. v:Pause()
  233. v:Destroy()
  234. end
  235. end
  236. LerpTo.Staff1.To=LerpTo.Staff1.Cache*CFrame.Angles(-rad(25),0,rad(25))
  237. LerpTo.Staff2.To=LerpTo.Staff2.Cache*CFrame.Angles(-rad(25),0,-rad(25))
  238. LerpTo.Staff3.To=LerpTo.Staff3.Cache*CFrame.Angles(rad(25),0,-rad(25))
  239. LerpTo.Staff4.To=LerpTo.Staff4.Cache*CFrame.Angles(rad(25),0,rad(25))
  240. end)
  241. local function updateanims()
  242. if anim==true and equipped == false then
  243. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude < 2 then
  244. anglespeed = 1
  245. LerpTo.Neck.To = LerpTo.Neck.Cache * CFrame.Angles(0,0,0)
  246. LerpTo.RootJoint.To=LerpTo.RootJoint.Cache * CFrame.new(0,0,0)*CFrame.Angles(0,0,0)
  247. LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(sin(angle)*.2,0,0)
  248. LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.Angles(sin(angle)*.2,0,0)
  249. LerpTo.RightLeg.To = LerpTo.RightLeg.Cache * CFrame.Angles(rad(0),0,rad(0))
  250. LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache * CFrame.Angles(-rad(0),0,-rad(0))
  251. end
  252. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude > 2 then
  253. anglespeed = 3
  254. LerpTo.Neck.To = LerpTo.Neck.Cache * CFrame.Angles(-rad(25),0,0)
  255. LerpTo.RootJoint.To=LerpTo.RootJoint.Cache * CFrame.new(0,0,0)*CFrame.Angles(0,0,0)
  256. LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(sin(angle)*.8,0,0)
  257. LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.Angles(-sin(angle)*.8,0,0)
  258. LerpTo.RightLeg.To = LerpTo.RightLeg.Cache * CFrame.Angles(-sin(angle)*.8,0,0)
  259. LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache * CFrame.Angles(sin(angle)*.8,0,0)
  260. end
  261. elseif anim==true and equipped == true then
  262. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude < 2 then
  263. anglespeed = 1/3
  264. LerpTo.Neck.To = LerpTo.Neck.Cache * CFrame.Angles(0,0,0)
  265. LerpTo.RootJoint.To=LerpTo.RootJoint.Cache * CFrame.new(0,0,0)*CFrame.Angles(0,0,0)
  266. LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(rad(5),0,rad(5))
  267. LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.Angles(-rad(5),0,-rad(5))
  268. LerpTo.RightLeg.To = LerpTo.RightLeg.Cache * CFrame.Angles(rad(5),0,rad(5))
  269. LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache * CFrame.Angles(-rad(5),0,-rad(5))
  270. end
  271. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude > 2 then
  272. anglespeed = 3
  273. LerpTo.Neck.To = LerpTo.Neck.Cache * CFrame.Angles(rad(15),0,0)
  274. LerpTo.RootJoint.To=LerpTo.RootJoint.Cache * CFrame.new(0,0,0)*CFrame.Angles(rad(15),0,sin(angle)*.2)
  275. LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(-rad(25),0,rad(15))
  276. LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.Angles(-rad(25),0,-rad(15))
  277. LerpTo.RightLeg.To = LerpTo.RightLeg.Cache * CFrame.Angles(-sin(angle)*.8,0,0)
  278. LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache * CFrame.Angles(sin(angle)*.8,0,0)
  279. end
  280. end
  281. end
  282. mouse.KeyDown:connect(function(key)
  283. if key == "q" and anim == true and attacking == false and equipped == true then
  284. attacking = true
  285. anim = false
  286. LerpTo.Staff1.To=LerpTo.Staff1.Cache*CFrame.Angles(-rad(25),0,rad(25))
  287. LerpTo.Staff2.To=LerpTo.Staff2.Cache*CFrame.Angles(-rad(25),0,-rad(25))
  288. LerpTo.Staff3.To=LerpTo.Staff3.Cache*CFrame.Angles(rad(25),0,-rad(25))
  289. LerpTo.Staff4.To=LerpTo.Staff4.Cache*CFrame.Angles(rad(25),0,rad(25))
  290. LerpTo.Neck.To=LerpTo.Neck.Cache*CFrame.Angles(0,0,rad(45))
  291. LerpTo.RootJoint.To=LerpTo.RootJoint.Cache*CFrame.Angles(0,-rad(75),0)
  292. LerpTo.RightArm.To=LerpTo.RightArm.Cache*CFrame.Angles(0,0,rad(90))
  293. LerpTo.LeftArm.To=LerpTo.LeftArm.Cache*CFrame.Angles(0,0,-rad(90))
  294. LerpTo.RightLeg.To=LerpTo.RightLeg.Cache*CFrame.Angles(rad(25),0,0)
  295. LerpTo.LeftLeg.To=LerpTo.LeftLeg.Cache*CFrame.Angles(0,0,0)
  296. for i = 1,36 do
  297. game:GetService("RunService").Stepped:wait(.15)
  298. LerpTo.RootJoint.To=LerpTo.RootJoint.Cache*CFrame.Angles(0,0,-rad(i*10))*CFrame.Angles(0,-rad(75),0)
  299. end
  300. wait(.5)
  301. LerpTo.Staff4.To=LerpTo.Staff4.Cache*CFrame.Angles(rad(90),rad(45),0)*CFrame.new(-5,0,7)*CFrame.Angles(-rad(25),0,0)
  302. LerpTo.Staff3.To=LerpTo.Staff3.Cache*CFrame.Angles(rad(90),-rad(45),0)*CFrame.new(5,0,7)*CFrame.Angles(-rad(25),0,0)
  303. LerpTo.Staff2.To=LerpTo.Staff2.Cache*CFrame.Angles(-rad(90),rad(45),0)*CFrame.new(5,0,-7)*CFrame.Angles(rad(25),0,0)
  304. LerpTo.Staff1.To=LerpTo.Staff1.Cache*CFrame.Angles(-rad(90),-rad(45),0)*CFrame.new(-5,0,-7)*CFrame.Angles(rad(25),0,0)
  305. anim = true
  306. attacking = false
  307. elseif key == "e" and anim == true and attacking == false and equipped == true then
  308. coroutine.resume(coroutine.create(function()
  309. attacking = true
  310. LerpTo.Staff1.To=LerpTo.Staff1.Cache*CFrame.Angles(0,0,0)*CFrame.new(5,0,7)
  311. LerpTo.Staff2.To=LerpTo.Staff2.Cache*CFrame.Angles(0,0,0)*CFrame.new(-5,0,7)
  312. LerpTo.Staff3.To=LerpTo.Staff3.Cache*CFrame.Angles(0,0,0)*CFrame.new(5,0,-7)
  313. LerpTo.Staff4.To=LerpTo.Staff4.Cache*CFrame.Angles(0,0,0)*CFrame.new(-5,0,-7)
  314. wait(1)
  315. for i = 1,10 do
  316. wait()
  317. chr.Humanoid.Health=chr.Humanoid.Health+5
  318. Lightning(staff1.Position,chr.HumanoidRootPart.Position,3,math.random(-2.5,2.5),"New Yeller",0.2,.4)
  319. Lightning(staff2.Position,chr.HumanoidRootPart.Position,3,math.random(-2.5,2.5),"New Yeller",0.2,.4)
  320. Lightning(staff3.Position,chr.HumanoidRootPart.Position,3,math.random(-2.5,2.5),"New Yeller",0.2,.4)
  321. Lightning(staff4.Position,chr.HumanoidRootPart.Position,3,math.random(-2.5,2.5),"New Yeller",0.2,.4)
  322. end
  323. wait(1)
  324. LerpTo.Staff4.To=LerpTo.Staff4.Cache*CFrame.Angles(rad(90),rad(45),0)*CFrame.new(-5,0,7)*CFrame.Angles(-rad(25),0,0)
  325. LerpTo.Staff3.To=LerpTo.Staff3.Cache*CFrame.Angles(rad(90),-rad(45),0)*CFrame.new(5,0,7)*CFrame.Angles(-rad(25),0,0)
  326. LerpTo.Staff2.To=LerpTo.Staff2.Cache*CFrame.Angles(-rad(90),rad(45),0)*CFrame.new(5,0,-7)*CFrame.Angles(rad(25),0,0)
  327. LerpTo.Staff1.To=LerpTo.Staff1.Cache*CFrame.Angles(-rad(90),-rad(45),0)*CFrame.new(-5,0,-7)*CFrame.Angles(rad(25),0,0)
  328. attacking = false
  329. end))
  330. elseif key == "r" and attacking == false and anim == true and equipped == true then
  331. attacking = true
  332. anim = false
  333. for i,v in pairs(chr:GetChildren()) do
  334. if v:IsA("Part") then
  335. coroutine.resume(coroutine.create(function()
  336. for i = 1,10 do
  337. wait()
  338. v.Transparency = v.Transparency + .1
  339. end
  340. end))
  341. end
  342. end
  343. for i,v in pairs(m:GetChildren()) do
  344. if v:IsA("Part") then
  345. coroutine.resume(coroutine.create(function()
  346. for i = 1,10 do
  347. wait()
  348. v.Transparency=v.Transparency+.1
  349. end
  350. end))
  351. end
  352. end
  353. end
  354. end)
  355. mouse.KeyUp:connect(function(key)
  356. if key == "r" then
  357. attacking = false
  358. anim = true
  359. for i,v in pairs(chr:GetChildren()) do
  360. if v:IsA("Part") then
  361. coroutine.resume(coroutine.create(function()
  362. for i = 1,10 do
  363. wait()
  364. v.Transparency = v.Transparency - .1
  365. end
  366. end))
  367. end
  368. end
  369. for i,v in pairs(m:GetChildren()) do
  370. if v:IsA("Part") then
  371. coroutine.resume(coroutine.create(function()
  372. for i = 1,10 do
  373. wait()
  374. v.Transparency=v.Transparency-.1
  375. end
  376. end))
  377. end
  378. end
  379. end
  380. end)
  381. Spawn(function()
  382. while wait()do
  383. angle = (angle % 100) + anglespeed/10 -- no matter whut it has to be in a loop or its on exticy
  384. end
  385. end)
  386. sdeb=false
  387. game:service'RunService'.RenderStepped:connect(function()
  388.  
  389. for _,v in pairs(LerpTo) do
  390. v.Weld.C0 = Lerp.CFrame(v.Weld.C0,v.To,v.Speed)end
  391. updateanims()
  392. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement