Advertisement
nicholasXPG

Untitled

Oct 8th, 2016
5,128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.32 KB | None | 0 0
  1. players = game:GetService("Players")
  2. player = players.LocalPlayer
  3. character = player.Character
  4. torso = character.torso
  5. head = character.head
  6. neck=torso.Neck
  7.  
  8. cfn,v3n=CFrame.new,Vector3.new
  9. bcol=BrickColor.new
  10. mr,md = math.random,math.rad
  11.  
  12. JointsService = game:GetService("JointsService")
  13. RS = game:GetService("RunService")
  14. Tester = game:GetService("TestService")
  15. Debris = game:GetService("Debris")
  16. InputService = game:GetService("UserInputService")
  17. PathService = game:GetService("PathfindingService")
  18.  
  19. hum_root=character:FindFirstChild "HumanoidRootPart"
  20. torw=hum_root:FindFirstChild "RootJoint"
  21.  
  22. PI=math.pi
  23.  
  24. do --utilities
  25.  
  26. function tag(a,b)
  27. if type(b)=='string'then
  28. if not getfenv()[b]then
  29. getfenv()[b]={}
  30. end
  31. table.insert(getfenv()[b],a)
  32. else
  33. table.insert(b,a)
  34. end
  35. end
  36.  
  37. c=function(...)
  38. local args={...}
  39. if #args > 0 and type(args[1]) == 'number' then
  40. local x,y,z=args[1],args[2],args[3]
  41. local rx,ry,rz=args[4],args[5],args[6]
  42. if x or y or z then
  43. if rx or ry or rz then
  44. return CFrame.new(x or 0,y or 0,z or 0)*CFrame.Angles(
  45. rx or 0,ry or 0,rz or 0)
  46. else
  47. return CFrame.new(x or 0,y or 0,z or 0)
  48. end
  49. end
  50. else
  51. return CFrame.new(...)
  52. end
  53. end
  54.  
  55. a=function(rx,ry,rz)return CFrame.Angles(rx or 0,ry or 0,rz or 0)end
  56.  
  57. if not hum_root then
  58. error("Cant run. Ya dunt have humanoidrootpart")
  59. elseif not torso then
  60. error("No torso found")
  61. end
  62.  
  63. torw=hum_root.RootJoint
  64.  
  65. function C(what)
  66. return function(bar)
  67. local obj=Instance.new(what)
  68. for arg,val in pairs(bar) do
  69. if arg == "_P" then
  70. obj.Parent = val
  71. else
  72. if obj[arg] then
  73. obj[arg]=val
  74. end
  75. end
  76. end
  77. return obj
  78. end
  79. end
  80.  
  81. pcall(function() character.Uniiq:Destroy() end)
  82.  
  83. Main=Instance.new("Model",character)
  84. Main.Name="Uniiq"
  85. m={}
  86. m.tau=math.tau
  87.  
  88. _1,_2,_3=nil,nil,nil ---Buffer
  89.  
  90. function l(a1,x,y,z,rx,ry,rz)
  91. local cf
  92. if tostring(a1):find(',') == nil then
  93. cf=a1.CFrame
  94. else cf=a1 end
  95. return cf*CFrame.new(x or 0,y or 0,z or 0)*CFrame.Angles(
  96. rx or 0,ry or 0,yz or 0)
  97. end
  98.  
  99. set_material=nil
  100. set_color=nil
  101. set_anchor=false
  102. set_collide=false
  103. set_parent=nil
  104.  
  105.  
  106. Sounds={
  107. Fire = {2248511,1};
  108. Steam = 291165237;
  109. Teleport = 12555594;
  110. Laser = {156572165;2.15};
  111. Slash2 = 182707266;
  112. Grapple = 16211041;
  113. Grapple_hit = 16211030;
  114. Spin = 158475221;
  115. Slash= {'rbxasset://sounds/swordslash.wav',1.25};
  116. }
  117. pcall(function()Main.Sounds:Destroy()end)
  118. soundCont=C'Folder'{_P=Main;Name='Sounds'}
  119. for i,v in pairs(Sounds)do
  120. local pitch=1
  121. if type(v)=='table' and v[2]then
  122. pitch=v[2]
  123. end
  124. local snd=C'Sound'{_P=soundCont;
  125. Name=i;
  126. SoundId='rbxassetid://'..tostring((type(v)=='table'and v[1] or v));
  127. Pitch=pitch
  128. }
  129. if type(type(v)=='table'and v[1] or v)=='string'then
  130. snd.SoundId=type(v)=='table'and v[1] or v
  131. end
  132. Sounds[i]=snd
  133. end
  134.  
  135. -- Sounds.Laser.Looped=true
  136. Sounds.Spin.Looped=true
  137.  
  138. function debounce(func)
  139. local isRunning = false -- Create a local debounce variable
  140. return function(...) -- Return a new function
  141. if not isRunning then
  142. isRunning = true
  143.  
  144. func(...) -- Call it with the original arguments
  145.  
  146. isRunning = false
  147. end
  148. end
  149. end
  150.  
  151. function P(x,y,z,col,tr)
  152. local part = Instance.new("Part",set_parent or Main)
  153. part.Position=torso.Position
  154. part.Anchored=set_anchor or false
  155. part.Size=Vector3.new(x,y,z)
  156. for i,v in pairs(Enum.NormalId:GetEnumItems()) do
  157. part[v.Name..'Surface'] = 10
  158. end
  159. part.BrickColor=BrickColor.new(col or set_color or "")
  160. part.CanCollide=set_collide or false
  161. part.Material=(set_material or 'SmoothPlastic')
  162. part.Transparency=tr or 0
  163. _1=part
  164. return part
  165. end
  166. _3=nil
  167. function W(part0,part1,c1,c0)
  168. local w = Instance.new("Motor6D",part0)
  169. w.Part0 = part0
  170. w.Part1 = part1
  171.  
  172. if c0 then
  173. w.C0 = c0
  174. end
  175. if c1 then
  176. w.C1 = c1
  177. end
  178. w.MaxVelocity=.1
  179. _3=w
  180. return w
  181. end
  182. function W2(part0,part1,c1,c0)
  183. local w = Instance.new("Weld",part0)
  184. w.Part0 = part0
  185. w.Part1 = part1
  186.  
  187. if c0 then
  188. w.C0 = c0
  189. end
  190. if c1 then
  191. w.C1 = c1
  192. end
  193. return w
  194. end
  195.  
  196. M_List = {Diamond='9756362';Spikeball='9982590';Table='111868131';
  197. Egg='1527559';Ring='3270017';Bullet='2697549';Grass='1080954';
  198. Shark='82821384';Sword='12221720';Crown='10688643';Spike='1033714';
  199. Leaf='48100239';Fist='65322375';Chakram='19251107';Crown='20329976';Spring='9753878';
  200. Tree='8564125';Fireball='10587413';DiamondBall='10917418';Hand='32054761'}
  201.  
  202. function M(part,mesh_type,x,y,z)
  203. local aliases={
  204. c='Cylinder'; b='Brick'; s='Sphere';
  205. h='Head'; w='Wedge';
  206. }
  207. local mesh = Instance.new("SpecialMesh",part or nil)
  208. local selec = aliases[mesh_type]
  209. if selec ~= nil then
  210. mesh.MeshType = selec
  211. if selec=="Cylinder"then
  212. mesh:Destroy()
  213. mesh=Instance.new("CylinderMesh",part or nil)
  214. end
  215. else
  216. local found=false
  217. for i,v in pairs((M_List or {})) do
  218. if mesh_type==i then
  219. mesh.MeshId="rbxassetid://"..v
  220. found=true
  221. break
  222. end
  223. end
  224. if not found then
  225. mesh.MeshId='rbxassetid://'..tostring(mesh_type)
  226. end
  227. end
  228. mesh.Scale=Vector3.new(x or 1,y or 1,z or 1)
  229. _2=mesh
  230. return mesh
  231. end
  232.  
  233.  
  234.  
  235. function findHum(pos,rad)
  236. local hums={}
  237. function check(a)
  238. local res=false
  239. for i,ho in pairs(hums)do
  240. if a==ho then res=true end
  241. end
  242. return res
  243. end
  244. for i,v in pairs(Workspace:children())do
  245. if v:IsA'Model' and v:FindFirstChild'muge'==nil and v~=character then
  246. for i,q in pairs(v:children())do
  247. if q:IsA'Humanoid' and q.Torso and q.Health > 0 then
  248. if (q.Torso.Position-pos).magnitude < rad then
  249. if not check(q)then
  250. table.insert(hums,q)
  251. end
  252. end
  253. end
  254. end
  255. end
  256. end
  257. return hums
  258. end
  259.  
  260. function E(foo)
  261. local tab = {}
  262. if type(foo) == "table" then
  263. tab = foo
  264. elseif type(foo) == "userdata" then
  265. if foo:IsA'Model'then
  266. for i,v in pairs(foo:children())do
  267. table.insert(tab,v)
  268. end
  269. else
  270. table.insert(tab,foo)
  271. end
  272. end
  273. return function(bar)
  274. for _,obj in pairs(tab) do
  275. for arg,val in pairs(bar) do
  276. if arg == '_F'then
  277. val(obj)
  278. end
  279. local succes=pcall(function()return obj[arg]end)
  280. if succes then
  281. obj[arg] = val
  282. end
  283. end
  284. end end
  285. end
  286.  
  287. function G(obj,val2)
  288. local val=(val2 or 'Size')
  289. return unpack{obj[val].x,obj[val].y,obj[val].z}
  290. end
  291. end
  292.  
  293. do --animsystem
  294. desired=nil
  295. WeldInfo={
  296. rw = {n_c0=cfn(1,0.5,0),n_c1=cfn(-.5,0.5,0)};
  297. lw = {n_c0=cfn(-1,0.5,0),n_c1=cfn(0.5,0.5,0)};
  298. rw2 = {n_c0=cfn(1,-1,0),n_c1=cfn(0.5,1,0)};
  299. lw2 = {n_c0=cfn(-1,-1,0),n_c1=cfn(-0.5,1,0)};
  300. torw = {n_c0=cfn(0,0,0,-1,0,0,0,0,1,0,1,-0);
  301. n_c1=cfn(0,0,0,-1,-0,-0,0,0,1,0,1,0)};
  302. neck = {n_c0=cfn(0,1,0,-1,-0,-0,0,0,1,0,1,0)};
  303. hw = {n_c0=cfn()};
  304. }
  305. spd={rw=.1;lw=.1;torw=.1;rw2=.1;lw2=.1;neck=.1;hw=.1}
  306. setmetatable(spd,{__newindex=function(t,i,v)
  307. if i=='all'then
  308. for o,q in pairs(spd)do
  309. t[o]=v
  310. end
  311. end
  312. end})
  313.  
  314. Spawn(function()
  315. while true do
  316. RS.Stepped:wait()
  317. if rw then
  318. rw.C0 = rw.C0:lerp((WeldInfo.rw.desired or WeldInfo.rw.n_c0),spd.rw)
  319. end
  320. if lw then
  321. lw.C0 = lw.C0:lerp((WeldInfo.lw.desired or WeldInfo.lw.n_c0),spd.lw)
  322. end
  323. if lw2 then
  324. lw2.C0 = lw2.C0:lerp((WeldInfo.lw2.desired or WeldInfo.lw2.n_c0),spd.lw2)
  325. end
  326. if rw2 then
  327. rw2.C0 = rw2.C0:lerp((WeldInfo.rw2.desired or WeldInfo.rw2.n_c0),spd.rw2)
  328. end
  329. if neck then
  330. neck.C0 = neck.C0:lerp((WeldInfo.neck.desired or WeldInfo.neck.n_c0),spd.neck)
  331. end
  332. if torw then
  333. torw.C0 = torw.C0:lerp(WeldInfo.torw.desired or WeldInfo.torw.n_c0,spd.torw)
  334. end
  335. if hw then
  336. hw.C0 = hw.C0:lerp(WeldInfo.hw.desired or WeldInfo.hw.n_c0,spd.hw)
  337. end
  338. end
  339. end)
  340.  
  341. function A(foo)
  342. return function(bar)
  343. if WeldInfo[foo] == nil then
  344. warn("Animfunc didn't find info")
  345. return
  346. end
  347. WeldInfo[foo].desired=WeldInfo[foo].n_c0*bar
  348. end
  349. end
  350.  
  351. Arms={character['Right Arm'];character['Left Arm']}
  352. Legs={character['Right Leg'];character['Left Leg']}
  353. Shoulders={torso['Right Shoulder'];torso['Left Shoulder']}
  354. Hips={torso['Right Hip'];torso['Left Hip']}
  355.  
  356. rw,lw,rw2,lw2=nil,nil,nil,nil
  357. function L(val)
  358. if val=='R' then if not rw then
  359. Shoulders[1].Part1=nil
  360. rw=W2(torso,Arms[1],WeldInfo.rw.n_c1,WeldInfo.rw.n_c0)
  361. -- rw.MaxVelocity=0
  362. else rw:Destroy()rw=nil Shoulders[1].Part1=Arms[1] end
  363. elseif val=='L' then if not lw then
  364. Shoulders[2].Part1=nil
  365. lw=W2(torso,Arms[2],WeldInfo.lw.n_c1,WeldInfo.lw.n_c0)
  366. -- rw.MaxVelocity=0
  367. else lw:Destroy()lw=nil Shoulders[2].Part1=Arms[2] end
  368. elseif val=='RR' then if not rw2 then
  369. Hips[1].Part1=nil
  370. rw2=W2(torso,Legs[1],WeldInfo.rw2.n_c1,WeldInfo.rw2.n_c0)
  371. -- rw.MaxVelocity=0
  372. else rw2:Destroy()rw2=nil Hips[1].Part1=Legs[1] end
  373. elseif val=='LL' then if not lw2 then
  374. Hips[2].Part1=nil
  375. lw2=W2(torso,Legs[2],WeldInfo.lw2.n_c1,WeldInfo.lw2.n_c0)
  376. -- rw.MaxVelocity=0
  377. else lw2:Destroy()lw2=nil Hips[2].Part1=Legs[2] end
  378. end
  379. end
  380.  
  381.  
  382. end
  383.  
  384. RS=game:service'RunService'
  385.  
  386. mouse=player:GetMouse()
  387.  
  388. hdl = P(.25,1,.25)M(hdl,'c')hw=W(hdl,Arms[1],c(0,-1.1,0,-PI/2))
  389. p=P(.3,.1,.3)W(p,hdl,c(0,-.55))M(p,'c')tip=p
  390.  
  391. P(.3,.1,.3,'New Yeller')M(_1,'s',1,.25,1)W(_1,p,c(0,.1)) --yellow sphere
  392.  
  393. p2=P(.3,.1,.3,'Black')W(_1,p)M(_1,'c',1.01,.5,1.01) --black rim
  394.  
  395. r=P(.1,.1,.1,'New Yeller')M(_1,'Ring',.3,.3,.1)W(_1,p2,a(PI/2))
  396.  
  397. for i=0,PI*2,PI*2/6 do
  398. p2=P(.1,.1,.1,'White')W(_1,p,c(0,-.15,0,0,i),c(0,0,.1,-PI/6))M(_1,'Diamond',.1,.1,.1)
  399. end
  400. p2=P(.1,.1,.1,'White')W(_1,p,c(0,-.15))M(_1,'Diamond',.11,.1,.11)
  401. p2=P(.1,.1,.1,'White')W(_1,p,c(0,-.15))M(_1,'Diamond',.11,.1,.11)
  402. p2=P(.1,.1,.1,'White')W(_1,p,c(0,-.15/2)*a(0,PI/4))M(_1,'Diamond',.125,.1,.125)
  403. h=P(.35,.1,.35,'Crimson',.5)M(h,'b',1,.5,1)W(_1,hdl,c(0,.5+0.025)) --hilt
  404. C'Decal'{_P=h;Texture='rbxassetid://151271428';Face='Top'}
  405.  
  406. P(.1,.1,.1,'Crimson',.5)M(_1,'Crown',.5,.1,.5)W(_1,h,c(.15/2/4,.15,-.15/2))
  407. b=P(.1,3,.25,'Crimson',.5)M(b,'b',.25,1,1)W(b,h,c(0,1.5+.025+.15))b.Material='Neon'
  408.  
  409. blade=b
  410.  
  411. side=.35
  412.  
  413. calc=.1/4/2
  414. pp=P(side,.1,.1,'Black')M(_1,'b',1.01,.51,.25)W(_1,h,c(0,0,side/2+calc)) --up
  415. pp=P(side,.1,.1,'Black')M(_1,'b',1.01,.51,.25)W(_1,h,c(0,0,-(side/2+calc) )) --down
  416. pp=P(.1,.1,side+.075,'Black')M(_1,'b',.25,.51,1.01)W(_1,h,c((side/2+calc) )) --left
  417. pp=P(.1,.1,side+.075,'Black')M(_1,'b',.25,.51,1.01)W(_1,h,c(-(side/2+calc) )) --right
  418.  
  419. --platemail
  420. set_color='Black'
  421. p=P(1,1,.1)W(p,torso,c(0,0,-.55)) --front_plate
  422. --emblem
  423. d=P(.8,.8,.1,'Bright red')M(d,'b',1,1,1.01)W(d,p)
  424. d2=P(.5,.1,.5,'New Yeller')M(d2,'c',1,.8,1)W(d2,d,c(0,0,-.125,PI/2))
  425. center_point=d2
  426.  
  427. for i=0,PI*2,PI*2/6 do
  428. pp=P(.1,.1,.25)W(pp,d,c(0,0,-.125)*a(math.pi/2,i),c(.25))
  429. end
  430.  
  431. an=md'75'
  432.  
  433. p2=P(.75,.25,.1)W(p2,p,c(-.5,-.5)*a(0,0,an),c(.25,0,0))
  434. P(.25,.25,1.35)W(_1,p2,c(-.75/2-.125,0,_1.Size.z/2-.125))
  435.  
  436. p2=P(.75,.25,.1)W(p2,p,c(.5,-.5)*a(0,0,-an),c(-.25,0,0))
  437. P(.25,.25,1.35)W(_1,p2,c(.75/2+.125,0,_1.Size.z/2-.125))
  438.  
  439. p=P(1,1,.1)W(p,torso,c(0,0,.55)) --back_plate
  440. --emblem
  441. d=P(.8,.8,.1,'Bright red')M(d,'b',1,1,1.01)W(d,p)
  442. d2=P(.5,.1,.5,'New Yeller')M(d2,'c',1,.8,1)W(d2,d,c(0,0,.125,PI/2))
  443. d2.Material='Neon'
  444. C'PointLight'{_P=d2}
  445.  
  446. for i=0,PI*2,PI*2/6 do
  447. pp=P(.1,.1,.25)W(pp,d,c(0,0,.125)*a(math.pi/2,i),c(.25))
  448. end
  449.  
  450. p2=P(.75,.25,.1)W(p2,p,c(-.5,-.5)*a(0,0,an),c(.25,0,0))
  451. p2=P(.75,.25,.1)W(p2,p,c(.5,-.5)*a(0,0,-an),c(-.25,0,0))
  452. set_color=nil
  453.  
  454. function Damage(hit,amount)
  455. local hum=hit.Parent:FindFirstChild'Humanoid'
  456. if hum and hum.Parent ~= character then
  457. hum.Health=hum.Health-amount or 10
  458.  
  459. -- local container = hit.Parent:FindFirstChild('Dam_Cont',true)
  460. if not hit.Parent:FindFirstChild'Head' then return end
  461. local container = C'BillboardGui'{_P = hit.Parent;
  462. Adornee = hit.Parent.Head;
  463. Size=UDim2.new(0,30,0,30);
  464. StudsOffset = v3n(0,5,0);
  465. Name = 'Dam_Cont'
  466. }
  467. local splat = C'TextLabel'{_P=container;
  468. BackgroundTransparency=1;
  469. Size = UDim2.new(1,0,1,0);
  470. Position = UDim2.new(0,0,1,0);
  471. -- TextScaled=true;
  472. TextColor3=bcol'Really red'.Color;
  473. FontSize=12;
  474. Text=tostring(amount);
  475. }
  476. Spawn(function()
  477. splat:TweenPosition(UDim2.new(0,0,0,0),'InOut','Quad',.5,true,
  478. function(a)container:Destroy()end)
  479. end)
  480. end
  481. end
  482.  
  483. function createTra(stcf,encf)
  484. points={}
  485. stcf = stcf
  486. encf = encf
  487. g = 9.82
  488. mag = (stcf.p-encf.p).magnitude
  489. vel = 30
  490. theta = md'120'
  491. vx = vel*(math.cos(PI/180*theta))
  492. vy = vel*(math.sin(PI/180*theta))
  493. dt = .1
  494. posx,posy = 1,1
  495. t = 0
  496.  
  497. c2 = c(stcf.p,encf.p).lookVector
  498. c1 = c(l(torso).p,encf.p).lookVector
  499. the = math.atan(c1:Dot(c2))
  500. theta = the
  501. cf = stcf
  502. local function trail(p)
  503. local p0,p1
  504. while p.Parent ~= nil do
  505. p0 = p.CFrame.p
  506. wait()
  507. p1 = p.CFrame.p
  508. local mag=(p0-p1).magnitude
  509. local laz=P(.1,mag,.1,'New Yeller',.5)M(laz,'c')laz.Anchored=true
  510. laz.Material='Neon'
  511. laz.CFrame=l(c(p0,p1),0,0,-mag/2,math.pi/2)
  512. Delay(.25,function()for i=.5,1,.05 do laz.Transparency= i wait() end laz:Destroy()end)
  513. end
  514. end
  515. local ball=P(1,1,1,'Cyan')ball.Anchored=true M(_1,'s')
  516. ball.CFrame=stcf
  517. Spawn(function()trail(ball) end)
  518. -- Spawn(function()
  519. while (cf.Y > Workspace.Base.CFrame.Y) do
  520. posx = posx + vx * dt
  521. posy = posy + vy * dt
  522. t = t + dt
  523. vy = vy - (g * dt)
  524. ball.CFrame=cfn(stcf.p,encf.p)*cfn(0,posy,-posx)
  525. ball.Anchored=true
  526. cf = ball.CFrame
  527. game:service'RunService'.Heartbeat:wait()
  528. end
  529. e=Instance.new('Explosion',Workspace)
  530. e.DestroyJointRadiusPercent=0
  531. e.Position=ball.Position
  532. local bcf=ball.CFrame
  533. ball:Destroy()ball=nil
  534. return bcf
  535. -- end)
  536. end
  537.  
  538. function reset()
  539. A'rw'(c())A'lw'(c())A'torw'(c())A'rw2'(c())A'lw2'(c())A'neck'(c())A'hw'(c())
  540. end
  541.  
  542. function slash() --slash
  543. L'R'
  544.  
  545. A'rw'(a(md'65',0,md'-50')*a(0,md'110'))
  546. A'torw'(a(0,0,md'25'))
  547. wait'.25' Sounds.Slash:Play()
  548. A'rw'(a(md'110',0,md'130')*a(0,md'90'))
  549. A'torw'(a(0,0,md'-25'))
  550. wait'.25'
  551. A'rw'(a(md'160',0,md'-15')*a(0,md'45'))
  552. wait'.25' Sounds.Slash:Play()
  553. A'torw'(a(0,0,md'5'))
  554. A'rw'(a(md'20',0,md'-75')*a(md'20'))wait'.1'
  555. A'rw'(a(md'-40',0,md'-10')*a(0,md'45'))wait'.25'
  556. reset()wait'.35'
  557. L'R'
  558. end
  559.  
  560. function jump_slash() --jumpslash
  561. L'R'L'RR'L'LL'L'L'
  562. cf=torso.CFrame
  563. bg=C'BodyGyro'{_P=torso;maxTorque=v3n(1,1,1)*11e+14;D=50}
  564. bv=C'BodyVelocity'{_P=hum_root;velocity=cf.lookVector*40+v3n(0,50,0)}
  565. Spawn(function()
  566. for i=0,1,.1 do
  567. bg.cframe=bg.cframe:lerp(cf*a(md'45'),.25)
  568. wait()
  569. end end)
  570. -- A'torw'(c(0,0,4)*a(md'-45'))
  571. A'rw2'(a(md'-45'))
  572. A'lw2'(a(md'-45'))
  573. A'rw'(a(md'160'))
  574. A'lw'(a(md'160',0,md'60'))
  575. A'neck'(a(md'-50',0,md'25'))
  576. wait'.5' Sounds.Slash2:Play()
  577. bv.Velocity=v3n(0,-50,0)
  578. A'rw'(a(md'25',0,md'-50')*a(0,md'-15'))
  579. A'lw'(a(md'-25',0,md'-35'))
  580. Spawn(function()
  581. for i=0,1,.1 do
  582. bg.cframe=bg.cframe:lerp(cf*a(md'-35'),.25)
  583. wait()
  584. end end)
  585. -- A'torw'(c(0,0,-.15)*a(md'35'))
  586. A'rw2'(a(md'65'))A'lw2'(a(md'35'))
  587. A'neck'(a(md'35'))
  588. -- hw.C0=a(md'45')
  589. A'hw'(a(md'45'))
  590. wait'.45' bg:Destroy() bv:Destroy()
  591. A'hw'(c())
  592. -- hw.C0=c()
  593. reset()wait'.5'
  594. L'R'L'RR'L'LL'L'L'
  595. end
  596.  
  597. floatforce=236 / 1.2
  598.  
  599. function negateGravity(target)
  600. local total=0
  601. local gravity = 1
  602. for i,v in pairs(target:children())do
  603. if v:IsA'Part'then
  604. if v.Name=='Handle' then
  605. total = total + v:GetMass() * floatforce * 1
  606. else
  607. total = total + v:GetMass() * floatforce * gravity
  608. end
  609. end
  610. total = total + negateGravity(v)
  611. end
  612. return total
  613. end
  614.  
  615. function stab() --stab
  616. L'RR'L'LL'L'R'L'L'
  617. A'rw2'(c(0,.45,-.5,md'15'))A'lw2'(a(md'-45'))
  618. A'torw'(c(0,0,-.35)*a(md'15'))
  619. A'rw'(a(md'75',0,md'-10')*a(0,md'45'))
  620. A'hw'(a(md'45'))
  621. A'lw'(a(md'-75',0,md'45'))
  622.  
  623. local w
  624. local con
  625.  
  626. con=blade.Touched:connect(function(hit)
  627. local hum=hit.Parent:FindFirstChild'Humanoid'
  628. if hum and hum.Parent~=character then
  629. local negation=C'BodyForce'{_P=hum.Torso;
  630. force=v3n(0,negateGravity(hum.Parent),0);
  631. }
  632. local cf=blade.CFrame:toObjectSpace(hit.CFrame)
  633. local w=W(hit,blade,cf,cfn())
  634. Spawn(function()
  635. wait'.25'
  636. negation.force=v3n(0,0,0)
  637. wait()w:Destroy()negation:Destroy()
  638. end)
  639. con:disconnect()
  640. end
  641. end)
  642.  
  643. bv=C'BodyVelocity'{_P=torso;velocity=l(torso).lookVector*50;}
  644. wait'.35'
  645. con:disconnect()
  646. bv:Destroy()
  647. if w then w:Destroy() end
  648. reset()wait'.35'
  649. L'RR'L'LL'L'R'L'L'
  650. end
  651.  
  652. function spin_sword() ---Spin sword
  653. L'R'
  654. spd.rw=.1
  655. spd.hw=.3
  656. local done=false
  657. A'rw'(a(md'90'))wait'.15'
  658.  
  659. local function beam()
  660. local p=P(.1,.1,2,'Bright red')p.Material='Neon'p.Anchored=true
  661. t={-1,1}
  662. ran=t[math.random(#t)]*(math.random()*b.Size/2)
  663. p.CFrame=l(b,0,ran,0,0,math.pi/2)
  664. local con
  665.  
  666. con=p.Touched:connect(function(hit)
  667. Damage(hit,10)p:destroy()
  668. end)
  669.  
  670. Spawn(function()
  671. local cf=p.CFrame
  672. local tar=l(cf,0,0,-10)
  673. for i=0,1,.1 do
  674. p.CFrame=cf:lerp(tar,i)
  675. wait()
  676. end p:Destroy() end)
  677. end
  678.  
  679. Spawn(function()
  680. local t=tick()
  681. for i=0,PI*2*10,PI*2/10 do
  682. A'hw'(c(.45)*a(0,PI/2,i))
  683. if (tick()-t) > .05 then
  684. Sounds.Laser:Play()
  685. beam()
  686. t=tick()
  687. end
  688. wait()
  689. end done=true
  690. end)
  691.  
  692. while not done do
  693.  
  694. A'rw'(a(md'90',0,md'-45'))
  695. if done then break end
  696. wait'.5'
  697. A'rw'(a(md'90',0,md'25'))
  698. if done then break end
  699. wait'.5'
  700. end
  701.  
  702. spd.rw=.1
  703. spd.hw=.1
  704. A'hw'(c())A'rw'(c())wait(.25)L'R'
  705. end
  706. -- C'PointLight'{_P=b;Color=b.BrickColor.Color}
  707. function spin_body() --spin
  708. L'R'L'L'
  709. local orig=character.Humanoid.WalkSpeed
  710. character.Humanoid.WalkSpeed=50
  711. A'rw'(a(md'90',0,md'-15')*a(0,md'-75'))
  712. A'lw'(c(.15,0,-.4)*a(md'65',0,md'55'))
  713. A'hw'(a(md'-15'))
  714. local con
  715. con = blade.Touched:connect(debounce(function(hit)
  716. Damage(hit.Parent,20)wait'.1'
  717. end))
  718. rotvel=C'BodyAngularVelocity'{_P=torso;maxTorque=v3n(0,1,0)*9e+008;
  719. angularvelocity=v3n(0,1,0)*PI*2*3;
  720. }
  721. holding=true
  722. aa=0
  723. Sounds.Spin:Play()
  724. while holding do wait()
  725. aa=(aa%100)+2/5
  726. A'rw'(a(md'90'-math.sin(aa)*.5,0,md'-15')*a(0,md'-75'))
  727. A'lw'(c(.15,0,-.4)*a(md'65'-math.sin(aa)*.5,0,md'55'))
  728. end
  729. Sounds.Spin:Stop()
  730. con:disconnect()
  731. character.Humanoid.WalkSpeed=orig
  732. rotvel:Destroy()
  733. reset()wait'.5'
  734. L'R'L'L'
  735. end
  736.  
  737. function ff2()
  738. holding = true
  739. while holding do
  740. tar=mouse.Target
  741. if tar then
  742. sx,sy,sz=tar.Size.x,tar.Size.y,tar.Size.z
  743. p1=P(sx/2,sy,sz/2)
  744. p2=P(sx/2,sy,sz/2)
  745. p3=P(sx/2,sy,sz/2)
  746. p4=P(sx/2,sy,sz/2)
  747. E{p1,p2,p3,p4}{Anchored=true;CanCollide=true;Color=tar.Color;
  748. Parent=tar.Parent;Material=tar.Material}
  749. p1.CFrame=l(tar,sx/2-p1.Size.x/2,0,-sz/2+p1.Size.z/2)
  750. p2.CFrame=l(tar,sx/2-p1.Size.x/2,0,sz/2-p1.Size.z/2)
  751. p3.CFrame=l(tar,-sx/2+p1.Size.x/2,0,sz/2-p1.Size.z/2)
  752. p4.CFrame=l(tar,-sx/2+p1.Size.x/2,0,-sz/2+p1.Size.z/2)
  753.  
  754. for i,v in pairs({p1,p2,p3,p4})do
  755. local mag=(mouse.hit.p-v.Position).magnitude
  756. if mag<3 then
  757. v:Destroy()
  758. end
  759. end
  760.  
  761. tar:Destroy() end wait()
  762. end
  763.  
  764. -- p1.CFrame=l(tar,sx/4/2+sx/2,0,-sz/2+sz/4/2)
  765. end
  766.  
  767.  
  768. toAnim={}
  769. Spawn(function() --SecondaryAnimLoop.Handles Dummies animations
  770. while true do
  771. RS.Heartbeat:wait()
  772. for i,v in next,toAnim do
  773. if v.char then
  774. v.weld.C0 = v.weld.C0:lerp( v.tab.n_c0 * (v.tab.desired or cfn()),v.speed )
  775. else
  776. table.remove(toAnim,i)
  777. end
  778. end
  779. end
  780. end)
  781.  
  782. Dummies = {}
  783.  
  784. Dummy={}
  785. Dummy.has_found=false
  786. Dummy.anim_speed=.1
  787. Dummy.damage = 20
  788. Dummy.die_on_hit = true
  789. Dummy.new = function(cf,name,skin_color)
  790. local dummy=C'Model'{_P=Workspace;Name=name or 'Dummy'}
  791. C'BoolValue'{_P=dummy;Name='muge'} --identifier
  792. set_collide=false
  793. set_parent=dummy
  794. set_color=skin_color or "Nougat"
  795.  
  796. local tot=P(2,2,1)tot.Name='Torso'
  797.  
  798. local hea=P(2,1,1)M(hea,'h',1.25,1.25,1.25)W(hea,tot,cfn(),c(0,-1.5))hea.Name='Head'
  799. _3.Name='Neck'
  800. local face=C'Decal'{_P=hea; Name='face'; Texture='rbxassetid://306526364'}
  801.  
  802. local angle = a(0,math.pi)
  803.  
  804. local arm = P(1,2,1)arm.Name='Left Arm'
  805. local lw = W(arm,tot,c(1.5,.5,0,0)*angle,c(0,.5,0,0)*angle)
  806. _3.Name='Left Shoulder'
  807.  
  808. local arm = P(1,2,1)arm.Name='Right Arm'
  809. local rw = W(arm,tot,c(-1.5,.5,0,0)*angle,c(0,.5,0,0)*angle)
  810. _3.Name='Right Shoulder'
  811.  
  812. local leg = P(1,2,1)leg.Name='Left Leg'
  813. local lw2 = W(leg,tot,c(.5,-1),c(1,1))
  814. _3.Name='Left Hip'
  815.  
  816. local leg = P(1,2,1)leg.Name='Right Leg'
  817. local rw2 = W(leg,tot,c(-.5,-1),c(-1,1))
  818. _3.Name='Right Hip'
  819.  
  820. set_parent,set_color = nil,nil
  821. set_collide=false
  822.  
  823. local hum=C'Humanoid'{_P=dummy}
  824. tot.CFrame = cf or l(torso,0,0,-5)
  825. local winfo = {
  826. lw={n_c0=c(0,.5,0)*a(0,PI),w=lw};
  827. rw={n_c0=c(0,.5,0)*a(0,PI),w=rw};
  828. rw2={n_c0=c(-1,1,0),w=rw2};
  829. lw2={n_c0=c(1,1,0),w=lw2};
  830. }
  831.  
  832. local D = setmetatable({body = dummy; hum=hum; anim_speed = .1; has_found = false;
  833. joints=wlds;winfo=winfo;name=name},Dummy)
  834.  
  835. for i,v in pairs(D.winfo)do
  836. local t = {weld=v.w; tab=v; speed=D.anim_speed; name=D.Name; char=D.body}
  837. table.insert(toAnim,t)
  838. end
  839.  
  840. D.A=function(wut)
  841. return function(wat)
  842. if winfo[wut] then
  843. winfo[wut].desired = wat
  844. end
  845. end
  846. end
  847.  
  848. table.insert(Dummies,D)
  849. return D
  850. end
  851. Dummy.__index = Dummy
  852.  
  853. function Dummy:destroy()
  854. for i,v in pairs(toAnim) do --remove from animationlist
  855. if v.name == Dummy.Name then
  856. table.remove(toAnim,i)
  857. break
  858. end
  859. end
  860. self.body:Destroy()
  861. end
  862.  
  863. function Dummy:chase_nearest(radius)
  864.  
  865. if not self.body or not (self.hum and self.hum.Torso) then return end
  866. self.has_found=false
  867. local foundOnes = findHum(self.body.Torso.Position,radius or 10)
  868. if #foundOnes>0 then
  869. if foundOnes[1].Torso then
  870.  
  871. local path = PathService:ComputeRawPathAsync(self.hum.Torso.Position,
  872. foundOnes[1].Torso.Position,100)
  873. local points = path:GetPointCoordinates()
  874.  
  875. self.has_found=true
  876. for i,point in pairs(points) do
  877. self.hum:MoveTo(point)
  878. repeat
  879. dist = (point-self.hum.Torso.Position).magnitude
  880. wait()
  881. until dist < 3
  882. end
  883. -- self.hum:MoveTo(path:GetPointCoordinates()[1])
  884. -- self.hum:MoveTo(foundOnes[1].Torso.Position)
  885. end
  886. end
  887.  
  888. end
  889.  
  890. specials={ --on creation, on hit
  891. Burnadett={
  892. function(self)
  893. fire =C'Fire'{_P=self.body.Torso;}
  894. self.hum.WalkSpeed = 60
  895. self.damage = 0
  896. self.die_on_hit = false
  897. end;
  898. function(self,hit,hum)
  899. local f = hum.Torso:FindFirstChild'Scorch'
  900. if not f then
  901. f=C'Fire'{_P=hum.Torso;
  902. Size=10;
  903. Name='Scorch'
  904. }
  905. Spawn(function()
  906. while f ~= nil and f.Parent ~= nil do
  907. if hum and hum.Parent and hum.Health > 0 then
  908. hum.Health = hum.Health - 1
  909.  
  910. end
  911. wait()
  912. end
  913. end)
  914. Debris:AddItem(f,2)
  915. end
  916. end;
  917. }
  918. }
  919.  
  920. NPClist = {
  921. -- Depp = {Skin = "Brown"; Shirt = 274919324; Pants = 225138096; Face = 123692902;
  922. -- MeshId = 13640868; MeshTexture = 24261077; };
  923.  
  924. -- Jack = {Skin = "Terra Cotta"; Shirt = 242842985; Pants = 319196143; Face = 182636507;
  925. -- MeshId = 16190497; MeshTexture = 45783424; };
  926.  
  927. -- Markovich = {Skin = "Cool yellow"; Shirt = 302817401; Pants = 230102792; Face = 341704522;
  928. -- MeshId = 1028713; MeshTexture = 59408425; };
  929.  
  930. Burnadett = {Skin = "Daisy orange"; Pants = 243602917; MeshId = 13070796; MeshTexture = 50888939;
  931. MeshOffset = c(0,-.15,0);Face = 266342557};
  932.  
  933. -- Christine = {Skin = "Cool yellow"; MeshId = 29713297; MeshTexture = 45106315;
  934. -- MeshOffset = c(0,-.35,0); Shirt = 424851873; Pants = 416111123; Face = 334655813};
  935. }
  936.  
  937. function arc()
  938. L'R'
  939. A'rw'(a(md'145')) wait'.25'
  940. local dummies={}
  941. for name, info in next, NPClist do
  942.  
  943. local tarcf = createTra(l(blade,0,1.5),mouse.hit)
  944.  
  945. local d = Dummy.new(c(l(cfn(tarcf.p),0,4).p, l(torso).p), name, info.Skin or 'White')
  946. d.speed=50
  947.  
  948. d.body.Head.face.Texture = 'rbxassetid://'..(info.Face or '182636507')
  949.  
  950. table.insert(dummies,d)
  951. local Special
  952. if specials[name] then
  953. Special = specials[name]
  954. end
  955. if Special and Special[1] then Special[1](d) end
  956.  
  957. if info.Shirt then
  958. C'Shirt'{_P=d.body;ShirtTemplate='rbxassetid://'..info.Shirt}
  959. end
  960. if info.Pants then
  961. C'Pants'{_P=d.body;PantsTemplate='rbxassetid://'..info.Pants}
  962. end
  963.  
  964. if info.MeshId then
  965. hat = P(-0,-0,-1) hat.Parent=d.body
  966.  
  967. hat_mesh = M(hat,info.MeshId or '', unpack(info.MeshSize or {1,1,1}) )
  968. hat_mesh.TextureId = 'rbxassetid://'..tostring(info.MeshTexture or '')
  969.  
  970. hat_weld = W(hat,d.body.Head,(info.MeshOffset or c(0,.65) ) )
  971. end
  972. d.body.Torso.Touched:connect(function(hit) --on Touch, do damage and disappear
  973. if not hit.Parent then return end
  974. local hum=hit.Parent:FindFirstChild'Humanoid'
  975. if hum and not hum.Parent:FindFirstChild'muge' and hum.Parent~=character then
  976. hum:TakeDamage(d.damage)
  977. if Special and Special[2] then
  978. Special[2](d,hit,hum)
  979. end
  980. if d.die_on_hit then
  981. d:destroy()
  982. end
  983. end
  984. end)
  985. end
  986.  
  987. local angle=0
  988. local p_tick = tick()
  989. Spawn(function()
  990. while dummies do
  991. angle = (angle%100)+2/5
  992.  
  993. if (tick()-p_tick) > .5 then --seek someone every half second
  994. for i,dum in pairs(dummies) do
  995. dum:chase_nearest(20)
  996. end
  997. end
  998.  
  999. for i,d in pairs(dummies)do
  1000. d.A'rw'(c()) d.A'lw'(c()) d.A'rw2'(c()) d.A'lw2'(c())
  1001. if d.has_found then
  1002. d.A'rw'(a(PI/2+math.sin(angle),0,md'45'))
  1003. d.A'lw'(a(PI/2+math.cos(angle),0,md'-45'))
  1004. d.A'rw2'(a(math.cos(angle)))
  1005. d.A'lw2'(a(-math.sin(angle)))
  1006. end
  1007. end
  1008. wait()
  1009. end
  1010. end)
  1011.  
  1012. A'rw'(c())wait'.5'
  1013. L'R'
  1014. end
  1015.  
  1016. hook = nil
  1017. hook_force = nil
  1018. hook_weld = nil
  1019. bl=nil
  1020. function grapple()
  1021.  
  1022. if not hook then
  1023. -- L'R' A'rw'(a(md'-45',0,md'45'))
  1024. local stpos = l(center_point).p
  1025. local enpos = mouse.hit.p
  1026. local vec = (stpos-enpos)
  1027. stpos = stpos + (vec.unit * -3)
  1028.  
  1029. bl=P(.1,.1,.1)bl.CFrame=cfn(stpos)bl.CanCollide=true
  1030. bl.Velocity = vec.unit*-70
  1031. bv=C'BodyForce'{_P=bl; force=v3n(0,1,0)}
  1032. Sounds.Grapple:Play()
  1033.  
  1034. local hit_snd=Sounds.Grapple_hit:Clone()
  1035. hit_snd.Parent = bl
  1036.  
  1037. hook=blade:Clone() hook.Parent=Main hook.Anchored=true
  1038. hook.Size=v3n(.1,1,.25)
  1039. local hook_mesh=M(hook,'b',1,vec.magnitude)
  1040. hook.CFrame=cfn((stpos+enpos)/2,enpos)*a(PI/2)
  1041.  
  1042. hook_force = C'BodyPosition'{
  1043. maxForce = v3n(1,1,1)*1e+008;
  1044. D = 1e+003;
  1045. P = 1e+004;
  1046. }
  1047. hook_gyro = C'BodyGyro'{
  1048. maxTorque=v3n(1,1,1)*9e+008;
  1049. P=9e+003;
  1050. }
  1051. local cam=Workspace.CurrentCamera
  1052. reel_lenght=5
  1053. Spawn(function()
  1054. while hook~=nil and bl ~= nil do
  1055. stpos=center_point.Position
  1056. enpos = bl.Position
  1057. vec = (stpos-enpos)
  1058. stpos = stpos
  1059.  
  1060. hook.Size=v3n(.1,1,.25)
  1061. hook_mesh.Scale=v3n(1,vec.magnitude,1)
  1062. hook.CFrame=cfn( ((stpos+enpos)/2),enpos)*a(PI/2)
  1063. local dif = enpos.Y-stpos.Y
  1064. hook_gyro.cframe=cfn(stpos,enpos)
  1065. hook_force.position = enpos+(cam.CoordinateFrame*a(0,md'-15')).lookVector*-reel_lenght
  1066.  
  1067. local pressed_keys = InputService:GetKeysPressed()
  1068.  
  1069. for ii,key in next,pressed_keys do
  1070. if key.KeyCode == Enum.KeyCode.W then
  1071. reel_lenght = reel_lenght-1
  1072. elseif key.KeyCode == Enum.KeyCode.S then
  1073. reel_lenght = reel_lenght+1
  1074. end
  1075. end
  1076. wait()
  1077. end
  1078. end)
  1079.  
  1080. local con
  1081. con=bl.Touched:connect(function(hit)
  1082. if hit:IsDescendantOf(character) then return end
  1083. con:disconnect()
  1084. hit_snd:Play()
  1085. character.Humanoid.PlatformStand=true
  1086. W(bl,hit,hit.CFrame:toObjectSpace(bl.CFrame),cfn())
  1087. hook_force.Parent=torso
  1088. hook_gyro.Parent=torso
  1089. end)
  1090.  
  1091. else
  1092. character.Humanoid.PlatformStand=false
  1093. bl:Destroy() bl=nil
  1094. hook_force:destroy()
  1095. hook_gyro:destroy()
  1096. hook:destroy()
  1097. hook,hook_force=nil,nil
  1098. end
  1099. end
  1100.  
  1101. function removeDums()
  1102. for i,v in pairs(Dummies)do
  1103. v:destroy()
  1104. end
  1105. local found=Workspace:FindFirstChild('muge',true)
  1106. while found do
  1107. found.Parent:Destroy()
  1108. found=Workspace:FindFirstChild('muge',true)
  1109. end
  1110.  
  1111. end
  1112.  
  1113. KeyBindings={
  1114. q=jump_slash;
  1115. f=slash;
  1116. c=stab;
  1117. v=spin_sword;
  1118. rq=spin_body;
  1119. e=arc;
  1120. t=removeDums;
  1121. g=grapple;
  1122. }
  1123.  
  1124. Doing=false
  1125. holding=false
  1126.  
  1127.  
  1128. Keys={}
  1129. function updateKeys(key)
  1130. if Keys[key]then Keys[key]=nil
  1131. else Keys[key]=1
  1132. end
  1133. end
  1134.  
  1135. mouse.KeyUp:connect(function(k)
  1136. for key,action in pairs(KeyBindings)do
  1137. if k==key:sub(1,1) and key:sub(2,2)=='q' then
  1138. holding=false
  1139. end
  1140. end
  1141. end)
  1142. mouse.KeyDown:connect(function(k)
  1143. if Doing then return end
  1144. for key,action in pairs(KeyBindings)do
  1145. if k==key:sub(1,1) then
  1146. Doing=true
  1147. action(mouse)
  1148. Doing=false
  1149. end
  1150. end
  1151. end)
  1152. script.Parent=Main
  1153.  
  1154. cnt=0
  1155. for i,v in pairs(Main:children())do if v:IsA'Part'then cnt=cnt+1 end end print(cnt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement