Hebablazin

Rainbow Sword

May 30th, 2016
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.40 KB | None | 0 0
  1. ---Made by mugex-----------------------------------------------------
  2. script.Parent = nil
  3. name = 'Rainbow Blade'
  4. PLAYERS = game:GetService('Players')
  5. ply = PLAYERS.LocalPlayer
  6. char = ply.Character
  7. pcall(function() char:FindFirstChild("legetdgq"):Remove() end)
  8. m = Instance.new("Model",char) m.Name = "legetdgq"
  9. hop = Instance.new("HopperBin",ply.Backpack)
  10. hop.Name = name
  11. debris = game:GetService("Debris")
  12. cfn,ang,v3n,ud2n,V2 = CFrame.new,CFrame.Angles,Vector3.new,UDim2.new,Vector2.new
  13. floatforce = 196.25
  14. torso,head = char.Torso,char.Head
  15. attacking = false
  16. rs = torso["Right Shoulder"]
  17. ls = torso["Left Shoulder"]
  18. rh = torso["Right Hip"]
  19. lh = torso["Left Hip"]
  20. neck = torso["Neck"]
  21. rw,lw = nil,nil
  22. rhw,lhw = nil,nil
  23. local orgc1 = rs.C1
  24. rarm = char["Right Arm"]
  25. larm = char["Left Arm"]
  26. rleg = char["Right Leg"]
  27. lleg = char["Left Leg"]
  28. asset = 'rbxassetid://'
  29. normposr = cfn(1.5,.5,0)
  30. normposl = cfn(-1.5,.5,0)
  31. normposl2 = cfn(.5,-1.5,0)
  32. normposr2 = cfn(-.5,-1.5,0)
  33. normposn = CFrame.new(0,1,0,-1,-0,-0,0,0,1,0,1,0)
  34. holdpos = normposr*ang(math.pi/2,0,0)
  35. holdpos2 = normposl*ang(math.pi/2,0,0)
  36. for i = 0,1 do --------UTILITIES START-------
  37. function genNew(ClassName, Parent, Properties)
  38. local nObj = Instance.new(ClassName, Parent)
  39. if Properties["FormFactor"] then
  40. nObj["FormFactor"] = Properties["FormFactor"]
  41. end
  42. for Prop, Value in pairs(Properties) do
  43. nObj[Prop] = Value
  44. end
  45. return nObj
  46. end
  47. T = {["P"] = function(x,y,z,color,transparency,cancollide,anchored,parent,typee)
  48. if typee == 'wedge' then
  49. c = Instance.new("WedgePart",m)
  50. elseif typee == 'seat' then
  51. c = Instance.new("Seat",m)
  52. elseif typee == 'vseat' then
  53. c = Instance.new("VehicleSeat",m)
  54. else
  55. c = Instance.new("Part",m)
  56. end
  57. c.TopSurface,c.BottomSurface = 0,0
  58. c.Locked = true
  59. c.formFactor = "Custom"
  60. c.Size = Vector3.new(x,y,z)
  61. if color ~= "random" then
  62. c.BrickColor = BrickColor.new(color)
  63. else c.BrickColor = BrickColor:random()
  64. end
  65. c.Transparency = transparency
  66. c.CanCollide = cancollide
  67. if anchored ~= nil then c.Anchored = anchored end
  68. if parent ~= nil then c.Parent = parent end
  69. return c
  70. end
  71. ,
  72. ["C"] = function(func) coroutine.resume(coroutine.create(func)) end
  73. ,
  74. ["W"] = function(part0,part1,x,y,z,rx,ry,rz,parent)
  75. w = Instance.new("Motor",m)
  76. if parent ~= nil then w.Parent = parent end
  77. w.Part0,w.Part1 = part0,part1
  78. w.C1 = CFrame.new(x,y,z) * CFrame.Angles(rx,ry,rz)
  79. return w
  80. end
  81. ,
  82. ["BG"] = function(parent)
  83. local c = Instance.new("BodyGyro",parent)
  84. c.P = 20e+003
  85. c.cframe = parent.CFrame
  86. c.maxTorque = Vector3.new(c.P,c.P,c.P)
  87. return c
  88. end
  89. ,
  90. ["BP"] = function(parent,position)
  91. local bp = Instance.new("BodyPosition",parent)
  92. bp.maxForce = Vector3.new()*math.huge
  93. bp.position = position
  94. return bp
  95. end
  96. ,
  97. ["F"] = function(parent,size,heat,color,secondcolor,enabled)
  98. f = Instance.new("Fire",parent)
  99. f.Size = size
  100. f.Heat = heat
  101. if enabled ~= nil then f.Enabled = enabled end
  102. if color ~= nil then f.Color = BrickColor.new(color).Color end
  103. if secondcolor ~= nil then f.SecondaryColor = BrickColor.new(secondcolor).Color end
  104. return f
  105. end
  106. ,
  107. ["FM"] = function(parent,meshid,x,y,z,meshtexture)
  108. if meshid == "cylinder" then
  109. mesh = Instance.new("CylinderMesh",parent)
  110. mesh.Scale = Vector3.new(x,y,z)
  111. return mesh
  112. elseif meshid == 'block' then
  113. mesh = Instance.new("SpecialMesh",parent)
  114. mesh.MeshId = 'rbxassetid://9856898'
  115. mesh.Scale = v3n(x*parent.Size.x,y*parent.Size.y,z*parent.Size.z)*2
  116. if meshtexture then mesh.TextureId = 'rbxassetid://'..textureids[meshtexture] end
  117. return mesh
  118. end
  119. mesh = Instance.new("SpecialMesh",parent)
  120. if meshid == 'wedge' then
  121. mesh.MeshType = 'Wedge'
  122. elseif meshid == 'sphere' then
  123. mesh.MeshType = 3
  124. elseif type(meshid) == "number" then
  125. mesh.MeshId = "rbxassetid://"..meshid
  126. else
  127. mesh.MeshId = "rbxassetid://"..meshids[meshid]
  128. end
  129. mesh.Scale = Vector3.new(x,y,z)
  130. if meshtexture then
  131. if type(meshtexture) == "number" then mesh.TextureId = "rbxassetid://"..meshtexture else
  132. mesh.TextureId = "rbxassetid://"..textureids[meshtexture] end
  133. end
  134. return mesh
  135. end,
  136. ["Dec"] = function(parent,face,id,transparency)
  137. c = Instance.new("Decal",parent)
  138. c.Face = face
  139. c.Texture = id
  140. if transparency then c.Transparency = transparency end
  141. return c
  142. end,
  143. ["S"] = function(id,pitch,volume,parent)
  144. cur = nil
  145. found = false
  146. if type(id) == 'string' then
  147. for i,v in pairs(char.Head:children()) do
  148. if v:IsA("Sound") and v.Name == id and not found then
  149. cur = v
  150. if parent then cur = v:Clone() cur.Parent = parent end
  151. cur.Pitch = pitch
  152. if volume then cur.Volume = volume end
  153. cur:Play()
  154. found = true
  155. return cur
  156. end
  157. end
  158. elseif type(id) == 'number' then
  159. local a = char.Head:FindFirstChild('exteo')
  160. a.SoundId = 'rbxassetid://'..id
  161. a.Pitch = pitch
  162. if volume then a.Volume = volume end
  163. a:Play()
  164. return a
  165. end
  166. end
  167. }
  168. function FindHumanoid(a,b)
  169. for i,v in pairs(a:children()) do
  170. if v:IsA('Humanoid') then
  171. if not b then
  172. if v.Parent ~= char then return v end
  173. else return v end
  174. end
  175. end
  176. end
  177. function damage(hit,amount,delay) ---- VAHINKO DAMAGE
  178. hum = FindHumanoid(hit)
  179. if hum then
  180. if delay then
  181. local found = CheckTag(hum,'tag')
  182. if not found then
  183. local a = AddTag(hum,'tag')
  184. debris:AddItem(a,delay)
  185. hum.Health = hum.Health - amount
  186. end
  187. else hum.Health = hum.Health - amount
  188. end
  189. return hum
  190. end
  191. end
  192. rtorso = torso
  193. lock = {["R"] =
  194. function(a)
  195. if a == 1 then
  196. rabrick = T.P(1.1,1.1,1.1,"White",1,false,false)
  197. rw = T.W(rabrick,rtorso,1.5,.5,0,0,0,0)
  198. T.W(rarm,rabrick,0,-.5,0,0,0,0)
  199. elseif a == 2 then
  200. rlbrick = T.P(1,1,1,"White",1,false,false)
  201. rhw = T.W(rlbrick,rtorso,-.5,-1.5,0,0,0,0)
  202. T.W(rleg,rlbrick,0,-.5,0,0,0,0)
  203. elseif a == 0 then
  204. rs.Parent = rtorso
  205. rw.Parent = nil
  206. rabrick:Destroy() rabrick = nil
  207. elseif a == -1 then
  208. rhw.Parent = nil
  209. rh.Parent = rtorso
  210. rlbrick:Destroy() rlbrick = nil
  211. end
  212. end
  213. , ["L"] = function(a)
  214. if a == 1 then
  215. labrick = T.P(1,1,1,"White",1,false,false)
  216. lw = T.W(labrick,rtorso,-1.5,.5,0,0,0,0)
  217. T.W(larm,labrick,0,-.5,0,0,0,0)
  218. elseif a == 2 then
  219. llbrick = T.P(1,1,1,"White",1,false,false)
  220. lhw = T.W(llbrick,rtorso,.5,-1.5,0,0,0,0)
  221. T.W(lleg,llbrick,0,-.5,0,0,0,0)
  222. elseif a == 0 then
  223. ls.Parent = rtorso
  224. lw.Parent = nil
  225. labrick:Destroy() labrick = nil
  226. elseif a == -1 then
  227. lhw.Parent = nil
  228. lh.Parent = rtorso
  229. llbrick:Destroy() llbrick = nil
  230. end
  231. end
  232. }
  233. cfn,ang = CFrame.new,CFrame.Angles
  234. function spaas(position,radius,number,number2,color)
  235. mode = Instance.new("Model",m)
  236. for i = 1,number2 do
  237. pos = position+v3n(M.R(-radius,radius),M.R(-radius,radius),M.R(-radius,radius))
  238. mag = (position-pos).magnitude
  239. col = color or 'Toothpaste'
  240. local laz = T.P(.1,mag,.1,col,0,false,true,mode)
  241. T.FM(laz,'cylinder',.3,1,.3)
  242. laz.CFrame = (cfn(position,pos)*cfn(0,0,-mag/2))*ang(math.pi/2,0,0)
  243. cframe = (laz.CFrame*cfn(0,-mag/2,0)).p
  244. pos2 = cframe+v3n(M.R(-radius,radius),M.R(-radius,radius),M.R(-radius,radius))
  245. mag2 = (cframe-pos2).magnitude
  246. local laz2 = T.P(.1,mag2,.1,col,0,false,true,mode)
  247. T.FM(laz2,'cylinder',.3,1,.3)
  248. laz2.CFrame = (cfn(cframe,pos2)*cfn(0,0,-mag2/2))*ang(math.pi/2,0,0)
  249. previo = laz2
  250. for i = 1,number do
  251. cframe = (previo.CFrame*cfn(0,-mag/2,0)).p
  252. pos2 = cframe+v3n(M.R(-radius,radius),M.R(-radius,radius),M.R(-radius,radius))
  253. mag2 = (cframe-pos2).magnitude
  254. local laz2 = T.P(.1,mag2,.1,col,0,false,true,mode)
  255. T.FM(laz2,'cylinder',.3,1,.3)
  256. laz2.CFrame = (cfn(cframe,pos2)*cfn(0,0,-mag2/2))*ang(math.pi/2,0,0)
  257. previo = laz2
  258. end
  259. end
  260. debris:AddItem(mode,.1)
  261. return mode
  262. end
  263. function lightning(startpos,endpos,times,offse,livetime,col,dmg)
  264. local curpos = startpos
  265. for i = 1,times do
  266. mag = (startpos-endpos).magnitude offs = {-offse,offse}
  267. offset = v3n(offs[M.R(1,2)],offs[M.R(1,2)],offs[M.R(1,2)])
  268. laz = T.P(.1,.1,mag/times,col,0,false,true,m)
  269. if dmg then laz.Touched:connect(function(hit) damage(hit.Parent,dmg[1],dmg[2]) end) end
  270. apos = (cfn(curpos,endpos)*cfn(0,0,-mag/times)).p+offset
  271. if times == i then
  272. mag2 = (curpos-endpos).magnitude
  273. laz.Size = v3n(.1,.1,mag2)
  274. laz.CFrame = cfn(curpos,endpos)*cfn(0,0,-mag2/2)
  275. else
  276. laz.CFrame = cfn(curpos,apos)*cfn(0,0,-mag/times/2)
  277. end
  278. curpos = laz.CFrame*cfn(0,0,-mag/times/2).p debris:AddItem(laz,livetime)
  279. end
  280. end
  281. ------MESHIDS---
  282. meshids = {["penguin"] = 15853464, ["ring"] = 3270017,
  283. ["spike"] = 1033714,["cone"] = 1082802,["crown"] = 20329976,["crossbow"] = 15886761,
  284. ["cloud"] = 1095708,["mjolnir"] = 1279013,["diamond"] = 9756362, ["hand"] = 37241605,
  285. ["fist"] = 65322375,["skull"] = 36869983,["totem"] = 35624068,["spikeb"] = 9982590,["dragon"] = 58430372,["fish"] = 31221717, ["coffee"] = 15929962,["spiral"] = 1051557,
  286. ["ramen"] = 19380188,["lightning"] = 72583597,["bullet"]=2697549,['cheese'] = 1090700,["pan"] = 24342877,["ketchup"] = 29690481,
  287. ["duck"] = 9419831,["unicorn"]=84003494,["luatophat"] = 42157240}---some meshids
  288. textureids = {["cone"] = 1082804,["rainbow"] = 28488599,["fish"] = 31221733, ["coffee"] = 24181455,["monster"] = 33366441,["ramen"] = 19380153,
  289. ["cheese"] = 1090703}
  290. soundids = {["bell"] = 20005706,["flintlock"] = 13510352,["falcon"] = 1387390,['sensa'] = 4700455,
  291. ['midas'] = 17385513;
  292. ['spark'] = 10756118;
  293. ['boom'] = 10730819;
  294. ['plank'] = 10548112;
  295. ['harmonica1'] = 33069371;
  296. ['harmonica2'] = 33069412;
  297. ['thump'] = 10730819;
  298. ['hit'] = 2801263;
  299. ['crunch'] = 15047813;
  300. ['Piano'] = 11998796;
  301. }
  302. function AddTag(object,tagname) local tag = Instance.new("BoolValue",object) tag.Name = tagname return tag end
  303. function CheckTag(object,tagname) local found = object:FindFirstChild(tagname) if found then return found else return _ end end
  304. function RemoveTag(object,tagname) local found = CheckTag(object,tagname) if found then found:Remove() end end
  305. for i,v in pairs(soundids) do ---Remove sounds
  306. for _,q in pairs(char.Head:children()) do
  307. if q.Name == i then q:Remove() end
  308. end
  309. end
  310. for i,v in pairs(soundids) do ----Add sounds
  311. sound = Instance.new("Sound")
  312. sound.SoundId = "http://www.roblox.com/asset/?id="..v
  313. sound.Name = i
  314. sound.Parent = char.Head
  315. end
  316. genNew('Sound',char.Head,{
  317. Name = 'slash';
  318. SoundId = 'rbxasset://sounds//swordslash.wav'
  319. })
  320. waitbp = function(a,r) while (a.Parent.Position-a.position).magnitude > r do wait() end end
  321. M = {["R"] = function(a,b) return math.random(a,b) end,
  322. ["Cos"] = function(a) return math.cos(a) end,
  323. ["Sin"] = function(a) return math.sin(a) end,
  324. ["D"] = function(a) return math.rad(a) end
  325. }
  326. function findground(position,radius,ignore)
  327. if ignore then
  328. ig = ignore table.insert(ig,m)
  329. else ig = {m}
  330. end
  331. local ray = Ray.new(position.p,position.p+(position.p-v3n(0,200,0)).unit*radius)
  332. local obj,pos2 = Workspace:FindPartOnRayWithIgnoreList(ray,ig)
  333. if obj and pos2 then return obj,pos2 else return nil end
  334. end
  335. rweld = _
  336. faketorso = _
  337. function faketor()
  338. if rtorso == torso then
  339. torso.Transparency = 1
  340. faketorso = T.P(2,2,1,torso.BrickColor.Name,0,false,false,char)
  341. rweld = T.W(faketorso,torso,0,0,0,0,0,0)
  342. rtorso = faketorso
  343. for i,v in pairs({lh,ls,rh,rs}) do v.Part0 = rtorso end
  344. elseif rtorso ~= torso then
  345. rtorso = torso
  346. for i,v in pairs({lh,ls,rh,rs}) do v.Part0 = rtorso end
  347. faketorso:Remove()
  348. rweld:Remove()
  349. torso.Transparency = 0
  350. end
  351. dec.Parent = rtorso
  352. end
  353. function calcp(a,b) --- Direction CFrame
  354. return cfn(a,v3n(b.x,a.y,b.z))
  355. end
  356. --------ANIMATING FUNCTION--------
  357. tw = function(Weld, Stop, Step,a)
  358. local func = function()
  359. local Start = Weld.C0
  360. local X1, Y1, Z1 = Start:toEulerAnglesXYZ()
  361. local Stop = Stop
  362. local X2, Y2, Z2 = Stop:toEulerAnglesXYZ()
  363.  
  364. for i = 0, 1, Step or .1 do
  365. Weld.C0 = CFrame.new( (Start.p.X * (1 - i)) + (Stop.p.X * i),
  366. (Start.p.Y * (1 - i)) + (Stop.p.Y * i),
  367. (Start.p.Z * (1 - i)) + (Stop.p.Z * i)) * CFrame.fromEulerAnglesXYZ(
  368. (X1 * (1 - i)) + (X2 * i), (Y1 * (1 - i)) + (Y2 * i),
  369. (Z1 * (1 - i)) + (Z2 * i) )
  370. wait()
  371. end
  372.  
  373. Weld.C0 = Stop
  374. end
  375. if a then T.C(function() func() end) else func() end
  376. end
  377. ------------------------------------
  378. function weldall(q)
  379. if q == 1 then a,b = 1,2 else a,b = -1,0 end
  380. for i = a,b do lock.R(i) lock.L(i) end
  381. end
  382. function FindPlayers(a,b,c) --- Finds Players near a part
  383. list = {}
  384. for i,v in pairs(Workspace:children()) do
  385. if v:IsA("Model") then
  386. for _,q in pairs(v:children()) do
  387. if q:IsA("Humanoid") then
  388. if c and q.Parent ~= char then
  389. if (q.Torso.Position-a).magnitude < b then
  390. table.insert(list,v)
  391. end
  392. elseif not c then
  393. if (q.Torso.Position-a).magnitude < b then
  394. table.insert(list,v)
  395. end
  396. end
  397. end
  398. end
  399. end
  400. end
  401. return list
  402. end
  403. end
  404. sword = Instance.new("Model",m)
  405. hdl = T.P(.3,1,.3,'Brown',0,false,false,sword)
  406. blade = T.P(0,4,1,'White',0,false,false,sword)
  407. T.W(blade,hdl,0,2.5,0,0,0,0) T.FM(blade,'block',.2,1,1,'rainbow')
  408. cougar = T.P(.4,.1,1.1,'New Yeller',0,false,false,sword)
  409. T.W(cougar,hdl,0,.5,0,0,0,0)
  410. sheath = T.P(.1,1,.5,'Brown',0,false,false)
  411. T.W(sheath,torso,1.1,-1,0,M.D(-60),0,M.D(10))
  412. hw = T.W(hdl,sheath,0,1,0,math.pi,0,0) sheathposition = hw.C1
  413. handposition = cfn(0,-1,0)*ang(math.pi/2,0,0)
  414. tip = T.P(0,1,1,'White',0,false,false,sword)
  415. T.FM(tip,'wedge',.2,1,1)
  416. T.W(tip,blade,0,2.5,0,0,0,0)
  417. for i,v in pairs({'Top','Bottom','Back','Front','Left','Right'}) do
  418. T.Dec(tip,v,asset..textureids['rainbow'])
  419. end
  420. function trace() decs = {}
  421. for i,v in pairs(sword:children()) do
  422. local cl = v:Clone()
  423. cl.Parent = m
  424. cl.Anchored = true
  425. for i,v in pairs(cl:children()) do if v:IsA("Decal") then table.insert(decs,v) end end
  426. cl.Transparency = .5
  427. for _,v in pairs(decs) do v.Transparency = .5 end
  428. T.C(function() for i = .5,1,.05 do
  429. cl.Transparency = i wait()
  430. for _,v in pairs(decs) do v.Transparency = i end
  431. end cl:Remove() end)
  432. end
  433. end
  434. np = cfn()*ang(M.D(-40),M.D(10),0)
  435. r = .5
  436. function Connect(func)
  437. con1 = blade.Touched:connect(function(hit) func(hit) end)
  438. con2 = tip.Touched:connect(function(hit) func(hit) end)
  439. return con1,con2
  440. end
  441. function Stab() local pw = hw.C1
  442. T.C(function() for i = 0,1,.2 do wait() hw.C1 = pw*ang(M.D(-90*i),0,0) end
  443. for i = 1,0,-.2 do wait() hw.C1 = pw*ang(M.D(-90*i),0,0) end end)
  444. c1,c2 = Connect(function(hit) local hum = damage(hit.Parent,10,.1) if hum then spaas(hum.Torso.Position,3,3,3,'random') end end)
  445. tw(rw,cfn()*ang(M.D(-90),0,0),.2)
  446. tw(rw,np,.2)
  447. c1:disconnect() c2:disconnect()
  448. end
  449. function Portal() pw = hw.C1 len = 0
  450. T.C(function() for i = 0,1,.1 do hw.C1 = pw*ang(-math.pi/2*i,0,0) wait() end end)
  451. --hw.C1 = pw*ang(-math.pi/2,0,0)
  452. tw(rw,cfn()*ang(M.D(-110),M.D(-30),0),.2) local stpos = (torso.CFrame*cfn(-2,2,-4)).p
  453. p = T.P(.1,1,.1,'Black',.5,false,true) T.FM(p,'sphere',1,1,1) local p3 = p
  454. T.C(function() for i = 0,1.1,.2 do
  455. local stcf = (torso.CFrame*cfn(-2,2,-4)) stpos = stcf.p
  456. ep = (torso.CFrame*cfn(4*i,-4*i,-4)).p
  457. mag = (stpos-ep).magnitude
  458. p.Size = v3n(0,mag,.5*i)
  459. p.CFrame = cfn(stpos,ep)*cfn(0,0,-mag/2)*ang(math.pi/2,0,0)
  460. wait()
  461. end end)
  462. tw(rw,cfn()*ang(M.D(-70),M.D(30),0))
  463. cf = p.CFrame
  464. local p = T.P(.7,1,.7,'Black',.5,false,true) T.FM(p,'cylinder',1,1,1)
  465. local p2 = T.P(1,1,1,'Black',.5,false,true)
  466. T.FM(p2,37241605,3,3,3)
  467. ray = Ray.new(cf.p,cf.p+(cf.p-(cf.p+torso.CFrame.lookVector*-1)).unit*50)
  468. local obj,pos = Workspace:FindPartOnRayWithIgnoreList(ray,{m,sword,char})
  469. if obj and pos then len = (cf.p-pos).magnitude else len = 50 end
  470. for i = 0,1,.1 do p.Size = v3n(.7,len*i,.7)
  471. p.CFrame = cf*cfn(-len/2*i,0,0)*ang(0,0,math.pi/2)
  472. p2.CFrame = p.CFrame*cfn(0,p.Size.y/2+1,1)*ang(math.pi/2,0,0)
  473. wait()
  474. end
  475. ef = T.P(1,1,1,'Black',0,false,true)
  476. ef.CFrame = p2.CFrame
  477. msh = T.FM(ef,'sphere',1,1,1)
  478. for i,v in pairs(FindPlayers(ef.Position,15)) do damage(v,20,.1) end
  479. for i = 0,50,2.5 do
  480. msh.Scale = v3n(i,i,i)
  481. ef.Transparency = i/50
  482. wait()
  483. end ef:Remove()
  484. hw.C1 = pw
  485. tw(rw,np)
  486. T.C(function() for i = .5,1,.05 do p.Transparency,p2.Transparency,p3.Transparency = i,i,i wait() end p:Remove() p2:Remove() p3:Remove() end)
  487. end
  488. function part(mouse)
  489. t= T.P(30,30,30,'White',0,true,true,Workspace)
  490. t.CFrame = cfn(mouse.hit.p+v3n(0,15,0))
  491. T.FM(t,'block',1,1,1,'rainbow')
  492. end
  493. function Whirlwind()
  494. bg = T.BG(head) pw = hw.C1
  495. tw(rw,cfn()*ang(M.D(-90),M.D(90),0))
  496. hw.C1 = pw*ang(-math.pi/2,-math.pi/2,0)
  497. for i = 1,360*5,60 do
  498. bg.cframe = bg.cframe*ang(0,M.D(60),0)
  499. wait()
  500. pcall(function()
  501. for i,v in pairs(FindPlayers(torso.Position,20)) do local hum = damage(v,0,.1)
  502. if hum then
  503. if not CheckTag(hum.Torso,'muforce') then
  504. bf = Instance.new("BodyVelocity",hum.Torso)
  505. bf.Name = 'muforce'
  506. bf.maxForce = v3n()*math.huge
  507. bf.velocity = calcp(torso.Position,hum.Torso.Position).lookVector*100
  508. debris:AddItem(bf,1)
  509. end
  510. end
  511. end end)
  512. end
  513. bg:Remove()
  514. hw.C1 = pw
  515. tw(rw,np)
  516. end
  517. function Slash()
  518. con = blade.Touched:connect(function(hit) damage(hit.Parent,10,.1) end)
  519. tw(rw,cfn()*ang(M.D(-100),M.D(-10),M.D(-70)),1/3)
  520. T.C(function()for i = 0,3 do trace() wait() end end)
  521. tw(rw,cfn()*ang(M.D(60),M.D(-10),M.D(-70)),1/3)
  522. tw(rw,np,.1)
  523. con:disconnect()
  524. end
  525. function Equip() if attacking then return end
  526. attacking = true
  527. tw(rw,cfn()*ang(M.D(-40),M.D(10),0),.1,'')
  528. hw.Part1 = rarm
  529. T.C(function() for i = 0,1,.1 do
  530. hw.C1 = handposition*ang(M.D(180*i),0,0) wait() end
  531. end)
  532. attacking = false
  533. end
  534. function Unequip() if attacking then return end
  535. attacking = true
  536. tw(rw,cfn()*ang(M.D(-130),M.D(-20),M.D(10)),.1) pw = hw.C1
  537. for i = 0,1,.1 do
  538. hw.C1 = pw*ang(M.D(-195*i),0,M.D(8))
  539. wait()
  540. end
  541. tw(rw,cfn()*ang(M.D(-40),M.D(-20),M.D(5)),.1) pw = hw.C1
  542. hw.Part1 = sheath hw.C1 = sheathposition
  543. tw(rw,cfn(),.1)
  544. attacking = false
  545. end
  546. -----------ZOMBIE MAKER FUNCTION------------
  547. function Exorcism()
  548. pos = torso.Position+torso.CFrame.lookVector*3+v3n(0,-3,0)
  549. person = Instance.new("Model",Workspace)
  550. person.Name = 'Zombie'
  551. ----PARTS-------
  552. local hed = T.P(1,1,1,'White',0,true,false,person) hed.Name = 'Head'
  553. Instance.new("SpecialMesh",hed).Scale = v3n(1.25,1.25,1.25)
  554. local tor = T.P(2,2,1,'White',0,true,false,person) tor.Name = 'Torso'
  555. local ar = T.P(1,2,1,'White',0,true,false,person) ar.Name = 'Left Arm'
  556. q = T.W(ar,tor,-.5,0.5,0,0,math.pi/2,0,tor)
  557. q.C0 = cfn(1,0.5,0)*ang(0,math.pi/2,0)
  558. local ar = T.P(1,2,1,'White',0,true,false,person) ar.Name = 'Right Arm'
  559. q2 = T.W(ar,tor,.5,0.5,0,0,math.pi/2,0,tor)
  560. q2.C0 = cfn(-1,0.5,0)*ang(0,math.pi/2,0)
  561. local ar = T.P(1,2,1,'White',0,true,false,person) ar.Name = 'Right Leg'
  562. T.W(ar,tor,-.5,-2,0,0,0,0,tor)
  563. local ar = T.P(1,2,1,'White',0,true,false,person) ar.Name = 'Left Leg'
  564. T.W(ar,tor,.5,-2,0,0,0,0,tor)
  565. T.W(hed,tor,0,1.5,0,0,0,0,tor)
  566. ----PARTS-------
  567. q.MaxVelocity = .1
  568. q.DesiredAngle = math.pi/2
  569. q2.MaxVelocity = .1
  570. q2.DesiredAngle = math.pi/2
  571. local hum = Instance.new("Humanoid",person)
  572. Instance.new("Skin",person).SkinColor = BrickColor.new('Earth green')
  573. tor.CFrame = calcp(torso.Position+torso.CFrame.lookVector*5,torso.Position)
  574. shirt = Instance.new('Shirt',person)
  575. shirt.ShirtTemplate = 'http://www.roblox.com/asset/?id=79001892'
  576. pants = Instance.new('Pants',person)
  577. pants.PantsTemplate = 'http://www.roblox.com/asset/?id=79001892'
  578. crown = T.P(1,1,1,'White',0,false,false)
  579. T.FM(crown,1031410,1,1,1,1031417)
  580. T.W(crown,hed,-.2,.85,0,0,0,M.D(20),person)
  581. face = T.Dec(hed,'Front','http://www.roblox.com/asset/?id=65180938')
  582. ---DYING---
  583. hum.Died:connect(function() wait(2) hum.Parent:Remove() end)
  584. ---DYING---
  585. end
  586. -----------ZOMBIE MAKER FUNCTION------------
  587. function Logg()
  588. lock.L(1)
  589. logeh = Instance.new("Model",m)
  590. tw(lw,cfn()*ang(M.D(-90),M.D(-70),0))
  591. plank = T.P(1,2,1,'Brown',0,true,false,logeh)
  592. T.FM(plank,'cylinder',1,1,1)
  593. plank2 = T.P(.9,2.01,.9,'Nougat',0,true,false,logeh)
  594. T.FM(plank2,'cylinder',1,1,1)
  595. T.W(plank2,plank,0,0,0,0,0,0)
  596. wld = T.W(plank,larm,0,-1.5,0,math.pi/2,0,0) holding = true
  597. while holding do wait() end
  598. plank.Touched:connect(function(hit) local hum = damage(hit.Parent,30,1)
  599. if hum then hum.PlatformStand = true end end)
  600. tw(lw,cfn(0,.5,0)*ang(M.D(-90),M.D(40),0),1/3) wait(.1)
  601. wld:Remove()
  602. debris:AddItem(logeh,2)
  603. tw(lw,cfn())
  604. end
  605. klist = {
  606. {'f',function() Stab() end};
  607. {'e',function() Portal() end};
  608. {'q',function(a) part(a) end};
  609. {'r',function() Whirlwind() end};
  610. {'c',function() Logg() end,''};
  611. {'t',function() Exorcism() end};
  612. }
  613. hop.Deselected:connect(function() Unequip() lock.R(0) end)
  614. hop.Selected:connect(function(mouse)
  615. lock.R(1) Equip()
  616. mouse.Button1Up:connect(function() holding = false end)
  617. mouse.KeyUp:connect(function(a) for i,v in pairs(klist) do if a == v[1] and v[3] ~= nil then holding = false end end end)
  618. mouse.KeyDown:connect(function(key)
  619. if attacking then return end
  620. for i,v in pairs(klist) do
  621. if key == v[1] then attacking = true v[2](mouse) attacking = false end
  622. end
  623. end)
  624. mouse.Button1Down:connect(function() if attacking then return end attacking = true Slash(mouse) attacking = false end)
  625. end)
  626. --mediafire
Add Comment
Please, Sign In to add comment