jhuvauni34

plane

Jul 13th, 2017
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.10 KB | None | 0 0
  1. --tribal scythe made by jarredbcv, ideas from masterepico
  2. local player = game.Players.LocalPlayer
  3. local pchar = player.Character
  4. local mouse = player:GetMouse()
  5. local torso=pchar.Torso
  6. anim=true
  7. anglespeed = 1
  8. angle = 0
  9. maxrage = 9001
  10. rage = 9001 -- ITS OVER 9000!
  11. local asin = math.asin
  12. local atan2 = math.atan2
  13. local rad = math.rad
  14. local sin = math.sin
  15. local abs = math.abs
  16. local ceil = math.ceil
  17. local pi = math.pi
  18. deddeb=false
  19. deb=false
  20. Part = function(x,y,z,color,tr,cc,an,parent)
  21. local p = Instance.new('Part',parent or Weapon)
  22. p.formFactor = 'Custom'
  23. p.Size = Vector3.new(x,y,z)
  24. p.BrickColor = BrickColor.new(color)
  25. p.CanCollide = cc
  26. p.Transparency = tr
  27. p.Anchored = an
  28. p.TopSurface,p.BottomSurface = 0,0
  29. return p
  30. end
  31. Weld = function(p0,p1,x,y,z,rx,ry,rz,par)
  32. p0.Position = p1.Position
  33. local w = Instance.new('Motor',par or p0)
  34. w.Part0 = p0
  35. w.Part1 = p1
  36. w.C1 = CFrame.new(x,y,z)*CFrame.Angles(rx,ry,rz)
  37. return w
  38. end
  39. Mesh = function(par,num,x,y,z)
  40. local msh = nil
  41. if num == 1 then
  42. msh = Instance.new("CylinderMesh",par)
  43. elseif num == 2 then
  44. msh = Instance.new("SpecialMesh",par)
  45. msh.MeshType = 3
  46. elseif num == 3 then
  47. msh = Instance.new("BlockMesh",par)
  48. elseif num == 4 then
  49. msh = Instance.new("SpecialMesh",par)
  50. msh.MeshType = "Wedge"
  51. elseif type(num) == 'string' then
  52. msh = Instance.new("SpecialMesh",par)
  53. msh.MeshId = num
  54. end
  55. msh.Scale = Vector3.new(x,y,z)
  56. return msh
  57. end
  58. so = function(id,par,lo,pi)
  59. s = Instance.new("Sound",par) s.Looped=lo s.Pitch=pi
  60. s.SoundId = "http://roblox.com/asset/?id="..id s:play()
  61. end
  62. ROW = function(x, pa, out, col, trans, s, wt, t, ang, plus)
  63. for i = 1, 360, 360/t do wait()
  64. local c = Instance.new("Part", pa)
  65. c.FormFactor = 3
  66. c.TopSurface = 0
  67. c.BottomSurface = 0
  68. c.Size = s
  69. c.Anchored = true
  70. c.CanCollide = wt
  71. c.Transparency = trans
  72. c.BrickColor = BrickColor.new(col)
  73. c.CFrame = x * CFrame.Angles(0, math.rad(i + plus), 0) * CFrame.new(0, 0, out) * ang
  74. end
  75. end
  76. Lightning = function(Start,End,Times,Offset,Color,Thickness,Transparency)
  77. local magz = (Start - End).magnitude local curpos = Start local trz = {-Offset,Offset}
  78. for i=1,Times do
  79. local li = Instance.new("Part",workspace) li.TopSurface =0 li.BottomSurface = 0 li.Anchored = true li.Transparency = Transparency or 0.4 li.BrickColor = BrickColor.new(Color)
  80. li.formFactor = "Custom" li.CanCollide = false li.Size = Vector3.new(Thickness,Thickness,magz/Times) local ofz = Vector3.new(trz[math.random(1,2)],trz[math.random(1,2)],trz[math.random(1,2)])
  81. local trolpos = CFrame.new(curpos,End)*CFrame.new(0,0,magz/Times).p+ofz
  82. if Times == i then
  83. local magz2 = (curpos - End).magnitude li.Size = Vector3.new(Thickness,Thickness,magz2)
  84. li.CFrame = CFrame.new(curpos,End)*CFrame.new(0,0,-magz2/2)
  85. else
  86. li.CFrame = CFrame.new(curpos,trolpos)*CFrame.new(0,0,magz/Times/2)
  87. end
  88. curpos = li.CFrame*CFrame.new(0,0,magz/Times/2).p game.Debris:AddItem(li,0.01)
  89. end
  90. end
  91.  
  92. local function getAngles(cf)
  93. local sx,sy,sz,m00,m01,m02,m10,m11,m12,m20,m21,m22 = cf:components()
  94. return atan2(-m12,m22),asin(m02),atan2(-m01,m00)
  95. end
  96. Lerp = {
  97. Number = function(C1,C2,inc)
  98. return C1 + (C2 - C1) * inc
  99. end;
  100. CFrame = function(C1,C2,inc)
  101. local x1,y1,z1 = getAngles(C1)
  102. local x2,y2,z2 = getAngles(C2)
  103. return CFrame.new(
  104. Lerp.Number(C1.X,C2.X,inc),
  105. Lerp.Number(C1.Y,C2.Y,inc),
  106. Lerp.Number(C1.Z,C2.Z,inc)
  107. ) * CFrame.Angles(
  108. Lerp.Number(x1,x2,inc),
  109. Lerp.Number(y1,y2,inc),
  110. Lerp.Number(z1,z2,inc)
  111. )
  112. end;
  113. }
  114. local function genWeld(a,b)
  115. local w = Instance.new("Weld",a)
  116. w.Part0 = a
  117. w.Part1 = b
  118. return w
  119. end
  120. local Neck = genWeld(pchar.Torso,pchar.Head)
  121. Neck.C0 = CFrame.new(0,1,0)
  122. Neck.C1 = CFrame.new(0,-0.5,0)
  123. local LeftShoulder = genWeld(pchar.Torso,pchar['Left Arm'])
  124. LeftShoulder.C0 = CFrame.new(-1,0.5,0)
  125. LeftShoulder.C1 = CFrame.new(0.5,0.5,0)
  126. RightShoulder = genWeld(pchar.Torso,pchar['Right Arm'])
  127. RightShoulder.C0 = CFrame.new(1,0.5,0)
  128. RightShoulder.C1 = CFrame.new(-0.5,0.5,0)
  129. local LeftHip = genWeld(pchar.Torso,pchar['Left Leg'])
  130. LeftHip.C0 = CFrame.new(-1,-1,0)
  131. LeftHip.C1 = CFrame.new(-0.5,1,0)
  132. local RightHip = genWeld(pchar.Torso,pchar['Right Leg'])
  133. RightHip.C0 = CFrame.new(1,-1,0)
  134. RightHip.C1 = CFrame.new(0.5,1,0)
  135. local RootJoint = genWeld(pchar.HumanoidRootPart,pchar.Torso)
  136. RootJoint.C0 = CFrame.new(0,0,0) * CFrame.Angles(-math.pi/2,0,math.pi)
  137. RootJoint.C1 = CFrame.new(0,0,0) * CFrame.Angles(-math.pi/2,0,math.pi)
  138. local function newLerpTo(weld)
  139. return {
  140. Weld = weld; -- The weld that will lerp
  141. To = weld.C0; -- Where it will lerp to; a CFrame
  142. Cache = weld.C0; -- Cache of original position; it helps when making anim keyframes
  143. Speed = 0.1; -- Speed of lerp. 0.1 or 0.2 is best
  144. }
  145. end
  146. LerpTo = {
  147. Neck = newLerpTo(Neck);
  148. LeftArm = newLerpTo(LeftShoulder);
  149. RightArm = newLerpTo(RightShoulder);
  150. LeftLeg = newLerpTo(LeftHip);
  151. RightLeg = newLerpTo(RightHip);
  152. RootJoint = newLerpTo(RootJoint);
  153. }
  154. -- gui
  155. sc = Instance.new("ScreenGui",player.PlayerGui)
  156. sc.Name = "RaigMeter"
  157. fr = Instance.new("Frame",sc)
  158. fr.Size = UDim2.new(0, 250, 0, 28)
  159. fr.Position = UDim2.new(0.75, 0, .95, 0)
  160. fr.BackgroundColor3 = Color3.new(0.8, 0.8, 0.8)
  161. met = Instance.new("Frame", fr)
  162. met.Size = UDim2.new(1, -10, 1, -6)
  163. met.Position = UDim2.new(0, 5, 0, 3)
  164. met.BackgroundColor3 = Color3.new(0, 0, 0)
  165. met.BorderSizePixel = 0
  166. metr = Instance.new("ImageLabel", met)
  167. metr.Size = UDim2.new(rage/maxrage, 0, 1, -2)
  168. metr.Position = UDim2.new(0, 0, 0, 1)
  169. metr.Image = "http://www.roblox.com/asset/?id=112941056"
  170. metr.BorderSizePixel = 0
  171. metr.BackgroundColor3 = Color3.new(0,0,0)
  172. tx = Instance.new("TextLabel", met)
  173. tx.Size = UDim2.new(0, 0, 1, 0)
  174. tx.Position = UDim2.new(0, 5, 0, 0)
  175. tx.Text = rage.." / "..maxrage
  176. tx.Font = "ArialBold"
  177. tx.FontSize = "Size18"
  178. tx.BackgroundTransparency = 1
  179. tx.TextColor3 = BrickColor.new("Deep orange").Color
  180. tx.TextXAlignment = "Left"
  181. laast = rage
  182. -- func
  183. function click()
  184. if deb==true then return end
  185. deb=true
  186. anim=false
  187. ded= Part(.5,0,2,'White',1,false,false,mo)
  188. dedwl= Weld(ded,rot,0,0,0,0,0,0,mo)
  189. ded.Touched:connect(function(hit)
  190. if deddeb==true then return end
  191. if hit.Parent:findFirstChild("Humanoid") ~= nil and hit.Parent:findFirstChild("Humanoid").Health >= 1 then
  192. deddeb=true
  193. local hed=hit.Parent.Head:Clone()
  194. hed.Parent=workspace
  195. hed.CFrame=hit.Parent.Head.CFrame
  196. hit.Parent.Head:Destroy()
  197. wait(1)
  198. game.Debris:AddItem(hed,10)
  199. deddeb=false
  200. end
  201. end)
  202. so('10209645',torso,false,.75)
  203. LerpTo.Neck.To = LerpTo.Neck.Cache * CFrame.Angles(0,-rad(20),0)
  204. LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(rad(60),0,0)
  205. LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.Angles(-rad(5),0,0)
  206. LerpTo.RightLeg.To = LerpTo.RightLeg.Cache * CFrame.Angles(rad(10),0,0)
  207. LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache * CFrame.Angles(-rad(10),0,0)
  208. wait(.1)
  209. LerpTo.Neck.To = LerpTo.Neck.Cache * CFrame.Angles(0,rad(20),0)
  210. LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(rad(60),0,-rad(60))
  211. LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.Angles(rad(5),0,0)
  212. LerpTo.RightLeg.To = LerpTo.RightLeg.Cache * CFrame.Angles(-rad(10),0,0)
  213. LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache * CFrame.Angles(rad(10),0,0)
  214. wait(.2)
  215. LerpTo.Neck.To = LerpTo.Neck.Cache * CFrame.Angles(0,-rad(20),0)
  216. LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(rad(80),rad(20),rad(100))
  217. LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.Angles(rad(5),0,0)
  218. LerpTo.RightLeg.To = LerpTo.RightLeg.Cache * CFrame.Angles(-rad(10),0,0)
  219. LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache * CFrame.Angles(rad(10),0,0)
  220. so('28144425',torso,false,1)
  221. wait(.3)
  222. ded:Destroy()
  223. wait(.25)
  224. anim=true
  225. wait(.75)
  226. deb=false
  227. end
  228.  
  229.  
  230. --keys
  231. mouse.Button1Down:connect(function() click(mouse) end)
  232. mouse.KeyDown:connect(function(k)
  233. if k == "q" then
  234. end
  235. end)
  236. --parts
  237. mo=Instance.new("Model",pchar)
  238. mpa= Part(1,1,1,'Earth green',0,false,false,mo)
  239. Mesh(mpa,1,.3,6,.3)
  240. mwl= Weld(mpa,pchar["Right Arm"],0,-1.1,0,-pi/2,pi/1,-pi/3.5,mo)
  241. pa= Part(1,1,1,'Brown',0,false,false,mo)
  242. Mesh(pa,3,.301,6,.1)
  243. wl= Weld(pa,mpa,0,0,0,0,0,0,mo)
  244. pa= Part(1,1,1,'Brown',0,false,false,mo)
  245. Mesh(pa,3,.301,6,.1)
  246. wl= Weld(pa,mpa,0,0,0,0,pi/2,0,mo)
  247. for i=1,7 do
  248. pa= Part(1,1,1,'Black',0,false,false,mo)
  249. Mesh(pa,1,.301,.2,.301)
  250. wl= Weld(pa,mpa,0,-4+i,0,0,0,0,mo)
  251. end
  252. -- blade
  253. cl= Part(1,1,1,'Deep orange',0,false,false,mo)
  254. Mesh(cl,3,.1,.5,.5)
  255. clwl= Weld(cl,mpa,0,3,0,0,0,0,mo)
  256. pa= Part(1,1,1,'Deep orange',0,false,false,mo)
  257. Mesh(pa,4,.1,.5,1)
  258. wl= Weld(pa,cl,0,0,.75,0,pi/1,0,mo)
  259. bla= Part(1,1,1,'Deep orange',0,false,false,mo)
  260. Mesh(bla,4,.1,.5,1)
  261. wl= Weld(bla,cl,0,-.585,1.7,rad(10),pi/1,0,mo)
  262. pa= Part(1,1,1,'Deep orange',0,false,false,mo)
  263. Mesh(pa,4,.1,.5,1)
  264. wl= Weld(pa,cl,0,-1.298,2.5,rad(20),pi/1,0,mo)
  265. pa= Part(1,1,1,'Deep orange',0,false,false,mo)
  266. Mesh(pa,3,.1,.3,1)
  267. wl= Weld(pa,cl,0,-.4,.75,0,pi/1,0,mo)
  268. pa= Part(1,1,1,'Deep orange',0,false,false,mo)
  269. Mesh(pa,3,.1,.3,.5)
  270. wl= Weld(pa,bla,0,-.4,-.2,0,0,0,mo)
  271. pa= Part(1,1,1,'Black',0,false,false,mo)
  272. Mesh(pa,3,.09,.2,.9)
  273. wl= Weld(pa,cl,0,-.65,.75,0,pi/1,0,mo)
  274. pa= Part(1,1,1,'Black',0,false,false,mo)
  275. Mesh(pa,4,.1,.3,.5)
  276. wl= Weld(pa,bla,0,-.4,.3,0,pi/1,pi/1,mo)
  277. pa= Part(1,1,1,'Black',0,false,false,mo)
  278. Mesh(pa,4,.09,.175,.55)
  279. wl= Weld(pa,bla,0,-.63,-.2,0,pi/1,pi/1,mo)
  280. rot= Part(1,1,1,'Really black',0,false,false,mo)
  281. Mesh(rot,1,.5,.09,.5)
  282. pawl= Weld(rot,cl,0,0,-.25,0,0,pi/2,mo)
  283. pa= Part(.1,.1,.1,'Black',0,false,false,mo)
  284. Mesh(pa,'http://www.roblox.com/Asset/?id=9756362',.2,.75,.2)
  285. pawl= Weld(pa,rot,0,0,-.75,pi/2,0,0,mo)
  286. pa= Part(.1,.1,.1,'Black',0,false,false,mo)
  287. Mesh(pa,'http://www.roblox.com/Asset/?id=9756362',.2,.75,.2)
  288. pawl= Weld(pa,rot,.5,0,-.5,pi/2,0,pi/3,mo)
  289.  
  290. local function updateanims()
  291. if anim==true then
  292. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude < 2 then
  293. anglespeed = 1/3
  294. LerpTo.Neck.To = LerpTo.Neck.Cache * CFrame.Angles(sin(angle)*0.05,0,0)
  295. LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(rad(150),-rad(15)+abs(sin(angle))*0.1,rad(30))
  296. LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.Angles(sin(angle)*0.1,0,0)
  297. LerpTo.RightLeg.To = LerpTo.RightLeg.Cache * CFrame.Angles(0,0,abs(sin(angle))*0.1)
  298. LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache * CFrame.Angles(0,0,-abs(sin(angle))*0.1)
  299. end
  300. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude > 2 then
  301. anglespeed = 4
  302. LerpTo.Neck.To = LerpTo.Neck.Cache * CFrame.Angles(0,0,math.sin(angle)*0.05)
  303. LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(rad(80),rad(20),0)
  304. LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.Angles(rad(100),0,rad(20))
  305. LerpTo.RightLeg.To = LerpTo.RightLeg.Cache * CFrame.Angles(sin(angle)*.8,0,0)
  306. LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache * CFrame.Angles(-sin(angle)*.8,0,0)
  307. end
  308. end
  309. end
  310. local function onupdate()
  311. if rage > maxrage then rage=maxrage end
  312. tx.Text = ceil(rage).." / "..maxrage
  313. metr.Size = UDim2.new(ceil(rage)/maxrage, 0, 1, -2)
  314. end
  315.  
  316. Spawn(function()
  317. while wait()do
  318. angle = (angle % 100) + anglespeed/10 -- no matter whut it has to be in a loop or its on exticy
  319. end
  320. end)
  321. meo=0
  322. sdeb=false
  323. game:service'RunService'.RenderStepped:connect(function()
  324. meo=meo+1
  325. for _,v in pairs(LerpTo) do
  326. v.Weld.C0 = Lerp.CFrame(v.Weld.C0,v.To,v.Speed)end
  327. onupdate()
  328. updateanims()
  329. end)
Add Comment
Please, Sign In to add comment