Advertisement
speedyfox66

Carrameldancin

May 2nd, 2018
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.90 KB | None | 0 0
  1. -----------------------------------------------
  2. --DANCE TO THE BEAT, WAVE YOUR HANDS TOGETHER--
  3. ------------------------------------------------
  4. --I wanted to make something like Heavy Dance.--
  5. -- ~Sugarie --
  6. ------------------------------------------------
  7.  
  8.  
  9.  
  10. wait(1/60)
  11. Effects = { }
  12. local Player = game:service'Players'.localPlayer
  13. local chara = Player.Character
  14. local Humanoid = chara:FindFirstChildOfClass("Humanoid")
  15. local Mouse = Player:GetMouse()
  16. local LeftArm = chara["Left Arm"]
  17. local RightArm = chara["Right Arm"]
  18. local LeftLeg = chara["Left Leg"]
  19. local RightLeg = chara["Right Leg"]
  20. local Head = chara.Head
  21. local Torso = chara.Torso
  22. local Camera = game.Workspace.CurrentCamera
  23. local RootPart = chara.HumanoidRootPart
  24. local RootJoint = RootPart.RootJoint
  25. local attack = false
  26. local Anim = 'Idle'
  27. local attacktype = 1
  28. local delays = false
  29. local play = true
  30. local targetted = nil
  31. local Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
  32. local velocity = RootPart.Velocity.y
  33. local sine = 0
  34. local change = 1
  35. local doe = 0
  36. local Create = LoadLibrary("RbxUtility").Create
  37. Humanoid.WalkSpeed = 64
  38. Humanoid.Health = 100
  39. Humanoid.MaxHealth = 2398457930239487564930249857649304958768493049857483902948523984579302394875649302498576493049587684930498574839029485
  40.  
  41.  
  42. Humanoid.Animator.Parent = nil
  43. chara.Animate.Parent = nil
  44.  
  45. local newMotor = function(part0, part1, c0, c1)
  46. local w = Create('Motor'){
  47. Parent = part0,
  48. Part0 = part0,
  49. Part1 = part1,
  50. C0 = c0,
  51. C1 = c1,
  52. }
  53. return w
  54. end
  55.  
  56. function clerp(a, b, t)
  57. return a:lerp(b, t)
  58. end
  59.  
  60. RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
  61. NeckCF = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  62.  
  63. local RW = newMotor(Torso, RightArm, CFrame.new(1.5, 0, 0), CFrame.new(0, 0, 0))
  64. local LW = newMotor(Torso, LeftArm, CFrame.new(-1.5, 0, 0), CFrame.new(0, 0, 0))
  65. local RH = newMotor(Torso, RightLeg, CFrame.new(.5, -2, 0), CFrame.new(0, 0, 0))
  66. local LH = newMotor(Torso, LeftLeg, CFrame.new(-.5, -2, 0), CFrame.new(0, 0, 0))
  67. RootJoint.C1 = CFrame.new(0, 0, 0)
  68. RootJoint.C0 = CFrame.new(0, 0, 0)
  69. Torso.Neck.C1 = CFrame.new(0, 0, 0)
  70. Torso.Neck.C0 = CFrame.new(0, 1.5, 0)
  71.  
  72. local rarmc1 = RW.C1
  73. local larmc1 = LW.C1
  74. local rlegc1 = RH.C1
  75. local llegc1 = LH.C1
  76.  
  77. local resetc1 = false
  78.  
  79. function PlayAnimationFromTable(table, speed, bool)
  80. RootJoint.C0 = clerp(RootJoint.C0, table[1], speed)
  81. Torso.Neck.C0 = clerp(Torso.Neck.C0, table[2], speed)
  82. RW.C0 = clerp(RW.C0, table[3], speed)
  83. LW.C0 = clerp(LW.C0, table[4], speed)
  84. RH.C0 = clerp(RH.C0, table[5], speed)
  85. LH.C0 = clerp(LH.C0, table[6], speed)
  86. if bool == true then
  87. if resetc1 == false then
  88. resetc1 = true
  89. RootJoint.C1 = RootJoint.C1
  90. Torso.Neck.C1 = Torso.Neck.C1
  91. RW.C1 = rarmc1
  92. LW.C1 = larmc1
  93. RH.C1 = rlegc1
  94. LH.C1 = llegc1
  95. end
  96. end
  97. end
  98.  
  99. ArtificialHB = Instance.new("BindableEvent", script)
  100. ArtificialHB.Name = "Heartbeat"
  101. script:WaitForChild("Heartbeat")
  102. frame = 0.05
  103. tf = 0
  104. allowframeloss = false
  105. tossremainder = false
  106. lastframe = tick()
  107. script.Heartbeat:Fire()
  108. game:GetService("RunService").Heartbeat:connect(function(s, p)
  109. tf = tf + s
  110. if tf >= frame then
  111. if allowframeloss then
  112. script.Heartbeat:Fire()
  113. lastframe = tick()
  114. else
  115. for i = 1, math.floor(tf / frame) do
  116. script.Heartbeat:Fire()
  117. end
  118. lastframe = tick()
  119. end
  120. if tossremainder then
  121. tf = 0
  122. else
  123. tf = tf - frame * math.floor(tf / frame)
  124. end
  125. end
  126. end)
  127. function swait(num)
  128. if num == 0 or num == nil then
  129. ArtificialHB.Event:wait()
  130. else
  131. for i = 0, num do
  132. ArtificialHB.Event:wait()
  133. end
  134. end
  135. end
  136.  
  137. function RemoveOutlines(part)
  138. part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
  139. end
  140.  
  141. sndid = "rbxassetid://582191863"
  142. sndpi = 1.150
  143. saun = Instance.new("Sound",Head)
  144. saun.Volume = 10
  145. saun.Pitch = sndpi
  146. saun.SoundId = sndid
  147. saun.Name = "a"
  148. saun.Looped = true
  149. saun:Play()
  150.  
  151. dant = 0
  152.  
  153. Mouse.KeyDown:connect(function(key)
  154. key=key:lower()
  155. if key=="e" then
  156. if dant == 0 then
  157. dant = 1
  158. sndid = "rbxassetid://582191863"
  159. sndpi = 1.150
  160. elseif dant == 1 then
  161. dant = 0
  162. sndid = "rbxassetid://582191863"
  163. sndpi = 1.150
  164. end
  165. saun.Pitch = sndpi
  166. saun.SoundId = sndid
  167. saun:Play()
  168. end
  169. end)
  170.  
  171. while true do
  172. if Head:FindFirstChild("a")==nil then
  173. saun = Instance.new("Sound",Head)
  174. saun.Volume = 10
  175. saun.Pitch = sndpi
  176. saun.SoundId = sndid
  177. saun.Name = "a"
  178. saun.Looped = true
  179. saun:Play()
  180. end
  181. if dant == 0 then
  182. for i = 0, 1, 0.25 do
  183. swait()
  184. PlayAnimationFromTable({
  185. CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  186. CFrame.new(0, 1.4999938, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  187. CFrame.new(0.833580494, 1.12330246, 6.2584877e-07, -0.342020094, -1.63087847e-07, 0.939692676, 0.321394086, -0.939692557, 0.116977669, 0.883022249, 0.342020333, 0.321393758),
  188. CFrame.new(-0.833579302, 1.12330115, -1.49011612e-07, -0.342019886, 4.07719511e-08, -0.939692736, -0.321392894, -0.939693034, 0.116977319, -0.883022726, 0.342019141, 0.321393728),
  189. CFrame.new(0.5, -2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  190. CFrame.new(-0.5, -2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  191. }, .5, false)
  192. end
  193. for i = 0, 1, 0.25 do
  194. swait()
  195. PlayAnimationFromTable({
  196. CFrame.new(-0.268402338, -0.187939167, 0, 0.939692736, 0.342019886, 0, -0.342019916, 0.939692736, 0, 0, 0, 1),
  197. CFrame.new(-0.409892142, 1.36144388, 0, 0.766044796, -0.642787218, 0, 0.642787218, 0.766044855, 0, 0, 0, 1),
  198. CFrame.new(0.535924554, 1.16478181, 3.87430191e-07, -0.431316972, 0.32139343, 0.843013644, 0.185034022, -0.883022308, 0.431316644, 0.883022249, 0.342020333, 0.321393758),
  199. CFrame.new(-1.03069234, 0.594579875, -2.38418579e-07, -0.211470842, 0.321393758, -0.923030972, -0.418988168, -0.883022726, -0.211470872, -0.883022726, 0.342019141, 0.321393728),
  200. CFrame.new(0.951213062, -1.54518354, 0, 0.866025686, -0.499999642, 0, 0.499999642, 0.866025686, 0, 0, 0, 1),
  201. CFrame.new(0.214191973, -1.8503952, 0, 0.766044796, -0.642787218, 0, 0.642787218, 0.766044855, 0, 0, 0, 1),
  202. }, .5, false)
  203. end
  204. for i = 0, 1, 0.25 do
  205. swait()
  206. PlayAnimationFromTable({
  207. CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  208. CFrame.new(0, 1.4999938, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  209. CFrame.new(0.833580494, 1.12330246, 6.2584877e-07, -0.342020094, -1.63087847e-07, 0.939692676, 0.321394086, -0.939692557, 0.116977669, 0.883022249, 0.342020333, 0.321393758),
  210. CFrame.new(-0.833579302, 1.12330115, -1.49011612e-07, -0.342019886, 4.07719511e-08, -0.939692736, -0.321392894, -0.939693034, 0.116977319, -0.883022726, 0.342019141, 0.321393728),
  211. CFrame.new(0.5, -2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  212. CFrame.new(-0.5, -2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  213. }, .5, false)
  214. end
  215. for i = 0, 1, 0.25 do
  216. swait()
  217. PlayAnimationFromTable({
  218. CFrame.new(0.268400908, -0.187940732, 0, 0.939692855, -0.342019945, 0, 0.342019975, 0.939692795, 0, 0, 0, 1),
  219. CFrame.new(0.409947664, 1.36144304, 0, 0.766039729, 0.642798781, 0, -0.642787337, 0.766043961, 0, 0, 0, 1),
  220. CFrame.new(1.03070939, 0.594575524, -2.2649765e-06, -0.21146287, -0.321413547, 0.923025966, 0.418989599, -0.883016884, -0.21149224, 0.883023918, 0.342015505, 0.321394145),
  221. CFrame.new(-0.535904408, 1.16477537, -3.27825546e-07, -0.431322306, -0.321409196, -0.843005002, -0.185032129, -0.883013964, 0.431334615, -0.883019984, 0.342027217, 0.321392536),
  222. CFrame.new(-0.214235365, -1.8503921, 0, 0.766041398, 0.64279145, 0, -0.64279151, 0.766041279, 0, 0, 0, 1),
  223. CFrame.new(-0.965987146, -1.57677674, 0, 0.866024733, 0.500001609, 0, -0.500001609, 0.866024613, 0, 0, 0, 1),
  224. }, .5, false)
  225. end
  226. elseif dant == 1 then
  227. for i = 0, 1, 0.1 do
  228. swait()
  229. PlayAnimationFromTable({
  230. CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  231. CFrame.new(0, 1.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  232. CFrame.new(1.09999847, 1.1920929e-07, -0.600001514, 0, 0, 1, 0.173647985, 0.984807849, 0, -0.984807849, 0.173647985, 0),
  233. CFrame.new(-1.09999847, 1.1920929e-07, -0.600001514, 0, 0, -1, -0.173647985, 0.984807849, 0, 0.984807849, 0.173647985, 0),
  234. CFrame.new(0.5, -1.99999881, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  235. CFrame.new(-0.5, -1.99999881, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  236. }, .2, false)
  237. end
  238. for i = 0, 1, 0.1 do
  239. swait()
  240. PlayAnimationFromTable({
  241. CFrame.new(-0.0436433926, 0, -0.113613628, 0.64278698, 0, -0.766044974, 0, 1, 0, 0.766044974, 0, 0.64278698),
  242. CFrame.new(0, 1.49999809, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  243. CFrame.new(1.09998989, 1, -0.599998474, 0, 0, 1, 1, 0, 0, 0, 1, 0),
  244. CFrame.new(-1.10000229, 1, -0.599998474, 0, 0, -1, -1, 0, 0, 0, 1, 0),
  245. CFrame.new(0.499988556, -1.99999797, -3.81469727e-06, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  246. CFrame.new(-0.500012398, -1.78038144, -0.819608092, 1, 0, 1.49011612e-08, 0, 0.499999046, -0.866025984, 0, 0.866026044, 0.499999046),
  247. }, .2, false)
  248. end
  249. for i = 0, 1, 0.1 do
  250. swait()
  251. PlayAnimationFromTable({
  252. CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  253. CFrame.new(0, 1.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  254. CFrame.new(1.09999847, 1.1920929e-07, -0.600001514, 0, 0, 1, 0.173647985, 0.984807849, 0, -0.984807849, 0.173647985, 0),
  255. CFrame.new(-1.09999847, 1.1920929e-07, -0.600001514, 0, 0, -1, -0.173647985, 0.984807849, 0, 0.984807849, 0.173647985, 0),
  256. CFrame.new(0.5, -1.99999881, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  257. CFrame.new(-0.5, -1.99999881, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  258. }, .2, false)
  259. end
  260. for i = 0, 1, 0.1 do
  261. swait()
  262. PlayAnimationFromTable({
  263. CFrame.new(0.261404335, 0, -0.167939946, 0.76604414, 0, 0.642788053, 0, 1, 0, -0.642788053, 0, 0.76604414),
  264. CFrame.new(0, 1.49999285, 0, 1.00000012, 0, 0, 0, 1, 0, 0, 0, 1.00000012),
  265. CFrame.new(1.10000622, 0.999999046, -0.599996626, 0, 0, 1.00000012, 1, 0, 0, 0, 1.00000012, 0),
  266. CFrame.new(-1.09999859, 0.999999046, -0.59999758, 0, 0, -1.00000012, -1, 0, 0, 0, 1.00000012, 0),
  267. CFrame.new(0.500000179, -1.78038287, -0.81961149, 1.00000012, -2.98023224e-08, 2.98023224e-08, 0, 0.499999046, -0.866025925, 0, 0.866025984, 0.499999106),
  268. CFrame.new(-0.500003874, -1.99999893, 3.81469772e-06, 1.00000012, 0, 0, 0, 1, 0, 0, 0, 1.00000012),
  269. }, .2, false)
  270. end
  271. end
  272. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement