Advertisement
memberhero

Rainbow Blade Script Test

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