Advertisement
minecrafter523

Optitan

Jun 1st, 2016
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.99 KB | None | 0 0
  1. coroutine.wrap(function()
  2. game.Players.ChildAdded:connect(function(p)
  3. wait()
  4. p:Destroy()
  5. end)
  6. end)()
  7.  
  8. local p = game.Players.LocalPlayer
  9.  
  10. local char = p.Character
  11.  
  12. local nc = Instance.new("Model",char)
  13.  
  14. local t = char.Torso
  15.  
  16. for i=10,1,-1 do
  17. game.Lighting.TimeOfDay=i
  18. wait(0.1)
  19. end
  20.  
  21.  
  22. t.Anchored=true
  23.  
  24. nc.Name='NewChar'
  25.  
  26. local zap = Instance.new("Part",char.NewChar)
  27.  
  28. zap.Size=Vector3.new(5,1,5)
  29.  
  30. zap.BrickColor=BrickColor.new'Really red'
  31.  
  32. zap.Material = 'Corroded Metal'
  33.  
  34. zap.CanCollide=false
  35.  
  36. zap.Anchored=true
  37.  
  38. zap.CFrame=t.CFrame*CFrame.new(0,-2.5,0)
  39.  
  40. zap.Transparency=0.5
  41.  
  42. cf=zap.CFrame
  43. for i=1,30,2 do
  44. zap.Size=Vector3.new(5,i*2,5)
  45. zap.CFrame=cf*CFrame.new(0,i,0)
  46. wait(0)
  47. end
  48.  
  49.  
  50. local zaptop = Instance.new("Part",nc)
  51. zaptop.FormFactor='Custom'
  52. zaptop.Size=Vector3.new(5,0.5,5)
  53. zaptop.Anchored=true
  54. cf=zap.CFrame*CFrame.new(0,zap.Size.Y/2,0)
  55. zaptop.CFrame=cf
  56. zaptop.Material=zap.Material
  57. zaptop.BrickColor=zap.BrickColor
  58. zaptop.Transparency=zap.Transparency
  59. for i=1,20 do
  60. zaptop.Size=zaptop.Size+Vector3.new(0.25,0.1,0.25)
  61. zaptop.CFrame=cf
  62. wait(0)
  63. end
  64.  
  65. local w= Instance.new("Weld",char)
  66. w.Part0=zap
  67. w.Part1=t
  68. w.C0=CFrame.new(0,-(zap.Size.Y/2),0)
  69. w.C0=w.C0*CFrame.new(0,3,0)
  70.  
  71. w2=Instance.new("Weld",char)
  72. w2.Part0=zap
  73. w2.Part1=zaptop
  74. w2.C0 = CFrame.new(0,zap.Size.Y/2,0)
  75.  
  76. zap.Anchored,t.Anchored,zaptop.Anchored=false,false,false
  77.  
  78. local mod = Instance.new('Model',nc)
  79. mod.Name = "Round"
  80.  
  81. create = function(Z)
  82. local a = Instance.new("Part")
  83. a.Name=tostring(#nc.Round:children()+1)
  84. a.Parent=nc.Round
  85. a.FormFactor='Custom'
  86. a.Size=Vector3.new(1,zap.Size.Y,1)
  87. a.BrickColor=zap.BrickColor
  88. a.Material=zap.Material
  89. a.Transparency=0.5
  90. local w3 = Instance.new("Weld",zaptop)
  91. w3.Part0 = zaptop
  92. w3.Part1 = a
  93. w3.Name=w3.Name..a.Name
  94. print(Z)
  95. if Z=='z' then
  96.  
  97. w3.C0=CFrame.new(0,-(a.Size.Y/2),-(zaptop.Size.Z/2))
  98. elseif Z=='x' then
  99. w3.C0=CFrame.new(-(zaptop.Size.X/2),-(a.Size.Y/2),0)
  100. elseif Z=='-z' then
  101. w3.C0=CFrame.new(0,-(a.Size.Y/2),(zaptop.Size.Z/2))
  102. elseif Z=='-x' then
  103. w3.C0=CFrame.new((zaptop.Size.X/2),-(a.Size.Y/2),0)
  104. end
  105.  
  106. end
  107.  
  108. create'z'
  109. create'x'
  110. create'-z'
  111. create'-x'
  112. wait(1)
  113. a=1
  114.  
  115. ow1=zaptop.Weld1.C0
  116. ow2=zaptop.Weld2.C0
  117. ow3=zaptop.Weld3.C0
  118. ow4=zaptop.Weld4.C0
  119. for ii=1,10 do
  120.  
  121. for i=1,5 do
  122. wait(0)
  123. zaptop.Weld1.C0=zaptop.Weld1.C0*CFrame.new(-1,0,0)
  124.  
  125. zaptop.Weld2.C0=zaptop.Weld2.C0*CFrame.new(0,0,1)
  126.  
  127. zaptop.Weld3.C0=zaptop.Weld3.C0*CFrame.new(1,0,0)
  128.  
  129. zaptop.Weld4.C0=zaptop.Weld4.C0*CFrame.new(0,0,-1)
  130. end
  131.  
  132. for i=1,4 do
  133. zaptop["Weld"..i].C0=zaptop['Weld'..i].C0*CFrame.Angles(0,math.rad(90),0)
  134. end
  135. if ii==2 or ii==4 or ii==6 or ii==8 or ii==10 then
  136. zaptop.Weld1.C0=ow1
  137. zaptop.Weld2.C0=ow2
  138. zaptop.Weld3.C0=ow3
  139. zaptop.Weld4.C0=ow4
  140. end
  141. end
  142.  
  143. local bottom = zaptop:clone()
  144. bottom.Parent=nc
  145. bottom:breakJoints()
  146. bottom.Name='Bottom'
  147. bottom.Material=Workspace.Base.Material
  148. bottom.BrickColor=Workspace.Base.BrickColor
  149. bottom.FormFactor='Custom'
  150. bottom.Size=bottom.Size-Vector3.new(0,(bottom.Size.Y),0)
  151. bottom.Size=bottom.Size+Vector3.new(0,0.1,0)
  152. bottom.Transparency=0
  153. local WtC = Instance.new("Weld",zap)
  154. WtC.Part0=zap
  155. WtC.Part1=bottom
  156. WtC.C0=CFrame.new(0,-(zap.Size.Y/2),0)
  157.  
  158.  
  159. local bod = Instance.new("Model",nc)
  160. bod.Name='Body'
  161. weldz={}
  162. for A=1,15 do
  163. local new = Instance.new("Part",bod)
  164. new.Parent=bod
  165. local X,Z=bottom.Size.X,bottom.Size.Z
  166. new.Size=Vector3.new(X,(X+Z)/2,Z)
  167. new.BrickColor=BrickColor.New'Brown'
  168. new.Material='Grass'
  169. local newWeld = Instance.new("Weld",bottom)
  170. newWeld.Part0=newWeld.Parent
  171. newWeld.Part1=new
  172. newWeld.C0=CFrame.new(0,-((last or bottom).Size.Y)/2,0)
  173. newWeld.C0=newWeld.C0*CFrame.new(0,-(new.Size.Y/3),0)
  174. newWeld.C0=newWeld.C0*CFrame.new(0,-((A-1)*((new.Size.Y)/2)),0)
  175. if A==1 then
  176. newWeld.C0=newWeld.C0*CFrame.new(0,-3,0)
  177. end
  178. r=function() return math.random(-200,150) end
  179. weldz[#weldz+1]=newWeld
  180. last=new
  181. LAST=new
  182.  
  183. zaptop.CFrame=zaptop.CFrame*CFrame.new(0,-((last.Size.Y)/2),0)
  184.  
  185. wait()
  186. end
  187.  
  188. for i,v in pairs(weldz) do
  189. local newWeld=v
  190. if i~=#weldz then
  191. newWeld.C1=newWeld.C1*CFrame.Angles(math.rad(r()),math.rad(r()),math.rad(r()))
  192. end
  193. end
  194.  
  195.  
  196. local arm1 = Instance.new("Model",nc)
  197. arm1.Name='Right Arm'
  198. local X,Z=bottom.Size.X,bottom.Size.Z
  199. YY=(X+Z)/4
  200. local limb = Instance.new("Part",arm1)
  201. limb.Name='Limb1'
  202. limb.Size = Vector3.new(X,YY*10,Z)
  203. local aWeld1 = Instance.new("Weld",bottom)
  204. aWeld1.Part0=bottom
  205. aWeld1.Part1=limb
  206. aWeld1.C0 = CFrame.new(0,0,0)
  207. aWeld1.C0=aWeld1.C0*CFrame.Angles(0,0,math.rad(30))*CFrame.new(0,-(YY*5),0)
  208. limb.BrickColor=BrickColor.New'Brown'
  209. limb.Material='Grass'
  210. local limb2 = limb:clone()
  211. limb2.Parent=arm1
  212. limb2:breakJoints()
  213. limb2.Name='Limb2'
  214. limb2.Size=Vector3.new(X,YY*15,Z)
  215. local aWeld2 = Instance.new("Weld",limb)
  216. aWeld2.Part0=limb
  217. aWeld2.Part1=limb2
  218. aWeld2.C0 = CFrame.new(0,0,0)
  219. aWeld2.C0=aWeld2.C0*CFrame.new(20,-(YY*7.5),0)*CFrame.Angles(0,0,math.rad(50))*CFrame.new(0,-10,0)
  220.  
  221. local arm2 = Instance.new("Model",nc)
  222. arm2.Name='Right Arm'
  223. local X,Z=bottom.Size.X,bottom.Size.Z
  224. YY=(X+Z)/4
  225. local o2limb = Instance.new("Part",arm2)
  226. o2limb.Name='Limb1'
  227. o2limb.Size = Vector3.new(X,YY*10,Z)
  228. local a2Weld1 = Instance.new("Weld",bottom)
  229. a2Weld1.Part0=bottom
  230. a2Weld1.Part1=o2limb
  231. a2Weld1.C0 = CFrame.new(0,0,0)
  232. a2Weld1.C0=a2Weld1.C0*CFrame.Angles(0,0,math.rad(-30))*CFrame.new(0,-(YY*5),0)
  233. o2limb.BrickColor=BrickColor.New'Brown'
  234. o2limb.Material='Grass'
  235. local o2limb2 = o2limb:clone()
  236. o2limb2.Parent=arm2
  237. o2limb2:breakJoints()
  238. o2limb2.Name='Limb2'
  239. o2limb2.Size=Vector3.new(X,YY*15,Z)
  240. local a2Weld2 = Instance.new("Weld",o2limb)
  241. a2Weld2.Part0=o2limb
  242. a2Weld2.Part1=o2limb2
  243. a2Weld2.C0 = CFrame.new(0,0,0)
  244. a2Weld2.C0=a2Weld2.C0*CFrame.new(-20,-(YY*7.5),0)*CFrame.Angles(0,0,math.rad(-50))*CFrame.new(0,-10,0)
  245. wait(5)
  246. for i=1,50 do
  247. wait()
  248. a2Weld2.C0=CFrame.new(0,0,0)*CFrame.new(-20+(0.75*i),-(YY*5),0)*CFrame.Angles(0,0,math.rad(-50))*CFrame.new(0,-10,0)*CFrame.Angles(0,0,math.rad(i*1.5))
  249. aWeld2.C0=CFrame.new(0,0,0)*CFrame.new(20-(0.75*i),-(YY*5),0)*CFrame.Angles(0,0,math.rad(50))*CFrame.new(0,-10,0)*CFrame.Angles(0,0,math.rad(-i*1.5))
  250. bottom.Anchored=true
  251. end
  252. wait(1)
  253.  
  254. bottom.Anchored=false
  255. wait()
  256.  
  257.  
  258.  
  259. local leg1=Instance.new("Part",bod)
  260. leg1.Name="Left Leg"
  261. local leg2 = Instance.new("Part",bod)
  262. leg2.Name='Right Leg'
  263. leg1.Size=Vector3.new(last.Size.X,YY*20,last.Size.Z)
  264. leg2.Size=leg1.Size
  265. leg1.BrickColor,leg2.BrickColor=BrickColor.New'Brown',BrickColor.New'Brown'
  266. leg1.Material,leg2.Material='Grass','Grass'
  267.  
  268. local WELD = Instance.new("Weld",LAST)
  269. WELD.Part0 = LAST
  270. WELD.Part1 = leg1
  271.  
  272. WELD.C0=CFrame.new(-10,-(YY*10.3),0)*CFrame.Angles(0,0,math.rad(-10))
  273.  
  274. local WELD2 = Instance.new("Weld",LAST)
  275. WELD2.Part0 = LAST
  276. WELD2.Part1 = leg2
  277. WELD2.C0=CFrame.new(10,-(YY*10.3),0)*CFrame.Angles(0,0,math.rad(10))
  278.  
  279. leg12 = Instance.new("Part",leg1)
  280. leg22 = Instance.new("Part",leg2)
  281. leg12.Size=Vector3.new(leg1.Size.X,YY*7.5,leg1.Size.Z)
  282. leg22.Size=leg12.Size
  283. leg12.BrickColor,leg22.BrickColor=BrickColor.New'Brown',BrickColor.New'Brown'
  284. leg12.Material,leg22.Material='Grass','Grass'
  285. wait()
  286.  
  287. local WELD02 = Instance.new("Weld",leg1)
  288. WELD02.Part0 = leg1
  289. WELD02.Part1 = leg12
  290.  
  291. WELD02.C0=CFrame.new(0,-(leg1.Size.Y/2),0)*CFrame.Angles(0,0,math.rad(5))
  292. wait()
  293.  
  294. local WELD22 = Instance.new("Weld",leg2)
  295. WELD22.Part0 = leg2
  296. WELD22.Part1 = leg22
  297. WELD22.C0=CFrame.new(0,-(leg2.Size.Y/2),0)*CFrame.Angles(0,0,math.rad(-5))
  298.  
  299. local mouse = p:GetMouse()
  300. An=false
  301. Moving=false
  302.  
  303. local Sine=0
  304. local Change=1.2
  305. POS=WELD22.C0*CFrame.new(0,-20,0)
  306.  
  307.  
  308. POS2=WELD2.C0
  309.  
  310. POSS=WELD02.C0*CFrame.new(0,-20,0)*CFrame.Angles(0,math.rad(180),0)
  311.  
  312.  
  313. POSS2=WELD.C0*CFrame.Angles(0,math.rad(180),0)
  314.  
  315. L=function(A,B,C)
  316. return A:lerp(B,C)
  317. end
  318. char.Torso.CFrame=char.Torso.CFrame*CFrame.new(0,-50,0)
  319. wait(3)
  320.  
  321. local split = function(str,index,opt)
  322. if opt then
  323. return {str:sub(1,index),str:sub(index)}
  324. end
  325. return str:sub(1,index),str:sub(index)
  326. end
  327.  
  328. aWeld2.C0=CFrame.new(0,10,0)
  329. aWeld2.C0=aWeld2.C0*CFrame.new(0,-(YY*7.5),0)*CFrame.Angles(0,0,math.rad(120))*CFrame.new(0,-35,0)
  330.  
  331. bottom.Anchored=false
  332.  
  333.  
  334. Sword=Instance.new("Model",bod)
  335. Sword.Name='Sword'
  336.  
  337. local Handle= Instance.new("Part",Sword)
  338. Handle.FormFactor='Custom'
  339. Handle.Size=Vector3.new(10,30,10)
  340.  
  341. local HWeld=Instance.new("Weld",limb2)
  342.  
  343. HWeld.Part0=limb2
  344. HWeld.Part1=Handle
  345. HWeld.C0=CFrame.new(0,-(limb2.Size.Y/2),0)*CFrame.new(0,-15,0)
  346.  
  347. --[[local STop = Handle:clone()
  348. STop.Parent=Sword
  349. STop:BreakJoints()
  350. STop.Size=STop.Size+Vector3.new(0,25,50)
  351.  
  352. local StHWeld=Instance.new("Weld",Handle)
  353.  
  354. StHWeld.Part0=Handle
  355. StHWeld.Part1=STop
  356. StHWeld.C0=CFrame.new(0,-(Handle.Size.Y/2),0)*CFrame.new(0,-20,0)]]
  357.  
  358. local w1=Instance.new("Part",Sword)
  359. w1.FormFactor='Custom'
  360. w1.Size=Vector3.new(10,12.5,45)
  361. Instance.new("SpecialMesh",w1).MeshType='Wedge'
  362. sm=w1.Mesh
  363. sm.Offset=Vector3.new(0,6.25,0)
  364. sm.Scale=Vector3.new(1,2,1)
  365. local w1Weld=Instance.new("Weld",Handle)
  366.  
  367. w1Weld.Part0=Handle
  368. w1Weld.Part1=w1
  369. w1Weld.C0=CFrame.new(0,-(37.5),-7)*CFrame.Angles(math.rad(-90),0,0)
  370.  
  371.  
  372. local w2=Instance.new("Part",Sword)
  373. w2.FormFactor='Custom'
  374. w2.Size=Vector3.new(10,12.5,45)
  375. Instance.new("SpecialMesh",w2).MeshType='Wedge'
  376. sm=w2.Mesh
  377. sm.Offset=Vector3.new(0,6.25,5)
  378. sm.Scale=Vector3.new(1,2,1)
  379. local w2Weld=Instance.new("Weld",Handle)
  380. w2Weld.Part0=Handle
  381. w2Weld.Part1=w2
  382. w2Weld.C0=CFrame.new(0,-(42.5),5)*CFrame.Angles(math.rad(-90),0,0)*CFrame.Angles(0,0,math.rad(180))
  383. attack=false
  384. ind=10
  385. End=90
  386.  
  387. local hand=Instance.new("Part",Sword)
  388. hand.Size=Vector3.new(20,10,45)
  389. local handWeld=Instance.new("Weld",Handle)
  390. handWeld.Part0=Handle
  391. handWeld.Part1=hand
  392. handWeld.C0=CFrame.new(0,-Handle.Size.Y/2,0)
  393.  
  394. hand.BrickColor=BrickColor.Black()
  395. Handle.BrickColor=hand.BrickColor
  396. mouse.Button1Down:connect(function()
  397. if attack then return end
  398. attack=true
  399. local CO=aWeld1.C0
  400. for i=1,End,ind do
  401. wait()
  402. aWeld1.C0=aWeld1.C0*CFrame.Angles(math.rad(-ind),math.rad(ind),0)*CFrame.new(-1,-0.1,0)
  403. end
  404. for i=End,1,-ind do
  405. wait()
  406. aWeld1.C0=aWeld1.C0*CFrame.Angles(math.rad(ind),math.rad(-ind),0)*CFrame.new(1,0.1,0)
  407. end
  408. aWeld1.C0=CO
  409. wait(1)
  410. attack=false
  411. end)
  412. zap.CFrame=CFrame.new(zap.CFrame.p)*CFrame.new(0,20,0)
  413. while true do
  414.  
  415. local p=char.Torso.Position
  416. wait(0)
  417. local pp = char.Torso.Position
  418. if (Vector3.new(pp.X,0,pp.Z)-Vector3.new(p.X,0,p.Z)).magnitude >1 then
  419. Moving=true
  420. else
  421. Moving=false
  422. end
  423.  
  424. -- STUFF TO DETECT MOVING, ETC
  425. if Moving then
  426. Sine=Sine+Change
  427. WELD22.C0=L(WELD22.C0,POS*CFrame.Angles(math.sin(Sine/3)*0.3,0,0),0.08) -- CFRAMETOLERP:Lerp(POS,SPEED)
  428. WELD2.C0= L(WELD2.C0,POS2*CFrame.Angles(math.sin(Sine/3)*0.3,0,0),0.08)*CFrame.new(0,0,-(math.sin(Sine/3))) -- CFRAMETOLERP:Lerp(POS,SPEED)
  429. if Sine>10 then
  430. WELD02.C0=L(WELD02.C0,POSS*CFrame.Angles(math.sin(Sine/3)*0.3,0,0),0.08) -- CFRAMETOLERP:Lerp(POS,SPEED)
  431. WELD.C0= L(WELD.C0,POSS2*CFrame.Angles(math.sin(Sine/3)*0.3,0,0),0.08)*CFrame.new(0,0,-(math.sin(Sine/3))) -- CFRAMETOLERP:Lerp(POS,SPEED)
  432. end
  433. else
  434. Sine=0
  435. end
  436.  
  437. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement