Advertisement
brandonflex123

leaked sword

Jul 17th, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.03 KB | None | 0 0
  1. Player = game:GetService("Players").LocalPlayer
  2. Character = Player.Character
  3. PlayerGui = Player.PlayerGui
  4. Backpack = Player.Backpack
  5. Torso = Character.Torso
  6. Head = Character.Head
  7. Humanoid = Character.Humanoid
  8. LeftArm = Character["Left Arm"]
  9. LeftLeg = Character["Left Leg"]
  10. RightArm = Character["Right Arm"]
  11. RightLeg = Character["Right Leg"]
  12. LS = Torso["Left Shoulder"]
  13. LH = Torso["Left Hip"]
  14. RS = Torso["Right Shoulder"]
  15. RH = Torso["Right Hip"]
  16. Neck = Torso.Neck
  17. it=Instance.new
  18. vt=Vector3.new
  19. cf=CFrame.new
  20. euler=CFrame.fromEulerAnglesXYZ
  21. angles=CFrame.Angles
  22. necko=cf(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  23. necko2=cf(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  24. attack = false
  25. attacktype = 1
  26. damage = 99999999
  27. oridamage = 99999999
  28. BladeNumb=0.8
  29. GyroNumb=0
  30. attackdebounce = false
  31. ssdebounce=false
  32. MMouse=nil
  33. Mode="Sword"
  34. cannonmode=false
  35. combo=0
  36. spinning=false
  37. shootmode=true
  38. --player
  39. player = nil
  40. --save shoulders
  41. RSH, LSH = nil, nil
  42. --welds
  43. RW, LW = Instance.new("Weld"), Instance.new("Weld")
  44. RW.Name="Right Shoulder" LW.Name="Left Shoulder"
  45.  
  46.  
  47. if Character:findFirstChild("Blast Blade",true) ~= nil then
  48. Character:findFirstChild("Blast Blade",true).Parent = nil
  49. end
  50. if Character:findFirstChild("Block",true) ~= nil then
  51. Character:findFirstChild("Block",true).Parent = nil
  52. end
  53.  
  54.  
  55. function part(formfactor,parent,reflectance,transparency,brickcolor,name,size)
  56. local fp = it("Part")
  57. fp.formFactor = formfactor
  58. fp.Parent = parent
  59. fp.Reflectance = reflectance
  60. fp.Transparency = transparency
  61. fp.CanCollide = false
  62. fp.Locked=true
  63. fp.BrickColor = brickcolor
  64. fp.Name = name
  65. fp.Size = size
  66. fp.Position = Torso.Position
  67. fp.BottomSurface="Smooth"
  68. fp.TopSurface="Smooth"
  69. fp:BreakJoints()
  70. return fp
  71. end
  72.  
  73. function mesh(Mesh,part,meshtype,meshid,offset,scale)
  74. local mesh = it(Mesh)
  75. mesh.Parent = part
  76. if Mesh=="SpecialMesh" then
  77. mesh.MeshType = meshtype
  78. mesh.MeshId = meshid
  79. end
  80. mesh.Offset=offset
  81. mesh.Scale=scale
  82. return mesh
  83. end
  84.  
  85. function weld(parent,part0,part1,c0)
  86. local weld = it("Weld")
  87. weld.Parent = parent
  88. weld.Part0 = part0
  89. weld.Part1 = part1
  90. weld.C0 = c0
  91. return weld
  92. end
  93.  
  94. local modelzorz = Instance.new("Model")
  95. modelzorz.Parent = Character
  96. modelzorz.Name = "Blast Blade"
  97.  
  98. local prt1=part(3,modelzorz,0,0,Torso.BrickColor,"Part1",vt(1,1,1))
  99. local prt2=part(3,modelzorz,0,0,BrickColor.new("Black"),"Part2",vt(1,1,1))
  100. local prt3=part(3,modelzorz,0,0,BrickColor.new("Dark stone grey"),"Part3",vt(0.8,0.5,0.8))
  101. local prt5=part(3,modelzorz,0,0,BrickColor.new("Dark stone grey"),"Part5",vt(1,1,1))
  102. local prt6=part(3,modelzorz,0,0,BrickColor.new("Dark stone grey"),"Part6",vt(1,1,1))
  103. local prt7=part(3,modelzorz,0,0,BrickColor.new("Bright red"),"Part7",vt(1,1,1))
  104. local prt8=part(3,modelzorz,0,0,BrickColor.new("Bright red"),"Part8",vt(1,1,1))
  105. local hitbox=part(3,modelzorz,0,1,BrickColor.new("Black"),"Hitbox",vt(1,5,3))
  106.  
  107. local msh1=mesh("CylinderMesh",prt1,"","",vt(0,0,0),vt(0.45,1,0.45))
  108. local msh2=mesh("CylinderMesh",prt2,"","",vt(0,0,0),vt(0.4,2,0.4))
  109. local msh3=mesh("SpecialMesh",prt3,"Head","",vt(0,0,0),vt(1,1,1))
  110. local msh5=mesh("SpecialMesh",prt5,"Head","",vt(0,0,0),vt(0.8,0.5,0.8))
  111. local msh6=mesh("BlockMesh",prt6,"","",vt(0,0,0),vt(0.5,0.5,1.3))
  112. local msh7=mesh("SpecialMesh",prt7,"Sphere","",vt(0,0,0),vt(1.4,1.4,1.4))
  113. local msh8=mesh("SpecialMesh",prt8,"FileMesh","http://www.roblox.com/asset/?id=3270017",vt(0,0,0),vt(1.5,1.5,1.5))
  114.  
  115. local wld1=weld(prt1,prt1,Torso,euler(-2.5,1.57,0)*cf(-2,-3,-0.6))
  116. local wld2=weld(prt2,prt2,prt1,euler(0,0,0)*cf(0,0,0))
  117. local wld3=weld(prt3,prt3,prt2,euler(0,0,0)*cf(0,1.2,0))
  118. local wld5=weld(prt5,prt5,prt2,euler(0,0,0)*cf(0,-1,0))
  119. local wld6=weld(prt6,prt6,prt5,euler(0,0,0)*cf(0,-0.2,0))
  120. local wld7=weld(prt7,prt7,prt6,euler(0,0,0)*cf(0,-1,0))
  121. local wld8=weld(prt8,prt8,prt7,euler(0,1.57,0)*cf(0,0,0))
  122. local hitboxwld=weld(hitbox,hitbox,prt7,euler(0,0,0)*cf(0,-1.5,0))
  123.  
  124. numb=0
  125. for i=1,8 do
  126. local prt4=part(3,modelzorz,0.2,0,BrickColor.new("Medium stone grey"),"Part4",vt(1,1,1))
  127. local msh4=mesh("SpecialMesh",prt4,"FileMesh","http://www.roblox.com/asset/?id=1778999",vt(0,0,0),vt(0.3,0.2,0.3))
  128. local wld4=weld(prt4,prt4,prt3,cf(0,-0.4,0)*euler(1.57,numb,0))
  129. numb=numb+0.785
  130. end
  131. numb=0
  132. for i=1,4 do
  133. local prt9=part(3,modelzorz,0,0,BrickColor.new("Bright red"),"Part9",vt(1,1,1))
  134. local msh9=mesh("CylinderMesh",prt9,"","",vt(0,0,0),vt(0.2,2,0.2))
  135. local wld9=weld(prt9,prt9,prt8,cf(0,0,0)*euler(0,0,numb))
  136. numb=numb+0.785
  137. end
  138. numb=0
  139. numb2=0
  140. numb3=0
  141. for i=1,8 do
  142. local prt10=part(3,modelzorz,0.4,0,BrickColor.new("White"),"Part10",vt(1,1,1))
  143. local msh10=mesh("SpecialMesh",prt10,"Wedge","",vt(0,0,0),vt(0.3-numb2,1.5+numb3,1.5-numb3))
  144. local wld10=weld(prt10,prt10,prt6,euler(0,3.14,0)*cf(0,-0.6-numb,-0.8))
  145. coroutine.resume(coroutine.create(function(Weld,Number,Number3)
  146. while true do
  147. wait(0)
  148. wld10.C0=euler(0,3.14,0)*cf(0,-0.6-Number,-BladeNumb+(Number3/2))
  149. end
  150. end),wld10,numb,numb3)
  151. local prt11=part(3,modelzorz,0.4,0,BrickColor.new("White"),"Part11",vt(1,1,1))
  152. local msh11=mesh("SpecialMesh",prt11,"Wedge","",vt(0,0,0),vt(0.3-numb2,1.5+numb3,1.5-numb3))
  153. local wld11=weld(prt11,prt11,prt6,cf(0,-0.6-numb,0.8))
  154. coroutine.resume(coroutine.create(function(Weld,Number,Number3)
  155. while true do
  156. wait(0)
  157. wld11.C0=cf(0,-0.6-Number,BladeNumb-(Number3/2))
  158. end
  159. end),wld11,numb,numb3)
  160. numb=numb+0.6
  161. numb2=numb2+0.01
  162. numb3=numb3-0.1
  163. end
  164. if (script.Parent.className ~= "HopperBin") then
  165. Tool = Instance.new("HopperBin")
  166. Tool.Parent = Backpack
  167. Tool.Name = "Blast Blade"
  168. script.Parent = Tool
  169. end
  170. Bin = script.Parent
  171.  
  172. local bg = it("BodyGyro")
  173. bg.maxTorque = Vector3.new(4e+005,4e+005,4e+005)*math.huge
  174. bg.P = 20e+003
  175. bg.Parent = nil
  176.  
  177. so = function(id,par,vol,pit)
  178. coroutine.resume(coroutine.create(function()
  179. local sou = Instance.new("Sound",par or workspace)
  180. sou.Volume=vol
  181. sou.Pitch=pit or 1
  182. sou.SoundId=id
  183. wait()
  184. sou:play()
  185. wait(6)
  186. sou:Remove()
  187. end))
  188. end
  189.  
  190. function unequipweld()
  191. wld1.Part1=Torso
  192. wld1.C0=euler(-2.5,1.57,0)*cf(-2,-3,-0.6)
  193. wld1.C1=cf(0,0,0)
  194. end
  195.  
  196. function equipweld()
  197. wld1.Part1=RightArm
  198. wld1.C0=euler(1.57+0.4,0,0)*cf(0,1,0)
  199. end
  200.  
  201. function hideanim()
  202. equipped=false
  203. wait(0.1)
  204. bg.Parent=nil
  205. Neck.C0=necko
  206. unequipweld()
  207. end
  208.  
  209. function equipanim()
  210. equipped=true
  211. wait(0.1)
  212. equipweld()
  213. if Mode=="Sword" then
  214. Neck.C0=necko
  215. RW.C0=cf(0.5, 0.5, -0.5) * euler(1,0,0)
  216. RW.C1=cf(0, 0.5, 0) * euler(0,-1.5,0.4)
  217. LW.C0=cf(-1, 0.5, -0.5) * euler(1,0,0)
  218. LW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  219. elseif Mode=="Cannon" then
  220. coroutine.resume(coroutine.create(function()
  221. bg.maxTorque = vt(math.huge,math.huge,math.huge)
  222. bg.P = 9000
  223. bg.Parent = Torso
  224. --wld1.C0 = euler(0,0,0) * cf(0,0,0)
  225. while cannonmode==true do
  226. wait()
  227. local pos4 = vt(workspace.CurrentCamera.CoordinateFrame.X,Head.Position.Y,workspace.CurrentCamera.CoordinateFrame.Z)
  228. bg.cframe = cf(Head.Position,pos4) * euler(0,3.14+GyroNumb,0) * cf(0,0,0) --cf(Torso.Position,MMouse.Hit.p) *
  229. bg.Parent = Head
  230. local pos5 = Vector3.new(MMouse.Hit.p.x,Head.Position.Y,MMouse.Hit.p.z)
  231. offset=(Torso.Position.y-MMouse.Hit.p.y)/60
  232. mag=(Torso.Position-MMouse.Hit.p).magnitude/80
  233. offset=offset/mag
  234. end
  235. for i=0,1,0.1 do
  236. wait()
  237. bg.Parent=nil
  238. end
  239. end))
  240. Neck.C0=necko*euler(0,0,1)
  241. wld1.C0=euler(1.57,0,0)*cf(0,1,0)
  242. RW.C0=cf(1.5, 0.5, 0) * euler(0,1,0)
  243. RW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  244. LW.C0=cf(-1.5, 0.5, -0.5) * euler(1,1,0)
  245. LW.C1=cf(0, 0.5, 0) * euler(0,0,0)
  246. end
  247. end
  248.  
  249. function rayCast(Pos, Dir, Max, Ignore) -- Origin Position , Direction, MaxDistance , IgnoreDescendants
  250. return game.Workspace:FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  251. end
  252.  
  253. spread=0
  254. range=100
  255. rangepower=25
  256. function shoottrail(mouse,baseprt)
  257. coroutine.resume(coroutine.create(function(v)
  258. local spreadvector = (Vector3.new(math.random(-spread,spread),math.random(-spread,spread),math.random(-spread,spread))) * (baseprt.Position-MMouse.Hit.p).magnitude/100
  259. local dir = CFrame.new((baseprt.Position+MMouse.Hit.p)/2,MMouse.Hit.p+spreadvector)
  260. local hit,pos = rayCast(baseprt.Position,dir.lookVector,10,Character)
  261. local rangepos = range
  262. local function drawtrail(From,To)
  263. local effectsmsh = Instance.new("CylinderMesh")
  264. effectsmsh.Scale = Vector3.new(1,1,1)
  265. effectsmsh.Name = "Mesh"
  266. local effectsg = Instance.new("Part")
  267. effectsg.formFactor = 3
  268. effectsg.CanCollide = false
  269. effectsg.Name = "Eff"
  270. effectsg.Locked = true
  271. effectsg.Anchored = true
  272. effectsg.Size = Vector3.new(0.2,0.2,0.2)
  273. effectsg.Parent = workspace
  274. effectsmsh.Parent = effectsg
  275. effectsg.BrickColor = BrickColor.new("Bright red")
  276. effectsg.Reflectance = 0.25
  277. local LP = From
  278. local point1 = To
  279. local mg = (LP - point1).magnitude
  280. effectsmsh.Scale = Vector3.new(5,mg*5,5)
  281. if shootmode==true then
  282. Lightning(LP,point1,5,1,"Bright red",0.3,0.1)
  283. end
  284. effectsg.CFrame = CFrame.new((LP+point1)/2,point1) * CFrame.Angles(math.rad(90),0,0)
  285. coroutine.resume(coroutine.create(function()
  286. for i = 0 , 1 , 0.2 do
  287. wait()
  288. effectsg.Transparency = 1*i
  289. effectsmsh.Scale = Vector3.new(3-3*i,mg*5,3-3*i)
  290. end
  291. effectsg.Parent = nil
  292. end))
  293. end
  294. local newpos = baseprt.Position
  295. local inc = rangepower
  296. repeat
  297. wait()
  298. rangepos = rangepos - 10
  299. --dir = dir * CFrame.Angles(math.rad(-1),0,0)
  300. hit,pos = rayCast(newpos,dir.lookVector,inc,Character)
  301. drawtrail(newpos,pos)
  302. newpos = newpos + (dir.lookVector * inc)
  303. if hit ~= nil then
  304. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  305. hum = hit.Parent.Humanoid
  306. tTorso=hit.Parent.Torso
  307. Damagefunc1(hit,10,30)
  308. attackdebounce=false
  309. --ADmg(hum,hit)
  310. elseif hit.Parent.Parent ~= nil and hit.Parent.Parent:FindFirstChild("Humanoid") ~= nil then
  311. hum = hit.Parent.Parent.Humanoid
  312. tTorso=hit.Parent.Parent.Torso
  313. Damagefunc1(hit.Parent.Parent.Torso,10,30)
  314. attackdebounce=false
  315. --ADmg(hum,hit)
  316. end
  317. MagicCircle(BrickColor.new("Bright red"),CFrame.new(newpos),2,2,2,3,3,3)
  318. MagicBlock(BrickColor.new("Bright red"),CFrame.new(newpos),2,2,2,2,2,2)
  319. end
  320. until rangepos <= 0
  321. end))
  322. end
  323.  
  324. function shoottrail2(mouse,baseprt)
  325. coroutine.resume(coroutine.create(function(v)
  326. local spreadvector = (Vector3.new(math.random(-spread,spread),math.random(-spread,spread),math.random(-spread,spread))) * (baseprt.Position-MMouse.Hit.p).magnitude/100
  327. local dir = CFrame.new((baseprt.Position+MMouse.Hit.p)/2,MMouse.Hit.p+spreadvector)
  328. local hit,pos = rayCast(baseprt.Position,dir.lookVector,10,Character)
  329. local rangepos = range*5
  330. local function drawtrail(From,To)
  331. local effectsmsh = Instance.new("SpecialMesh")
  332. effectsmsh.Scale = Vector3.new(1,1,1)
  333. effectsmsh.Name = "Mesh"
  334. effectsmsh.MeshType = "Sphere"
  335. local effectsg = Instance.new("Part")
  336. effectsg.formFactor = 3
  337. effectsg.CanCollide = false
  338. effectsg.Name = "Eff"
  339. effectsg.Locked = true
  340. effectsg.Anchored = true
  341. effectsg.Size = Vector3.new(0.2,0.2,0.2)
  342. effectsg.Parent = workspace
  343. effectsmsh.Parent = effectsg
  344. effectsg.BrickColor = BrickColor.new("Bright red")
  345. effectsg.Reflectance = 0.25
  346. local LP = From
  347. local point1 = To
  348. local mg = (LP - point1).magnitude
  349. effectsmsh.Scale = Vector3.new(7,7,7)
  350. --for i=1,3 do
  351. Lightning(LP,point1,5,1,"Bright red",0.3,0.1)
  352. --end
  353. effectsg.CFrame = CFrame.new((LP+point1)/2,point1) * CFrame.Angles(math.rad(90),0,0)
  354. coroutine.resume(coroutine.create(function()
  355. for i = 0 , 1 , 0.1 do
  356. wait()
  357. effectsg.Transparency = 1*i
  358. effectsmsh.Scale = Vector3.new(10-10*i,mg*5,10-10*i)
  359. end
  360. effectsg.Parent = nil
  361. end))
  362. end
  363. local newpos = baseprt.Position
  364. local inc = rangepower/5
  365. repeat
  366. --wait()
  367. rangepos = rangepos - 10
  368. --dir = dir * CFrame.Angles(math.rad(-1),0,0)
  369. hit,pos = rayCast(newpos,dir.lookVector,inc,Character)
  370. drawtrail(newpos,pos)
  371. newpos = newpos + (dir.lookVector * inc)
  372. if hit ~= nil then
  373. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  374. hum = hit.Parent.Humanoid
  375. tTorso=hit.Parent.Torso
  376. Damagefunc1(hit,20,40)
  377. attackdebounce=false
  378. --ADmg(hum,hit)
  379. elseif hit.Parent.Parent ~= nil and hit.Parent.Parent:FindFirstChild("Humanoid") ~= nil then
  380. hum = hit.Parent.Parent.Humanoid
  381. tTorso=hit.Parent.Parent.Torso
  382. Damagefunc1(hit.Parent.Parent.Torso,20,40)
  383. attackdebounce=false
  384. --ADmg(hum,hit)
  385. end
  386. MagicCircle(BrickColor.new("Bright red"),CFrame.new(newpos),2,2,2,3,3,3)
  387. MagicBlock(BrickColor.new("Bright red"),CFrame.new(newpos),2,2,2,2,2,2)
  388. end
  389. until rangepos <= 0
  390. end))
  391. end
  392.  
  393. function shoottrail3(mouse,baseprt)
  394. coroutine.resume(coroutine.create(function(v)
  395. local spreadvector = (Vector3.new(math.random(-spread,spread),math.random(-spread,spread),math.random(-spread,spread))) * (baseprt.Position-MMouse.Hit.p).magnitude/100
  396. local dir = CFrame.new((baseprt.Position+MMouse.Hit.p)/2,MMouse.Hit.p+spreadvector)
  397. local hit,pos = rayCast(baseprt.Position,dir.lookVector,10,Character)
  398. local rangepos = range*50
  399. local function drawtrail(From,To)
  400. local effectsmsh = Instance.new("SpecialMesh")
  401. effectsmsh.Scale = Vector3.new(1,1,1)
  402. effectsmsh.Name = "Mesh"
  403. effectsmsh.MeshType = "FileMesh"
  404. effectsmsh.MeshId = "http://www.roblox.com/asset/?id=3270017"
  405. local effectsg = Instance.new("Part")
  406. effectsg.formFactor = 3
  407. effectsg.CanCollide = false
  408. effectsg.Name = "Eff"
  409. effectsg.Locked = true
  410. effectsg.Anchored = true
  411. effectsg.Size = Vector3.new(0.2,0.2,0.2)
  412. effectsg.Parent = workspace
  413. effectsmsh.Parent = effectsg
  414. effectsg.BrickColor = BrickColor.new("Bright red")
  415. effectsg.Reflectance = 0.25
  416. local LP = From
  417. local point1 = To
  418. local mg = (LP - point1).magnitude
  419. effectsmsh.Scale = Vector3.new(2,2,4)
  420. effectsg.CFrame = CFrame.new((LP+point1)/2,point1) * CFrame.Angles(math.rad(90),0,0)
  421. coroutine.resume(coroutine.create(function()
  422. wait()
  423. effectsg.Parent = nil
  424. end))
  425. end
  426. local newpos = baseprt.Position
  427. local inc = rangepower/10
  428. repeat
  429. wait()
  430. rangepos = rangepos - 10
  431. --dir = dir * CFrame.Angles(math.rad(-1),0,0)
  432. hit,pos = rayCast(newpos,dir.lookVector,inc,Character)
  433. drawtrail(newpos,pos)
  434. local list = game.Workspace:children()
  435. local torso = nil
  436. local dist = 100
  437. local temp = nil
  438. local human = nil
  439. local temp2 = nil
  440. for x = 1, #list do
  441. temp2 = list[x]
  442. if (temp2.className == "Model") and (temp2.Name~=Character.Name) then
  443. temp = temp2:findFirstChild("Torso")
  444. human = temp2:findFirstChild("Humanoid")
  445. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  446. if (temp.Position - pos).magnitude < dist then
  447. torso = temp
  448. dist = (temp.Position - pos).magnitude
  449. end
  450. end
  451. end
  452. end
  453. if torso~=nil then
  454. dir=CFrame.new(pos,torso.Position)
  455. end
  456. newpos = newpos + (dir.lookVector * inc)
  457. if hit ~= nil then
  458. rangepos = 0
  459. if hit.Parent:FindFirstChild("Humanoid") ~= nil then
  460. hum = hit.Parent.Humanoid
  461. tTorso=hit.Parent.Torso
  462. Damagefunc1(hit,20,30)
  463. attackdebounce=false
  464. --ADmg(hum,hit)
  465. elseif hit.Parent.Parent ~= nil and hit.Parent.Parent:FindFirstChild("Humanoid") ~= nil then
  466. hum = hit.Parent.Parent.Humanoid
  467. tTorso=hit.Parent.Parent.Torso
  468. Damagefunc1(hit.Parent.Parent.Torso,20,30)
  469. attackdebounce=false
  470. --ADmg(hum,hit)
  471. end
  472. for i=1,math.random(3,6) do
  473. BreakEffect(BrickColor.new("Bright red"),CFrame.new(newpos),0.5,math.random(5,20),0.5)
  474. end
  475. so("http://roblox.com/asset/?id=3264793",hit,1,math.random()+math.random()+1)
  476. MagicCircle(BrickColor.new("Bright red"),CFrame.new(newpos),2,2,2,3,3,3)
  477. MagicBlock(BrickColor.new("Bright red"),CFrame.new(newpos),2,2,2,2,2,2)
  478. end
  479. until rangepos <= 0
  480. end))
  481. end
  482.  
  483. function MagicBlock(brickcolor,cframe,x1,y1,z1,x3,y3,z3)
  484. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
  485. prt.Anchored=true
  486. prt.CFrame=cframe
  487. local msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1))
  488. coroutine.resume(coroutine.create(function()
  489. for i=0,1,0.1 do
  490. wait()
  491. prt.CFrame=prt.CFrame*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50))
  492. prt.Transparency=i
  493. msh.Scale=msh.Scale+vt(x3,y3,z3)
  494. end
  495. prt.Parent=nil
  496. end))
  497. end
  498.  
  499. function MagicCircle(brickcolor,cframe,x1,y1,z1,x3,y3,z3)
  500. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
  501. prt.Anchored=true
  502. prt.CFrame=cframe
  503. local msh=mesh("SpecialMesh",prt,"Sphere","",vt(0,0,0),vt(x1,y1,z1))
  504. coroutine.resume(coroutine.create(function()
  505. for i=0,1,0.1 do
  506. wait()
  507. prt.CFrame=prt.CFrame
  508. prt.Transparency=i
  509. msh.Scale=msh.Scale+vt(x3,y3,z3)
  510. end
  511. prt.Parent=nil
  512. end))
  513. end
  514.  
  515. function BlastEffect(brickcolor,cframe,x1,y1,z1,x2,y2,z2)
  516. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
  517. prt.Anchored=true
  518. prt.CFrame=cframe
  519. local msh=mesh("SpecialMesh",prt,"FileMesh","http://www.roblox.com/asset/?id=20329976",vt(0,0,0),vt(x1,y1,z1))
  520. coroutine.resume(coroutine.create(function()
  521. for i=0,1,0.05 do
  522. wait()
  523. prt.Transparency=i
  524. msh.Scale=msh.Scale+vt(x2,y2,z2)
  525. end
  526. prt.Parent=nil
  527. end))
  528. end
  529.  
  530. function BreakEffect(brickcolor,cframe,x1,y1,z1)
  531. local prt=part(3,workspace,0,0,brickcolor,"Effect",vt(0.5,0.5,0.5))
  532. prt.Anchored=true
  533. prt.CFrame=cframe*euler(math.random(-50,50),math.random(-50,50),math.random(-50,50))
  534. local msh=mesh("SpecialMesh",prt,"Sphere","",vt(0,0,0),vt(x1,y1,z1))
  535. coroutine.resume(coroutine.create(function(Part,CF,Numbb,randnumb)
  536. CF=Part.CFrame
  537. Numbb=0
  538. randnumb=math.random()-math.random()
  539. for i=0,1,0.05 do
  540. wait()
  541. CF=CF*cf(0,1,0)
  542. --Part.CFrame=Part.CFrame*euler(0.5,0,0)*cf(0,1,0)
  543. Part.CFrame=CF*euler(Numbb,0,0)
  544. Part.Transparency=i
  545. Numbb=Numbb+randnumb
  546. end
  547. Part.Parent=nil
  548. end),prt,CF,Numbb,randnumb)
  549. end
  550.  
  551. function SpecialEffect()
  552. local prt=part(3,workspace,1,0,BrickColor.new("White"),"Part",vt(1,1,1))
  553. prt.Anchored=true
  554. prt.CFrame=Torso.CFrame
  555. local msh=mesh("SpecialMesh",prt,"Sphere","",vt(0,0,0),vt(0.5,0.5,0.5))
  556. coroutine.resume(coroutine.create(function(Part,Mesh)
  557. for i=0,1,0.2 do
  558. wait(0)
  559. Part.Transparency=i
  560. Mesh.Scale=Mesh.Scale+vt(10,10,10)
  561. end
  562. prt.Parent=nil
  563. end),prt,msh)
  564. end
  565.  
  566. function Lightning(p0,p1,tym,ofs,col,th,tra)
  567. local magz = (p0 - p1).magnitude local curpos = p0 local trz = {-ofs,ofs}
  568. for i=1,tym do
  569. local li = Instance.new("Part",workspace) li.TopSurface =0 li.BottomSurface = 0 li.Anchored = true li.Transparency = tra or 0.4 li.BrickColor = BrickColor.new(col)
  570. li.formFactor = "Custom" li.CanCollide = false li.Size = Vector3.new(th,th,magz/tym) local ofz = Vector3.new(trz[math.random(1,2)],trz[math.random(1,2)],trz[math.random(1,2)])
  571. local trolpos = CFrame.new(curpos,p1)*CFrame.new(0,0,magz/tym).p+ofz
  572. if tym == i then
  573. local magz2 = (curpos - p1).magnitude li.Size = Vector3.new(th,th,magz2)
  574. li.CFrame = CFrame.new(curpos,p1)*CFrame.new(0,0,-magz2/2)
  575. else
  576. li.CFrame = CFrame.new(curpos,trolpos)*CFrame.new(0,0,magz/tym/2)
  577. end
  578. curpos = li.CFrame*CFrame.new(0,0,magz/tym/2).p game.Debris:AddItem(li,.5)
  579. end
  580. end
  581.  
  582. function effect(Color,Ref,LP,P1,returnn)
  583. local effectsmsh = Instance.new("BlockMesh")
  584. effectsmsh.Scale = Vector3.new(0.4,1,0.4)
  585. effectsmsh.Name = "Mesh"
  586. local effectsg = Instance.new("Part")
  587. effectsg.formFactor = 3
  588. effectsg.CanCollide = false
  589. effectsg.Name = "Eff"
  590. effectsg.Locked = true
  591. effectsg.Anchored = true
  592. effectsg.Size = Vector3.new(0.2,1,0.2)
  593. effectsg.Parent = workspace
  594. effectsmsh.Parent = effectsg
  595. effectsg.BrickColor = BrickColor.new(Color)
  596. effectsg.Reflectance = Ref
  597. local point1 = P1
  598. local mg = (LP.p - point1.p).magnitude
  599. effectsg.Size = Vector3.new(0.4,mg,0.4)
  600. effectsg.CFrame = CFrame.new((LP.p+point1.p)/2,point1.p) * CFrame.Angles(math.rad(90),0,0)
  601. if returnn then return effectsg end
  602. coroutine.resume(coroutine.create(function()
  603. if not returnn then
  604. for i = 0 , 1 , 0.2 do
  605. wait()
  606. effectsg.Transparency = 1*i
  607. effectsmsh.Scale = Vector3.new(0.4-0.4*i,1,0.4-0.4*i)
  608. end
  609. wait()
  610. effectsg.Parent = nil
  611. end
  612. end))
  613. end
  614.  
  615. Damagefunc1=function(hit,Damage,Knockback)
  616. if hit.Parent==nil then
  617. return
  618. end
  619. CPlayer=Bin
  620. h=hit.Parent:FindFirstChild("Humanoid")
  621. if h~=nil and hit.Parent.Name~=Character.Name and hit.Parent:FindFirstChild("Torso")~=nil then
  622. if attackdebounce == false then
  623. attackdebounce = true
  624. coroutine.resume(coroutine.create(function()
  625. wait(0.2)
  626. attackdebounce = false
  627. end))
  628. Damage=Damage
  629. --[[ if game.Players:GetPlayerFromCharacter(hit.Parent)~=nil then
  630. return
  631. end]]
  632. -- hs(hit,1.2)
  633. c=Instance.new("ObjectValue")
  634. c.Name="creator"
  635. c.Value=game.Players.LocalPlayer
  636. c.Parent=h
  637. game:GetService("Debris"):AddItem(c,.5)
  638. Damage=Damage+math.random(0,10)
  639. -- h:TakeDamage(Damage)
  640. blocked=false
  641. block=hit.Parent:findFirstChild("Block")
  642. if block~=nil then
  643. print("herp")
  644. if block.Value>0 then
  645. blocked=true
  646. block.Value=block.Value-1
  647. print(block.Value)
  648. end
  649. end
  650. if blocked==false then
  651. -- h:TakeDamage(Damage)
  652. h.Health=h.Health-Damage
  653. showDamage(hit.Parent,Damage,.5)
  654. else
  655. h:TakeDamage(1)
  656. showDamage(hit.Parent,1,.5)
  657. end
  658. vp=Instance.new("BodyVelocity")
  659. vp.P=500
  660. vp.maxForce=Vector3.new(math.huge,0,math.huge)
  661. -- vp.velocity=Character.Torso.CFrame.lookVector*Knockback
  662. vp.velocity=Head.CFrame.lookVector*Knockback+Head.Velocity/1.05
  663. if Knockback>0 then
  664. vp.Parent=hit.Parent.Torso
  665. end
  666. game:GetService("Debris"):AddItem(vp,.25)
  667. game:GetService("Debris"):AddItem(r,.5)
  668. c=Instance.new("ObjectValue")
  669. c.Name="creator"
  670. c.Value=Player
  671. c.Parent=h
  672. game:GetService("Debris"):AddItem(c,.5)
  673. CRIT=false
  674. hitDeb=true
  675. AttackPos=6
  676. end
  677. end
  678. end
  679. Damagefuncbr=function(hit,Damage,Knockback)
  680. if hit.Parent==nil then
  681. return
  682. end
  683. CPlayer=Bin
  684. h=hit.Parent:FindFirstChild("Humanoid")
  685. if h~=nil and hit.Parent.Name~=Character.Name and hit.Parent:FindFirstChild("Torso")~=nil then
  686. if attackdebounce == false then
  687. attackdebounce = true
  688. coroutine.resume(coroutine.create(function()
  689. wait(0.2)
  690. attackdebounce = false
  691. end))
  692. Damage=Damage
  693. for i=1,math.random(3,6) do
  694. BreakEffect(BrickColor.new("Bright red"),hit.Parent.Torso.CFrame,0.5,math.random(5,20),0.5)
  695. end
  696. coroutine.resume(coroutine.create(function(Part)
  697. for i=1,5 do
  698. wait()
  699. Part.CFrame=Head.CFrame*cf(0,0,-3)
  700. MagicBlock(BrickColor.new("Bright red"),Part.CFrame*cf(0,0,0),1,1,1,1,1,1)
  701. end
  702. end),hit.Parent.Torso)
  703. so("http://roblox.com/asset/?id=3264793",hit.Parent.Torso,1,math.random()+math.random()+1)
  704. --[[ if game.Players:GetPlayerFromCharacter(hit.Parent)~=nil then
  705. return
  706. end]]
  707. -- hs(hit,1.2)
  708. c=Instance.new("ObjectValue")
  709. c.Name="creator"
  710. c.Value=game.Players.LocalPlayer
  711. c.Parent=h
  712. game:GetService("Debris"):AddItem(c,.5)
  713. Damage=Damage+math.random(0,10)
  714. -- h:TakeDamage(Damage)
  715. blocked=false
  716. block=hit.Parent:findFirstChild("Block")
  717. if block~=nil then
  718. print("herp")
  719. if block.Value>0 then
  720. blocked=true
  721. block.Value=block.Value-1
  722. print(block.Value)
  723. end
  724. end
  725. if blocked==false then
  726. -- h:TakeDamage(Damage)
  727. h.Health=h.Health-Damage
  728. showDamage(hit.Parent,Damage,.5)
  729. else
  730. h:TakeDamage(1)
  731. showDamage(hit.Parent,1,.5)
  732. end
  733. vp=Instance.new("BodyVelocity")
  734. vp.P=500
  735. vp.maxForce=Vector3.new(math.huge,0,math.huge)
  736. -- vp.velocity=Character.Torso.CFrame.lookVector*Knockback
  737. vp.velocity=Head.CFrame.lookVector*Knockback
  738. vp.Parent=hit.Parent.Torso
  739. game:GetService("Debris"):AddItem(vp,1)
  740. c=Instance.new("ObjectValue")
  741. c.Name="creator"
  742. c.Value=Player
  743. c.Parent=h
  744. game:GetService("Debris"):AddItem(c,.5)
  745. CRIT=false
  746. hitDeb=true
  747. AttackPos=6
  748. end
  749. end
  750. end
  751. Damagefunc2=function(hit,Damage,Knockback)
  752. if attackdebounce == false then
  753. --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement