Hebablazin

Spirit Swprd

May 31st, 2016
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.71 KB | None | 0 0
  1. --Spirit Sword Gifted by machontz, Local Script!
  2.  
  3. for i, v in pairs(game.Players.LocalPlayer.Backpack:children()) do
  4. if v.className == "HopperBin" and v.Name == "SpiritSword" then
  5. v:remove()
  6. end
  7. end
  8. bin = Instance.new("HopperBin")
  9. bin.Name = "SpiritSword"
  10. bin.Parent = game.Players.LocalPlayer.Backpack
  11. local hop = Instance.new("HopperBin")
  12. script.Parent = hop
  13.  
  14. local doublesword = true
  15. local doubleclicktime = 0.3
  16. local idledmg = 5
  17. local chargedmg = 8
  18. if doublesword == true then
  19. idledmg = idledmg/1.7
  20. chargedmg = chargedmg/1.7
  21. end
  22.  
  23. local character = game.Players.LocalPlayer.Character
  24. local char = game.Players.LocalPlayer.Character
  25. local HUM = game.Players.LocalPlayer.Character:findFirstChild("Humanoid")
  26. local Torsoz = game.Players.LocalPlayer.Character:findFirstChild("Torso")
  27. local RA = game.Players.LocalPlayer.Character:findFirstChild("Right Arm")
  28. local LA = game.Players.LocalPlayer.Character:findFirstChild("Left Arm")
  29. local H = game.Players.LocalPlayer.Character:findFirstChild("Head")
  30. local RS = Torsoz:findFirstChild("Right Shoulder")
  31. local LS = Torsoz:findFirstChild("Left Shoulder")
  32. local RH = Torsoz:findFirstChild("Right Hip")
  33. local LH = Torsoz:findFirstChild("Left Hip")
  34. local N = Torsoz:findFirstChild("Neck")
  35. local Joint1
  36. local Joint2
  37. local Main
  38. local j
  39. local j2
  40. local Attacking = false
  41. local Charging = false
  42. local Casting = false
  43. local clickval = false
  44. local effectz = false
  45. local rnum = Instance.new("NumberValue")
  46. rnum.Value = math.random()
  47. local efftable = {}
  48. local raytable = {}
  49.  
  50. chargepitch = 1.7
  51. chargevol = 0.2
  52. local ChargeSwing = Instance.new("Sound", H)
  53. ChargeSwing.SoundId = "http://www.roblox.com/asset/?id=31758934"
  54. ChargeSwing.Pitch = chargepitch
  55. ChargeSwing.Volume = chargevol
  56. summonpitch = 1
  57. summonvol = 1
  58. local Summon = Instance.new("Sound", H)
  59. Summon.SoundId = "http://www.roblox.com/asset/?id=12229501"
  60. Summon.Pitch = summonpitch
  61. Summon.Volume = summonvol
  62. Summon.Looped = false
  63. local HitSound = Instance.new("Sound", H)
  64. HitSound.SoundId = "http://www.roblox.com/asset/?id=16950449"
  65. HitSound.Pitch = 0.6
  66. HitSound.Volume = 0.7
  67. HitSound.Looped = false
  68.  
  69. local P = Instance.new("Part")
  70. P.Anchored = false
  71. P.CanCollide = false
  72. P.Name = "Part"
  73. P.formFactor = "Custom"
  74. P.Size = Vector3.new(0.5,0.5,0.5)
  75. P.Locked = true
  76. P.TopSurface = 0
  77. P.BottomSurface = 0
  78.  
  79. function Build()
  80. for i, v in pairs(char:children()) do
  81. if v.className == "Model" and v.Name == "SpiritSword" then
  82. v:remove()
  83. end
  84. end
  85. local mdl = Instance.new("Model", char)
  86. mdl.Name = "SpiritSword"
  87.  
  88. local h = P:Clone()
  89. h.Name = "Sword"
  90. h.Parent = mdl
  91. h.Size = Vector3.new(1,1,4.2)
  92. local mesh = Instance.new("SpecialMesh", h)
  93. mesh.Name = "Mesh"
  94. mesh.MeshId = "http://www.roblox.com/asset/?id=76448940"
  95. mesh.TextureId = "http://www.roblox.com/asset/?id=76448989"
  96. mesh.Scale = Vector3.new(0.75,0.75,0.75)
  97. j = h:Clone()
  98. j.Parent = h
  99. j.Size = Vector3.new(0.5,0.5,0.5)
  100. j.Name = "SwordEffect"
  101. j.Transparency = 0.2
  102. local w = Instance.new("Motor", j)
  103. w.Part0 = h
  104. w.Part1 = j
  105. local w = Instance.new("Motor", h)
  106. w.Part0 = Torsoz
  107. w.Part1 = h
  108. w.C0 = CFrame.new(0,0,0.55) * CFrame.Angles(math.pi/2,0,math.pi)
  109. w.C0 = w.C0 * CFrame.Angles(0,math.pi/4,0)
  110. Main = w
  111. if doublesword == true then
  112. local h2 = P:Clone()
  113. h2.Name = "Sword2"
  114. h2.Parent = h
  115. h2.Size = Vector3.new(1,1,4.2)
  116. local mesh = Instance.new("SpecialMesh", h2)
  117. mesh.MeshId = "http://www.roblox.com/asset/?id=76448940"
  118. mesh.TextureId = "http://www.roblox.com/asset/?id=76448989"
  119. mesh.Scale = Vector3.new(0.75,0.75,0.75)
  120. j2 = h2:Clone()
  121. j2.Parent = h2
  122. j2.Size = Vector3.new(0.5,0.5,0.5)
  123. j2.Name = "SwordEffect2"
  124. j2.Transparency = 0.2
  125. local w = Instance.new("Motor", j2)
  126. w.Part0 = h2
  127. w.Part1 = j2
  128. local w = Instance.new("Motor", h2)
  129. w.Part0 = h
  130. w.Part1 = h2
  131. w.C0 = CFrame.new(0,0,-3.25) * CFrame.Angles(0,-math.pi,0)
  132. end
  133.  
  134. end
  135. Build()
  136.  
  137. function Click(num)
  138. if clickval == true then
  139. wait()
  140. clickval = false
  141. else
  142. clickval = true
  143. wait(doubleclicktime)
  144. clickval = false
  145. end
  146. end
  147.  
  148. function ChargeAttack(mouse, speed)
  149. Charging = true
  150. local p = Joint1.Parent
  151. Joint1:remove()
  152. Joint1 = Instance.new("Motor", p)
  153. Joint1.Part0 = Torsoz
  154. Joint1.Part1 = p
  155. Joint1.C0 = CFrame.new(1.5,0.5,0)
  156. local rnumz = rnum.Value
  157. local jointz = Joint1
  158. local con = Main.Parent.Touched:connect(function(hit)
  159. if hit.Parent:findFirstChild("Humanoid") ~= nil and hit.Parent.Name ~= char.Name then
  160. HitSound:Stop()
  161. hit.Parent.Humanoid:TakeDamage(chargedmg)
  162. HitSound:Play()
  163. end
  164. end)
  165. local con2 = nil
  166. if doublesword == true then
  167. con2 = Main.Parent.Sword2.Touched:connect(function(hit)
  168. if hit.Parent:findFirstChild("Humanoid") ~= nil and hit.Parent.Name ~= char.Name then
  169. hit.Parent.Humanoid:TakeDamage(chargedmg)
  170. end
  171. end)
  172. end
  173. wait()
  174. Attacking = true
  175. --print("Charge Activated")
  176. Torsoz.CFrame = CFrame.new(Torsoz.Position, Vector3.new(mouse.Hit.x,Torsoz.Position.y,mouse.Hit.z))
  177. local bv = Instance.new("BodyVelocity", Torsoz)
  178. bv.maxForce = Vector3.new(math.huge,0,math.huge)
  179. bv.velocity = CFrame.new(Torsoz.Position, Vector3.new(mouse.Hit.x,Torsoz.Position.y,mouse.Hit.z)).lookVector * speed
  180. local bg = Instance.new("BodyGyro", Torsoz)
  181. bg.maxTorque = Vector3.new(math.huge,0,math.huge)
  182. bg.cframe = CFrame.new(Torsoz.Position, Vector3.new(mouse.Hit.x,Torsoz.Position.y,mouse.Hit.z))
  183. bg.D = 100
  184. effectz = true
  185. for _ = 1, 1 do
  186. jointz.C0 = CFrame.new(1.35,0.5,0) * CFrame.Angles(0,0,-math.pi/3)
  187. jointz.C0 = jointz.C0 * CFrame.Angles(math.pi/1.1,0,0)
  188. ChargeSwing.Pitch = chargepitch
  189. ChargeSwing.Volume = chargevol
  190. ChargeSwing:Play()
  191. for i = 1, 13 do
  192. ChargeSwing.Pitch = ChargeSwing.Pitch - 0.045
  193. ChargeSwing.Volume = ChargeSwing.Volume + 0.1
  194. jointz.C0 = jointz.C0 * CFrame.Angles(-(math.pi/1.1)/13,0,0)
  195. wait()
  196. end
  197. jointz.C0 = CFrame.new(1.25,0.5,0) * CFrame.Angles(0,0,math.pi/3)
  198. jointz.C0 = jointz.C0 * CFrame.Angles(math.pi/1.3,0,0)
  199. ChargeSwing.Pitch = chargepitch
  200. ChargeSwing.Volume = chargevol
  201. ChargeSwing:Play()
  202. for i = 1, 13 do
  203. ChargeSwing.Pitch = ChargeSwing.Pitch - 0.045
  204. ChargeSwing.Volume = ChargeSwing.Volume + 0.1
  205. jointz.C0 = jointz.C0 * CFrame.Angles(-(math.pi*1.15)/13,0,0)
  206. wait()
  207. end
  208. end
  209. HUM.PlatformStand = false
  210. con:disconnect()
  211. if con2 ~= nil then
  212. con2:disconnect()
  213. end
  214. bv:Destroy()
  215. bg:Destroy()
  216. jointz.C0 = CFrame.new(1.5,0.5,0) * CFrame.Angles(math.pi/2.4,0,0)
  217. wait()
  218. ChargeSwing.Pitch = chargepitch
  219. ChargeSwing.Volume = chargevol
  220. Attacking = false
  221. Charging = false
  222. effectz = false
  223. end
  224.  
  225. function IdleAttack()
  226. effectz = true
  227. local numz = rnum.Value
  228. local jointz = Joint1
  229. local con = Main.Parent.Touched:connect(function(hit)
  230. if hit.Parent:findFirstChild("Humanoid") ~= nil and hit.Parent.Name ~= char.Name then
  231. HitSound:Stop()
  232. hit.Parent.Humanoid:TakeDamage(idledmg)
  233. HitSound:Play()
  234. end
  235. end)
  236. local con2 = nil
  237. if doublesword == true then
  238. con2 = Main.Parent.Sword2.Touched:connect(function(hit)
  239. if hit.Parent:findFirstChild("Humanoid") ~= nil and hit.Parent.Name ~= char.Name then
  240. hit.Parent.Humanoid:TakeDamage(idledmg)
  241. end
  242. end)
  243. end
  244. Attacking = true
  245. --print("Attack Activated")
  246. jointz.C0 = CFrame.new(1.25,0.5,0) * CFrame.Angles(0,0,math.pi/3)
  247. jointz.C0 = jointz.C0 * CFrame.Angles(math.pi/1.3,0,0)
  248. ChargeSwing.Pitch = chargepitch
  249. ChargeSwing.Volume = chargevol
  250. ChargeSwing:Play()
  251. for i = 1, 16 do
  252. if rnum.Value ~= numz then
  253. ChargeSwing:Stop()
  254. --print("Attack Deactivated")
  255. break
  256. end
  257. ChargeSwing.Pitch = ChargeSwing.Pitch - 0.045
  258. ChargeSwing.Volume = ChargeSwing.Volume + 0.1
  259. jointz.C0 = jointz.C0 * CFrame.Angles(-(math.pi*1.15)/16,0,0)
  260. wait()
  261. end
  262. HUM.PlatformStand = false
  263. con:disconnect()
  264. if con2 ~= nil then
  265. con2:disconnect()
  266. end
  267. jointz.C0 = CFrame.new(1.5,0.5,0) * CFrame.Angles(math.pi/2.4,0,0)
  268. ChargeSwing.Pitch = chargepitch
  269. ChargeSwing.Volume = chargevol
  270. Attacking = false
  271. effectz = false
  272. end
  273.  
  274. function onButton1Down(mouse)
  275. if Charging == false and Casting == false then
  276. if clickval == true then
  277. rnum.Value = math.random()
  278. coroutine.resume(coroutine.create(ChargeAttack), mouse, 40)
  279. else
  280. if Attacking == false then
  281. coroutine.resume(coroutine.create(IdleAttack))
  282. end
  283. end
  284. end
  285.  
  286. coroutine.resume(coroutine.create(Click), rnum.Value)
  287.  
  288. end
  289.  
  290. function SwordThrow(mouse)
  291. local bp = Instance.new("BodyPosition", Torsoz)
  292. bp.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  293. bp.position = Torsoz.Position
  294. local bg = Instance.new("BodyGyro", Torsoz)
  295. bg.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  296. bg.cframe = CFrame.new(Torsoz.Position, Vector3.new(mouse.Hit.x,Torsoz.Position.y,mouse.Hit.z))
  297. HUM.WalkSpeed = 0
  298. local jointz = Joint1
  299. Casting = true
  300. Torsoz.CFrame = CFrame.new(Torsoz.Position, Vector3.new(mouse.Hit.x,Torsoz.Position.y,mouse.Hit.z))
  301. local tab = {}
  302. for i = 1, 3 do
  303. local s = P:Clone()
  304. s.Name = "SwordSpell"
  305. s.Parent = char
  306. s.Anchored = true
  307. s.Size = Vector3.new(0.5,0.5,0.5)
  308. s.Transparency = 1
  309. if i == 1 then
  310. s.CFrame = Torsoz.CFrame * CFrame.new(-4,-4.5,0) * CFrame.Angles(-math.pi/2,0,0)
  311. elseif i == 2 then
  312. s.CFrame = Torsoz.CFrame * CFrame.new(0,-4.5,-4) * CFrame.Angles(-math.pi/2,0,-math.pi/2)
  313. elseif i == 3 then
  314. s.CFrame = Torsoz.CFrame * CFrame.new(4,-4.5,0) * CFrame.Angles(-math.pi/2,0,math.pi)
  315. end
  316. local mesh = Instance.new("SpecialMesh", s)
  317. mesh.MeshId = "http://www.roblox.com/asset/?id=76448940"
  318. mesh.TextureId = "http://www.roblox.com/asset/?id=76448989"
  319. mesh.Scale = Vector3.new(0.55,0.55,0.75)
  320. mesh.VertexColor = Vector3.new(0.2,0.45,1)
  321. tab[i] = s
  322. end
  323. jointz.C0 = CFrame.new(1.5,0.5,0) * CFrame.Angles(0,0,0)
  324. Summon.Pitch = summonpitch
  325. Summon.Volume = summonvol
  326. effectz = true
  327. Summon:Play()
  328. for i = 1, 22 do
  329. Summon.Pitch = Summon.Pitch - (1/22)
  330. for i, v in pairs(tab) do
  331. v.CFrame = v.CFrame * CFrame.new(0,0,9/22) * CFrame.Angles(0,0,math.pi*6/22)
  332. v.Transparency = v.Transparency - 0.65/22
  333. end
  334. jointz.C0 = jointz.C0 * CFrame.Angles(math.pi/1.6/22,0,0) * CFrame.Angles(0,0,0.08)
  335. wait(0.012)
  336. end
  337. wait(0.12)
  338. Summon:Stop()
  339. Summon.Pitch = summonpitch
  340. Summon.Volume = summonvol
  341. for i = 1, 3 do
  342. jointz.C0 = jointz.C0 * CFrame.Angles(0,-math.pi/2/3,0)
  343. wait()
  344. end
  345. for i, v in pairs(tab) do
  346. v.CFrame = CFrame.new(v.Position, mouse.Hit.p) * CFrame.Angles(0,math.pi,0)
  347. end
  348. for i = 1, 5 do
  349. jointz.C0 = jointz.C0 * CFrame.Angles(-math.pi/1.4/5,0.06,0)
  350. if i == 3 then
  351. for ii = 1, 3 do
  352. table.insert(raytable, tab[ii])
  353. game:service("Debris"):AddItem(tab[ii], 8.5)
  354. tab[ii] = nil
  355. end
  356. end
  357. wait()
  358. end
  359. effectz = false
  360. HUM.WalkSpeed = 16
  361. bp:Destroy()
  362. bg:Destroy()
  363. wait(0.45)
  364. Casting = false
  365. jointz.C0 = CFrame.new(1.5,0.5,0) * CFrame.Angles(math.pi/2.4,0,0)
  366. end
  367.  
  368. function Teleport(mouse)
  369. local posz = mouse.Hit.p
  370. local bp = Instance.new("BodyPosition", Torsoz)
  371. bp.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  372. bp.position = Torsoz.Position
  373. local bg = Instance.new("BodyGyro", Torsoz)
  374. bg.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  375. bg.cframe = CFrame.new(Torsoz.Position, Vector3.new(mouse.Hit.x,Torsoz.Position.y,mouse.Hit.z))
  376. HUM.WalkSpeed = 0
  377. local jointz = Joint1
  378. jointz.C0 = CFrame.new(1.5,0.5,0) * CFrame.Angles(0,0,0)
  379. Casting = true
  380. effectz = true
  381. Torsoz.CFrame = CFrame.new(Torsoz.Position, Vector3.new(mouse.Hit.x,Torsoz.Position.y,mouse.Hit.z))
  382. local por = P:Clone()
  383. por.Parent = Torsoz
  384. por.Anchored = true
  385. por.CFrame = Torsoz.CFrame + Torsoz.CFrame.lookVector*3.5
  386. por.BrickColor = BrickColor.new("Navy blue")
  387. por.Transparency = 1
  388. por.Reflectance = 1
  389. local mesh = Instance.new("SpecialMesh", por)
  390. mesh.MeshType = "Sphere"
  391. mesh.Scale = Vector3.new(0,0,0)
  392. local mar = P:Clone()
  393. mar.Parent = Torsoz
  394. mar.Anchored = true
  395. mar.CFrame = CFrame.new(posz) + Vector3.new(0,1,0)
  396. mar.BrickColor = BrickColor.new("Navy blue")
  397. mar.Transparency = 1
  398. mar.Reflectance = 1
  399. local mesh = Instance.new("SpecialMesh", mar)
  400. mesh.Scale = Vector3.new(0,3,0)
  401. mesh.MeshId = "http://www.roblox.com/asset/?id=20329976"
  402.  
  403. for i = 1, 22 do
  404. por.Transparency = por.Transparency - (0.7/22)
  405. por.Reflectance = por.Reflectance - (0.9/22)
  406. por.Mesh.Scale = por.Mesh.Scale + Vector3.new(16/22,19/22,0.6/22)
  407. jointz.C0 = jointz.C0 * CFrame.Angles(math.pi/1.6/22,0,0) * CFrame.Angles(0,0,0.08)
  408. wait()
  409. end
  410. for i = 1, 10 do
  411. mar.Transparency = mar.Transparency - (0.7/10)
  412. mar.Reflectance = mar.Reflectance - (0.9/10)
  413. mar.Mesh.Scale = mar.Mesh.Scale + Vector3.new(12/10,0,12/10)
  414. jointz.C0 = jointz.C0 * CFrame.Angles(0,-math.pi*2/10,0)
  415. wait()
  416. end
  417. HUM.WalkSpeed = 16
  418. bp:Destroy()
  419. bg:Destroy()
  420. Torsoz.CFrame = CFrame.new(posz, Torsoz.CFrame.p) * CFrame.Angles(0,math.pi,0) + Vector3.new(0,3.5,0)
  421. for i = 1, 11 do
  422. por.Transparency = por.Transparency + (0.7/11)
  423. por.Reflectance = por.Reflectance + (0.9/11)
  424. por.Mesh.Scale = por.Mesh.Scale - Vector3.new(16/11,19/11,0.6/11)
  425. mar.Transparency = mar.Transparency + (0.7/11)
  426. mar.Reflectance = mar.Reflectance + (0.9/11)
  427. mar.Mesh.Scale = mar.Mesh.Scale - Vector3.new(12/11,2/11,12/11)
  428. jointz.C0 = jointz.C0 * CFrame.Angles(-(math.pi/1.6)/11,0,0) * CFrame.Angles(0,0,-0.16)
  429. wait()
  430. end
  431. por:Destroy()
  432. mar:Destroy()
  433. effectz = false
  434. wait(0.15)
  435. Casting = false
  436. jointz.C0 = CFrame.new(1.5,0.5,0) * CFrame.Angles(math.pi/2.4,0,0)
  437. end
  438.  
  439. function onKeyDown(key, mouse)
  440. if Charging == false and Attacking == false and Casting == false then
  441. if key == "e" then
  442. SwordThrow(mouse)
  443. elseif key == "g" then
  444. Teleport(mouse)
  445. end
  446. end
  447. end
  448.  
  449. function Equip()
  450. effectz = true
  451. Attacking = true
  452. Charging = true
  453. local p = P:Clone()
  454. p.Parent = Torsoz
  455. p.Transparency = 1
  456. local w = Instance.new("Motor", p)
  457. w.Part0 = p
  458. w.Part1 = RA
  459. w.C0 = CFrame.new(0,-0.5,0)
  460. RS.Part0 = nil
  461. Joint1 = Instance.new("Motor", p)
  462. Joint1.Part0 = Torsoz
  463. Joint1.Part1 = p
  464. Joint1.C0 = CFrame.new(1.5,0.5,0)
  465.  
  466. for i = 1, 8 do
  467. Joint1.C0 = Joint1.C0 * CFrame.Angles(math.pi*1.2/8,-0.4/8,0)
  468. wait()
  469. end
  470. Main.Part0 = RA
  471. Main.C0 = CFrame.new(0,-1,-1.5) * CFrame.Angles(0,math.pi,math.pi/2)
  472. for i = 1, 9 do
  473. Joint1.C0 = Joint1.C0 * CFrame.Angles(-math.pi*1.2/14,0,0)
  474. wait()
  475. end
  476. Main.Part0 = RA
  477. Main.C0 = CFrame.new(0,-1,-1.5) * CFrame.Angles(0,math.pi,math.pi/2)
  478. Joint1.C0 = CFrame.new(1.5,0.5,0) * CFrame.Angles(math.pi/2.4,0,0)
  479. Attacking = false
  480. Charging = false
  481. effectz = false
  482. end
  483.  
  484. function UnEquip()
  485. effectz = true
  486. local joint = Joint1
  487. Joint1.C0 = CFrame.new(1.5,0.5,0) * CFrame.Angles(math.pi/2.4,0,0)
  488. for i = 1, 9 do
  489. Joint1.C0 = Joint1.C0 * CFrame.Angles(math.pi*1.2/14,0,0)
  490. wait()
  491. end
  492. Main.Part0 = Torsoz
  493. Main.C0 = CFrame.new(0,0,0.55) * CFrame.Angles(math.pi/2,0,math.pi)
  494. Main.C0 = Main.C0 * CFrame.Angles(0,math.pi/4,0)
  495. for i = 1, 8 do
  496. Joint1.C0 = Joint1.C0 * CFrame.Angles(-math.pi*1.2/8,0,0)
  497. wait()
  498. end
  499. joint.Parent:remove()
  500. RS.Part0 = Torsoz
  501. RS.Part1 = RA
  502. effectz = false
  503. end
  504.  
  505. bin.Selected:connect(function(mouse)
  506. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  507. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  508. mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end)
  509. Equip()
  510. end)
  511.  
  512. bin.Deselected:connect(function()
  513. UnEquip()
  514. Build()
  515. end)
  516.  
  517.  
  518. wait(1)
  519. local plus = true
  520. local DDD = 1
  521. coroutine.resume(coroutine.create(function()
  522. while true do
  523. DDD = DDD + 1
  524. if DDD%1 == 0 then
  525. if effectz == true then
  526. if Main.Parent ~= nil then
  527. local gg = P:Clone()
  528. gg.Name = "SwordEffect"
  529. gg.Parent = Torsoz
  530. gg.Anchored = true
  531. gg.Size = Vector3.new(0.5,0.5,0.5)
  532. gg.CFrame = Main.Parent.CFrame
  533. local mesh = Instance.new("SpecialMesh", gg)
  534. mesh.MeshId = "http://www.roblox.com/asset/?id=76448940"
  535. mesh.TextureId = "http://www.roblox.com/asset/?id=76448989"
  536. mesh.Scale = Vector3.new(0.75,0.75,0.75)
  537. table.insert(efftable, gg)
  538. if doublesword == true then
  539. local gg2 = P:Clone()
  540. gg2.Name = "SwordEffect2"
  541. gg2.Parent = Torsoz
  542. gg2.Anchored = true
  543. gg2.Size = Vector3.new(0.5,0.5,0.5)
  544. gg2.CFrame = gg.CFrame * CFrame.new(0,0,-3.25) * CFrame.Angles(0,math.pi,0)
  545. local mesh = Instance.new("SpecialMesh", gg2)
  546. mesh.MeshId = "http://www.roblox.com/asset/?id=76448940"
  547. mesh.TextureId = "http://www.roblox.com/asset/?id=76448989"
  548. mesh.Scale = Vector3.new(0.75,0.75,0.75)
  549. table.insert(efftable, gg2)
  550. end
  551. end
  552. end
  553. end
  554. for i, v in pairs(efftable) do
  555. if v.Transparency > 0.9 then
  556. efftable[i]:remove()
  557. efftable[i] = nil
  558. end
  559. v.Transparency = v.Transparency + 0.055
  560. end
  561. if j ~= nil then
  562. if j.Transparency > 0.96 then
  563. plus = false
  564. j.Transparency = 0.25
  565. j.Mesh.Scale = Vector3.new(0.75,0.75,0.75)
  566. j.Mesh.VertexColor = Vector3.new(1,1,1)
  567. if j2 ~= nil then
  568. j2.Transparency = 0.25
  569. j2.Mesh.Scale = Vector3.new(0.75,0.75,0.75)
  570. j2.Mesh.VertexColor = Vector3.new(1,1,1)
  571. end
  572. Spawn(function() wait(0.5) plus = true end)
  573. end
  574. if plus == true then
  575. j.Transparency = j.Transparency + 0.045
  576. j.Mesh.Scale = j.Mesh.Scale + Vector3.new(0.022*2,0.028*2,0.004*2)
  577. j.Mesh.VertexColor = j.Mesh.VertexColor - Vector3.new(0.1,0.04,0)
  578. if j2 ~= nil then
  579. j2.Transparency = j2.Transparency + 0.045
  580. j2.Mesh.Scale = j2.Mesh.Scale + Vector3.new(0.022*2,0.028*2,0.004*2)
  581. j2.Mesh.VertexColor = j2.Mesh.VertexColor - Vector3.new(0.1,0.04,0)
  582. end
  583. end
  584. end
  585.  
  586. ------------------------- Projectiles ------------------------
  587. for i, v in pairs(raytable) do
  588. if v ~= nil and v.className == "Part" then
  589. local posz1 = v.CFrame * CFrame.new(0,0,-2.25)
  590. local ray = Ray.new(posz1.p, posz1.lookVector*-4.5)
  591. local hitz, enz = workspace:FindPartOnRay(ray, char)
  592.  
  593. if hitz ~= nil then
  594. x = Instance.new("Explosion", workspace)
  595. x.Position = enz
  596. raytable[i]:remove()
  597. raytable[i] = nil
  598. end
  599. v.CFrame = v.CFrame - v.CFrame.lookVector*4.5
  600.  
  601. end
  602. end
  603.  
  604.  
  605. wait()
  606. end
  607. end))
Add Comment
Please, Sign In to add comment