Advertisement
jayrock3401

Untitled

Mar 27th, 2015
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.45 KB | None | 0 0
  1. local percent = 0
  2. for i = 1,101 do
  3. wait()
  4. print("Loading: "..percent.."%")
  5. percent = percent + 1
  6. end
  7. local plr=game.Players.LocalPlayer
  8. local chr=plr.Character
  9. local asin = math.asin
  10. local atan2 = math.atan2
  11. local rad = math.rad
  12. local sin = math.sin
  13. local abs = math.abs
  14. local ceil = math.ceil
  15.  
  16. local function getAngles(cf)
  17. local sx,sy,sz,m00,m01,m02,m10,m11,m12,m20,m21,m22 = cf:components()
  18. return atan2(-m12,m22),asin(m02),atan2(-m01,m00)
  19. end
  20. Lerp = {
  21. Number = function(C1,C2,inc)
  22. return C1 + (C2 - C1) * inc
  23. end;
  24. CFrame = function(a,b,m)
  25. local c,d={a:components()},{b:components()}
  26. table.foreach(c,function(a,b)c[a]=c[a]+(d[a]-c[a])*m end)
  27. return CFrame.new(unpack(c))
  28. end;
  29. }
  30. local function genWeld(a,b)
  31. local w = Instance.new("Weld",a)
  32. w.Part0 = a
  33. w.Part1 = b
  34. return w
  35. end
  36. local Song = function(id)
  37. for i,v in pairs(chr.Head:GetChildren()) do
  38. if v:IsA("Sound") then
  39. v:Destroy()
  40. end
  41. end
  42. sound = Instance.new("Sound",chr.Head)
  43. sound.Volume = math.huge
  44. sound.Looped = true
  45. sound.SoundId="rbxassetid://"..id
  46. sound:Play()
  47. end
  48. Part = function(x,y,z,color,tr,cc,an,parent)
  49. local p = Instance.new('Part',parent or Weapon)
  50. p.formFactor = 'Custom'
  51. p.Size = Vector3.new(x,y,z)
  52. p.BrickColor = BrickColor.new(color)
  53. p.CanCollide = cc
  54. p.Transparency = tr
  55. p.Anchored = an
  56. p.TopSurface,p.BottomSurface = 0,0
  57. p:BreakJoints()
  58. return p
  59. end
  60. Weld = function(p0,p1,x,y,z,rx,ry,rz,par)
  61. local w = Instance.new('Motor',par or p0)
  62. w.Part0 = p0
  63. w.Part1 = p1
  64. w.C1 = CFrame.new(x,y,z)*CFrame.Angles(rx,ry,rz)
  65. return w
  66. end
  67. Mesh = function(par,num,x,y,z)
  68. local msh = nil
  69. if num == 1 then
  70. msh = Instance.new("CylinderMesh",par)
  71. elseif num == 2 then
  72. msh = Instance.new("SpecialMesh",par)
  73. msh.MeshType = 'Wedge'
  74. elseif num == 3 then
  75. msh = Instance.new("BlockMesh",par)
  76. elseif type(num) == 'string' then
  77. msh = Instance.new("SpecialMesh",par)
  78. msh.MeshId = num
  79. end
  80. msh.Scale = Vector3.new(x,y,z)
  81. return msh
  82. end
  83. anglespeed = 1
  84. yeet = 0
  85. count = 0
  86. angle = 0
  87. local dance = 0
  88. speed = 1
  89. local plr=game.Players.LocalPlayer
  90. local chr=plr.Character
  91. local torso=chr.Torso
  92. local mouse=plr:GetMouse()
  93. local Neck = genWeld(chr.Torso,chr.Head)
  94. Neck.C0 = CFrame.new(0,1,0)
  95. Neck.C1 = CFrame.new(0,-0.5,0)
  96. local LeftShoulder = genWeld(chr.Torso,chr['Left Arm'])
  97. LeftShoulder.C0 = CFrame.new(-1,0.5,0)
  98. LeftShoulder.C1 = CFrame.new(0.5,0.5,0)
  99. RightShoulder = genWeld(chr.Torso,chr['Right Arm'])
  100. RightShoulder.C0 = CFrame.new(1,0.5,0)
  101. RightShoulder.C1 = CFrame.new(-0.5,0.5,0)
  102. local LeftHip = genWeld(chr.Torso,chr['Left Leg'])
  103. LeftHip.C0 = CFrame.new(-1,-1,0)
  104. LeftHip.C1 = CFrame.new(-0.5,1,0)
  105. local RightHip = genWeld(chr.Torso,chr['Right Leg'])
  106. RightHip.C0 = CFrame.new(1,-1,0)
  107. RightHip.C1 = CFrame.new(0.5,1,0)
  108. local RootJoint = genWeld(chr.HumanoidRootPart,chr.Torso)
  109. RootJoint.C0 = CFrame.new(0,0,0) * CFrame.Angles(-math.pi/2,0,math.pi)
  110. RootJoint.C1 = CFrame.new(0,0,0) * CFrame.Angles(-math.pi/2,0,math.pi)
  111. local function newLerpTo(weld)
  112. return {
  113. Weld = weld; -- The weld that will lerp
  114. To = weld.C0; -- Where it will lerp to; a CFrame
  115. Cache = weld.C0; -- Cache of original position; it helps when making anim keyframes
  116. Speed = 0.1; -- Speed of lerp. 0.1 or 0.2 is best
  117. }
  118. end
  119. LerpTo = {
  120. Neck = newLerpTo(Neck);
  121. LeftArm = newLerpTo(LeftShoulder);
  122. RightArm = newLerpTo(RightShoulder);
  123. LeftLeg = newLerpTo(LeftHip);
  124. RightLeg = newLerpTo(RightHip);
  125. RootJoint = newLerpTo(RootJoint);
  126. }
  127. local anim = true
  128. local function updateanims()
  129. if anim==true then
  130. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude < 2 and dance == 0 then
  131. anglespeed = 1/3
  132. LerpTo.Neck.To = LerpTo.Neck.Cache * CFrame.Angles(sin(angle)*0.05,0,0)
  133. LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(abs(sin(angle))*.2,rad(0),rad(0))
  134. LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.Angles(-abs(sin(angle))*.2,0,0)
  135. LerpTo.RightLeg.To = LerpTo.RightLeg.Cache * CFrame.Angles(0,0,abs(sin(angle))*0.2)
  136. LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache * CFrame.Angles(0,0,-abs(sin(angle))*0.2)
  137. LerpTo.RootJoint.To=LerpTo.RootJoint.Cache * CFrame.new(0,0,0)*CFrame.Angles(0,0,0)
  138. end
  139. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude > 2 and dance == 0 then
  140. anglespeed = 1.5
  141. LerpTo.Neck.To = LerpTo.Neck.Cache * CFrame.Angles(0,0,math.sin(angle)*0.05)
  142. LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(sin(angle)*.8,0,0)
  143. LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.Angles(-sin(angle)*.8,0,0)
  144. LerpTo.RightLeg.To = LerpTo.RightLeg.Cache * CFrame.Angles(-sin(angle)*.8,0,0)
  145. LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache * CFrame.Angles(sin(angle)*.8,0,0)
  146. LerpTo.RootJoint.To=LerpTo.RootJoint.Cache * CFrame.new(0,0,0)*CFrame.Angles(0,0,0)
  147. end
  148. end
  149. if anim == false then
  150. if dance == 1 then
  151. anglespeed = 3
  152. LerpTo.Neck.To = LerpTo.Neck.Cache * CFrame.Angles(rad(10),0,sin(yeet)*0.1)
  153. LerpTo.RootJoint.To = LerpTo.RootJoint.Cache * CFrame.Angles(rad(20),sin(angle)*0.2,sin(angle)*0.5) * CFrame.new(0,-abs(sin(angle))*0.5,0)
  154. LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(rad(90)-sin(angle)*1,0,-rad(10))
  155. LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.Angles(rad(90)-sin(angle)*1,0,rad(10))
  156. LerpTo.RightLeg.To = LerpTo.RightLeg.Cache * CFrame.Angles(rad(20),0,abs(sin(yeet))*0.1)
  157. LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache * CFrame.Angles(rad(20),0,-abs(sin(yeet))*0.1)
  158. end
  159. if dance == 2 then
  160. anglespeed = 3
  161. LerpTo.Neck.To = LerpTo.Neck.Cache*CFrame.Angles(0,0,sin(angle)*.1)
  162. LerpTo.RootJoint.To = LerpTo.RootJoint.Cache * CFrame.new(0,0,2+sin(angle)*.25)
  163. LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(rad(90)+sin(angle)*1,0,rad(5)+sin(angle)*-.5)
  164. LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.Angles(rad(90)+sin(angle)*1,0,rad(5)-sin(angle)*-.5)
  165. LerpTo.RightLeg.To = LerpTo.RightLeg.Cache * CFrame.Angles(rad(0),rad(0),sin(angle)*.25)
  166. LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache * CFrame.Angles(rad(0),rad(0),sin(angle)*-.25)
  167. end
  168. if dance == 3 then
  169. anglespeed = 1.5
  170. LerpTo.Neck.To = LerpTo.Neck.Cache*CFrame.Angles(0,0,0)
  171. LerpTo.RootJoint.To = LerpTo.RootJoint.Cache * CFrame.Angles(0,0,0)*CFrame.new(sin(angle)*5,0,0)
  172. LerpTo.RightArm.To=LerpTo.RightArm.Cache*CFrame.Angles(rad(90)-sin(angle)*1,0,rad(0)-sin(angle)*.25)
  173. LerpTo.LeftArm.To = LerpTo.LeftArm.Cache*CFrame.Angles(rad(0),rad(0),sin(angle)*.25)
  174. LerpTo.RightLeg.To = LerpTo.RightLeg.Cache*CFrame.Angles(0,0,sin(angle)*.1)
  175. LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache*CFrame.Angles(0,0,-sin(angle)*.1)
  176. end
  177. if dance == 4 then
  178. anglespeed = 1.5
  179. LerpTo.Neck.To = LerpTo.Neck.Cache * CFrame.Angles(0,0,0)
  180. LerpTo.RootJoint.To = LerpTo.RootJoint.Cache * CFrame.new(0,sin(angle)*5,0)
  181. LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(rad(0),rad(0),sin(angle)*.25)
  182. LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.Angles(rad(0),rad(0),sin(angle)*.25)
  183. LerpTo.RightLeg.To = LerpTo.RightLeg.Cache * CFrame.Angles(sin(angle)*.25,0,0)
  184. LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache * CFrame.Angles(sin(angle)*-.25,0,0)
  185. end
  186. if dance == 5 then
  187. anglespeed = 3
  188. LerpTo.RootJoint.To = LerpTo.RootJoint.Cache * CFrame.new(sin(angle)*.5,0,0)
  189. LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(0,0,sin(angle)*.25)*CFrame.new(0,sin(angle)*.1,0)
  190. LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.Angles(0,0,sin(angle)*.25)*CFrame.new(0,sin(angle)*.1,0)
  191. LerpTo.RightLeg.To = LerpTo.RightLeg.Cache * CFrame.Angles(0,0,sin(angle)*.25)*CFrame.new(0,sin(angle)*.1,0)
  192. LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache * CFrame.Angles(0,0,sin(angle)*.25)*CFrame.new(0,sin(angle)*.1,0)
  193. end
  194. if dance == 6 then
  195. anglespeed = 2
  196. LerpTo.Neck.To = LerpTo.Neck.Cache * CFrame.Angles(math.pi/10-math.abs(math.sin(angle))*0.3,0, 0)
  197. LerpTo.RootJoint.To = LerpTo.RootJoint.Cache * CFrame.new(0, 0, 0) * CFrame.Angles(0, 0,math.sin(angle)*.2)
  198. LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.Angles(math.pi/3+math.abs(math.sin(angle)*1), 0, math.sin(angle*1)*.5)
  199. LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.Angles(math.pi/3+math.abs(math.sin(angle)*1), 0, math.sin(angle*1)*.5)
  200. LerpTo.RightLeg.To = LerpTo.RightLeg.Cache * CFrame.Angles(0, math.sin(angle)*.2, math.rad(2.5))
  201. LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache * CFrame.Angles(0, -math.sin(angle)*.2, -math.rad(2.5))
  202. end
  203. if dance == 7 then -- insane spaz out l0l
  204. anglespeed = 1
  205. LerpTo.Neck.To = LerpTo.Neck.Cache * CFrame.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))*CFrame.Angles(math.random(-5,5),math.random(-5,5),math.random(-5,5))
  206. LerpTo.RootJoint.To = LerpTo.RootJoint.Cache * CFrame.new(math.random(-5,5),math.random(-5,5),0)*CFrame.Angles(math.random(-5,5),math.random(-5,5),math.random(-5,5))
  207. LerpTo.RightArm.To = LerpTo.RightArm.Cache * CFrame.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))*CFrame.Angles(math.random(-5,5),math.random(-5,5),math.random(-5,5))
  208. LerpTo.LeftArm.To = LerpTo.LeftArm.Cache * CFrame.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))*CFrame.Angles(math.random(-5,5),math.random(-5,5),math.random(-5,5))
  209. LerpTo.RightLeg.To = LerpTo.RightLeg.Cache * CFrame.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))*CFrame.Angles(math.random(-5,5),math.random(-5,5),math.random(-5,5))
  210. LerpTo.LeftLeg.To = LerpTo.LeftLeg.Cache * CFrame.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))*CFrame.Angles(math.random(-5,5),math.random(-5,5),math.random(-5,5))
  211. end
  212. if dance == 8 then -- roleo dance :D
  213. anglespeed = 4
  214. LerpTo.RightArm.To = LerpTo.RightArm.Cache*CFrame.Angles(rad(180),0,sin(angle)*.3)
  215. LerpTo.LeftArm.To = LerpTo.LeftArm.Cache*CFrame.Angles(rad(180),0,sin(angle)*.3)
  216. end
  217. if dance == 9 then -- XD lol mast3r ba!t!ng dance :)
  218. anglespeed = 6
  219. LerpTo.RightArm.To = LerpTo.RightArm.Cache*CFrame.Angles(rad(90)+sin(angle)*1,0,rad(-45))
  220. LerpTo.LeftArm.To = LerpTo.LeftArm.Cache*CFrame.Angles(rad(90)+sin(angle)*1,0,rad(45))
  221. end
  222. if dance == 10 then --but scratch :D
  223. anglespeed = 5
  224. LerpTo.RightArm.To = LerpTo.RightArm.Cache*CFrame.Angles(rad(-25),0,rad(-25))*CFrame.new(0,sin(angle)*.5,0)
  225. LerpTo.LeftArm.To = LerpTo.LeftArm.Cache*CFrame.Angles(rad(-25),0,rad(25))*CFrame.new(0,sin(angle)*.5,0)
  226. end
  227. if dance == 11 then -- CARTWHEELS LOLW0T!?
  228. anglespeed = 2
  229. LerpTo.RootJoint.To=LerpTo.RootJoint.Cache*CFrame.Angles(sin(angle)*2,0,0)*CFrame.new(0,sin(angle)*2,0)
  230. end
  231. end
  232. end
  233. mouse.KeyDown:connect(function(key)
  234. if key == "q" and dance == 0 then
  235. Song("168007346")
  236. anim = false
  237. dance = 1
  238. elseif key == "e" and dance == 0 then
  239. Song('169614787')
  240. anim = false
  241. dance = 2
  242. elseif key == "r" and dance == 0 then
  243. Song('193620451')
  244. anim = false
  245. dance = 3
  246. elseif key == "t" and dance == 0 then
  247. Song('160525520')
  248. anim = false
  249. dance = 4
  250. elseif key == "y" and dance == 0 then
  251. Song("212675193")
  252. anim = false
  253. dance = 5
  254. elseif key == "f" and dance == 0 then
  255. Song("133061687")
  256. anim = false
  257. dance = 6
  258. elseif key == "g" and dance == 0 then
  259. Song("154724577")
  260. anim = false
  261. dance = 7
  262. elseif key == "h" and dance == 0 then -- roleo dance :D
  263. Song("142761485")--insert ur soundid here plz
  264. anim = false
  265. dance = 8-- ill make this in second
  266. elseif key == "j" and dance == 0 then
  267. Song("142397652")
  268. anim = false
  269. dance = 9
  270. elseif key == "z" and dance == 0 then
  271. Song("142313640")
  272. anim = false
  273. dance = 10
  274. elseif key == "x" and dance == 0 then
  275. Song("130768080")
  276. anim = false
  277. dance = 11
  278. elseif key == "q" or key == "e" or key == "r" or key == "t" or key == "y" or key == "f" or key == "g" or key == "h" or key == "j" or key == "z" or key == "x" and dance > 0 then
  279. sound:Stop()
  280. dance = 0
  281. anim = true
  282. end
  283. end)
  284.  
  285.  
  286. Spawn(function()
  287. while wait()do
  288. angle = (angle % 100) + anglespeed/10 -- no matter whut it has to be in a loop or its on exticy
  289. end
  290. end)
  291. meo=0
  292. sdeb=false
  293. game:service'RunService'.RenderStepped:connect(function()
  294. meo=meo+1
  295. for _,v in pairs(LerpTo) do
  296. v.Weld.C0 = Lerp.CFrame(v.Weld.C0,v.To,v.Speed)end
  297. updateanims()
  298. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement