memberhero

Spooky Month Dance Void Script Builder Place 1

Aug 4th, 2021
468
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.04 KB | None | 0 0
  1. --Tween Version by basstracker1970
  2.  
  3. ArtificialHB = Instance.new("BindableEvent", script)
  4. ArtificialHB.Name = "Heartbeat"
  5. script:WaitForChild("Heartbeat")
  6.  
  7. Player = owner
  8. PlayerGui = nil
  9. Cam = workspace.CurrentCamera
  10. Backpack = nil
  11. Character = Player.Character
  12. Humanoid = Character.Humanoid
  13. Mouse = nil
  14. RootPart = Character["HumanoidRootPart"]
  15. Torso = Character["Torso"]
  16. Head = Character["Head"]
  17. RightArm = Character["Right Arm"]
  18. LeftArm = Character["Left Arm"]
  19. RightLeg = Character["Right Leg"]
  20. LeftLeg = Character["Left Leg"]
  21. RootJoint = RootPart["RootJoint"]
  22. Neck = Torso["Neck"]
  23. RightShoulder = Torso["Right Shoulder"]
  24. LeftShoulder = Torso["Left Shoulder"]
  25. RightHip = Torso["Right Hip"]
  26. LeftHip = Torso["Left Hip"]
  27. Humanoid = Character.Humanoid
  28.  
  29. local BODY = {}
  30. for _, c in pairs(Character:GetDescendants()) do
  31. if c:IsA("BasePart") and c.Name ~= "Handle" then
  32. if c ~= RootPart and c ~= Torso and c ~= Head and c ~= RightArm and c ~= LeftArm and c ~= RightLeg and c ~= LeftLeg then
  33. c.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0)
  34. end
  35. table.insert(BODY,{c,c.Parent,c.Material,c.Color,c.Transparency,c.Size,c.Name})
  36. elseif c:IsA("JointInstance") then
  37. table.insert(BODY,{c,c.Parent,nil,nil,nil,nil,nil})
  38. end
  39. end
  40. local music = Instance.new("Sound",Character)
  41. music.Name = "spoopymonth"
  42. music.SoundId = "rbxassetid://5797107302"
  43. music.Looped = true
  44. music:Play()
  45. function refit()
  46. Character.Parent = workspace
  47. for e = 1, #BODY do
  48. if BODY[e] ~= nil then
  49. local STUFF = BODY[e]
  50. local PART = STUFF[1]
  51. local PARENT = STUFF[2]
  52. local MATERIAL = STUFF[3]
  53. local COLOR = STUFF[4]
  54. local TRANSPARENCY = STUFF[5]
  55. --local SIZE = STUFF[6]
  56. local NAME = STUFF[7]
  57. if PART.ClassName == "Part" and PART ~= RootPart then
  58. PART.Material = MATERIAL
  59. PART.Transparency = TRANSPARENCY
  60. PART.Name = NAME
  61. end
  62. if PART.Parent ~= PARENT then
  63. Humanoid:remove()
  64. PART.Parent = PARENT
  65. Humanoid = IT("Humanoid",Character)
  66. end
  67. end
  68. end
  69. end
  70.  
  71. Humanoid.Died:connect(function()
  72. refit()
  73. end)
  74.  
  75.  
  76. PlayerGui = nil
  77. Cam = workspace.CurrentCamera
  78. Backpack = nil
  79. Humanoid = Character.Humanoid
  80. Mouse = nil
  81. RootPart = Character["HumanoidRootPart"]
  82. Torso = Character["Torso"]
  83. Head = Character["Head"]
  84. RightArm = Character["Right Arm"]
  85. LeftArm = Character["Left Arm"]
  86. RightLeg = Character["Right Leg"]
  87. LeftLeg = Character["Left Leg"]
  88. RootJoint = RootPart["RootJoint"]
  89. Neck = Torso["Neck"]
  90. RightShoulder = Torso["Right Shoulder"]
  91. LeftShoulder = Torso["Left Shoulder"]
  92. RightHip = Torso["Right Hip"]
  93. LeftHip = Torso["Left Hip"]
  94.  
  95.  
  96.  
  97. IT = Instance.new
  98. CF = CFrame.new
  99. VT = Vector3.new
  100. RAD = math.rad
  101. C3 = Color3.new
  102. UD2 = UDim2.new
  103. BRICKC = BrickColor.new
  104. ANGLES = CFrame.Angles
  105. EULER = CFrame.fromEulerAnglesXYZ
  106. COS = math.cos
  107. ACOS = math.acos
  108. SIN = math.sin
  109. ASIN = math.asin
  110. ABS = math.abs
  111. MRANDOM = math.random
  112. FLOOR = math.floor
  113.  
  114. local Speed = 0.1
  115. AnimationSpeed=.8
  116. SmoothTime=2
  117.  
  118. function swait(num)
  119. if num==0 or num==nil then
  120. --if Stagger.Value==false or Stun.Value<=100 then
  121. --Player.PlayerGui.Pacemaker.Heartbeat.Event:wait()
  122. script.Heartbeat.Event:wait()
  123. --end
  124. else
  125. for i=0,num do
  126. --Player.PlayerGui.Pacemaker.Heartbeat.Event:wait()
  127. script.Heartbeat.Event:wait()
  128. --[[if Stagger.Value==true or Stun.Value>=StunT.Value then
  129. break
  130. end]]
  131. end
  132. end
  133. end
  134. script:WaitForChild("Heartbeat")
  135.  
  136. frame = 1/60
  137. tf = 0
  138. allowframeloss = false --if set to true will fire every frame it possibly can. This will result in multiple events happening at the same time whenever delta returns frame2 or greater.
  139. tossremainder = false --if set to true t will be set to 0 after Fire()-ing.
  140. lastframe = tick()
  141. script.Heartbeat:Fire() --ayy lmao
  142.  
  143. game:GetService("RunService").Heartbeat:connect(function(s,p) --herp derp
  144. tf = tf + s
  145. if tf >= frame then
  146. if allowframeloss then
  147. script.Heartbeat:Fire()
  148. lastframe=tick()
  149. else
  150. ----print("FIRED "..math.floor(t/frame).." FRAME(S)","REMAINDER "..(t - frame(math.floor(t/frame))))
  151. for i=1, math.floor(tf/frame) do
  152. script.Heartbeat:Fire()
  153. end
  154. lastframe=tick()
  155. end
  156. if tossremainder then
  157. tf = 0
  158. else
  159. tf = tf - frame * math.floor(tf/frame)
  160. end
  161. end
  162. end)
  163.  
  164. Anim = {
  165. Properties = {
  166. Looping = true,
  167. Priority = Enum.AnimationPriority.Idle
  168. },
  169. Keyframes = {
  170. [0] = {
  171. ["HumanoidRootPart"] = {
  172. ["Torso"] = {
  173. CFrame = CFrame.new(0, 0, -0.633) * CFrame.Angles(math.rad(4.412), math.rad(0.516), math.rad(-21.601)),
  174. ["Head"] = {
  175. CFrame = CFrame.Angles(math.rad(17.418), 0, 0),
  176. },
  177. ["Left Leg"] = {
  178. CFrame = CFrame.new(-0.215, 0.592, -0.065) * CFrame.Angles(math.rad(-6.761), math.rad(25.096), math.rad(-2.922)),
  179. },
  180. ["Right Arm"] = {
  181. CFrame = CFrame.new(1.066, -0.635, 0.37) * CFrame.Angles(math.rad(-60.504), math.rad(-13.694), math.rad(164.84)),
  182. },
  183. ["Right Leg"] = {
  184. CFrame = CFrame.new(0.188, 0.564, 0.136) * CFrame.Angles(math.rad(-7.85), math.rad(-16.501), math.rad(5.214)),
  185. },
  186. ["Left Arm"] = {
  187. CFrame = CFrame.new(-1.177, -0.481, 0.618) * CFrame.Angles(math.rad(-65.661), math.rad(25.955), math.rad(-172.059)),
  188. },
  189. },
  190. },
  191. },
  192. [0.083] = {
  193. ["HumanoidRootPart"] = {
  194. ["Torso"] = {
  195. CFrame = CFrame.new(0.001, -0.005, -0.573) * CFrame.Angles(math.rad(4.412), math.rad(0.516), math.rad(-21.601)),
  196. ["Head"] = {
  197. CFrame = CFrame.Angles(math.rad(18.678), math.rad(1.833), math.rad(-0.057)),
  198. },
  199. ["Left Leg"] = {
  200. CFrame = CFrame.new(-0.215, 0.592, -0.065) * CFrame.Angles(math.rad(-7.62), math.rad(25.153), math.rad(-2.521)),
  201. },
  202. ["Right Arm"] = {
  203. CFrame = CFrame.new(1.066, -0.635, 0.37) * CFrame.Angles(math.rad(-59.015), math.rad(-8.422), math.rad(165.126)),
  204. },
  205. ["Right Leg"] = {
  206. CFrame = CFrame.new(0.189, 0.55, 0.138) * CFrame.Angles(math.rad(-6.589), math.rad(-16.387), math.rad(5.615)),
  207. },
  208. ["Left Arm"] = {
  209. CFrame = CFrame.new(-1.177, -0.481, 0.618) * CFrame.Angles(math.rad(-64.63), math.rad(19.022), math.rad(-172.403)),
  210. },
  211. },
  212. },
  213. },
  214. [0.25] = {
  215. ["HumanoidRootPart"] = {
  216. ["Torso"] = {
  217. CFrame = CFrame.new(0.029, -0.07, -0.807) * CFrame.Angles(math.rad(-15.584), math.rad(-6.589), math.rad(18.793)),
  218. ["Head"] = {
  219. CFrame = CFrame.Angles(math.rad(19.079), math.rad(-11.345), math.rad(25.726)),
  220. },
  221. ["Left Leg"] = {
  222. CFrame = CFrame.new(-0.09, 0.611, 0.3) * CFrame.Angles(math.rad(-25.611), math.rad(63.77), math.rad(37.128)),
  223. },
  224. ["Right Arm"] = {
  225. CFrame = CFrame.new(0.499, -0.5, -0.018) * CFrame.Angles(math.rad(-45.206), math.rad(21.887), math.rad(82.621)),
  226. },
  227. ["Right Leg"] = {
  228. CFrame = CFrame.new(0.161, 0.676, 0.21) * CFrame.Angles(math.rad(-22.173), math.rad(-26.814), math.rad(-16.73)),
  229. },
  230. ["Left Arm"] = {
  231. CFrame = CFrame.new(-0.403, -0.631, 0.322) * CFrame.Angles(math.rad(-73.453), math.rad(-9.969), math.rad(-60.275)),
  232. },
  233. },
  234. },
  235. },
  236. [0.333] = {
  237. ["HumanoidRootPart"] = {
  238. ["Torso"] = {
  239. CFrame = CFrame.new(0.035, -0.086, -0.863) * CFrame.Angles(math.rad(-15.584), math.rad(-6.589), math.rad(18.793)),
  240. ["Head"] = {
  241. CFrame = CFrame.Angles(math.rad(17.704), math.rad(-12.032), math.rad(25.382)),
  242. },
  243. ["Left Leg"] = {
  244. CFrame = CFrame.new(-0.09, 0.611, 0.3) * CFrame.Angles(math.rad(-25.611), math.rad(63.77), math.rad(33.06)),
  245. },
  246. ["Right Arm"] = {
  247. CFrame = CFrame.new(0.499, -0.5, -0.018) * CFrame.Angles(math.rad(-48.243), math.rad(22.231), math.rad(83.766)),
  248. },
  249. ["Right Leg"] = {
  250. CFrame = CFrame.new(0.161, 0.676, 0.21) * CFrame.Angles(math.rad(-23.262), math.rad(-26.528), math.rad(-17.246)),
  251. },
  252. ["Left Arm"] = {
  253. CFrame = CFrame.new(-0.381, -0.639, 0.36) * CFrame.Angles(math.rad(-73.453), math.rad(-9.969), math.rad(-60.275)),
  254. },
  255. },
  256. },
  257. },
  258. [0.5] = {
  259. ["HumanoidRootPart"] = {
  260. ["Torso"] = {
  261. CFrame = CFrame.new(0, 0, -0.633) * CFrame.Angles(math.rad(4.412), math.rad(0.516), math.rad(-21.601)),
  262. ["Head"] = {
  263. CFrame = CFrame.Angles(math.rad(17.418), 0, 0),
  264. },
  265. ["Left Leg"] = {
  266. CFrame = CFrame.new(-0.215, 0.592, -0.065) * CFrame.Angles(math.rad(-6.761), math.rad(25.096), math.rad(-2.922)),
  267. },
  268. ["Right Arm"] = {
  269. CFrame = CFrame.new(1.066, -0.635, 0.37) * CFrame.Angles(math.rad(-60.504), math.rad(-13.694), math.rad(164.84)),
  270. },
  271. ["Right Leg"] = {
  272. CFrame = CFrame.new(0.188, 0.564, 0.136) * CFrame.Angles(math.rad(-7.85), math.rad(-16.501), math.rad(5.214)),
  273. },
  274. ["Left Arm"] = {
  275. CFrame = CFrame.new(-1.177, -0.481, 0.618) * CFrame.Angles(math.rad(-65.661), math.rad(25.955), math.rad(-172.059)),
  276. },
  277. },
  278. },
  279. },
  280. [0.583] = {
  281. ["HumanoidRootPart"] = {
  282. ["Torso"] = {
  283. CFrame = CFrame.new(0.001, -0.005, -0.573) * CFrame.Angles(math.rad(4.412), math.rad(0.516), math.rad(-21.601)),
  284. ["Head"] = {
  285. CFrame = CFrame.Angles(math.rad(18.678), math.rad(1.833), math.rad(-0.057)),
  286. },
  287. ["Left Leg"] = {
  288. CFrame = CFrame.new(-0.215, 0.592, -0.065) * CFrame.Angles(math.rad(-7.62), math.rad(25.153), math.rad(-2.521)),
  289. },
  290. ["Right Arm"] = {
  291. CFrame = CFrame.new(1.066, -0.635, 0.37) * CFrame.Angles(math.rad(-59.015), math.rad(-8.422), math.rad(165.126)),
  292. },
  293. ["Right Leg"] = {
  294. CFrame = CFrame.new(0.189, 0.55, 0.138) * CFrame.Angles(math.rad(-6.589), math.rad(-16.387), math.rad(5.615)),
  295. },
  296. ["Left Arm"] = {
  297. CFrame = CFrame.new(-1.177, -0.481, 0.618) * CFrame.Angles(math.rad(-64.63), math.rad(19.022), math.rad(-172.403)),
  298. },
  299. },
  300. },
  301. },
  302. [0.667] = {
  303. ["HumanoidRootPart"] = {
  304. ["Torso"] = {
  305. CFrame = CFrame.new(0.09, -0.127, -0.839) * CFrame.Angles(math.rad(-7.105), math.rad(8.48), math.rad(-34.263)),
  306. ["Head"] = {
  307. CFrame = CFrame.new(-0.001, -0.002, -0.031) * CFrame.Angles(math.rad(-1.203), math.rad(1.776), math.rad(0.573)),
  308. },
  309. ["Left Leg"] = {
  310. CFrame = CFrame.new(-0.098, 0.724, -0.004) * CFrame.Angles(math.rad(-24.752), math.rad(50.936), math.rad(8.079)),
  311. },
  312. ["Right Arm"] = {
  313. CFrame = CFrame.new(0.485, -0.569, 0.1) * CFrame.Angles(math.rad(-72.422), math.rad(-1.833), math.rad(64.515)),
  314. },
  315. ["Right Leg"] = {
  316. CFrame = CFrame.new(0.195, 0.632, 0.13) * CFrame.Angles(math.rad(-7.62), math.rad(-28.132), math.rad(-4.756)),
  317. },
  318. ["Left Arm"] = {
  319. CFrame = CFrame.new(-0.777, -0.593, 0.318) * CFrame.Angles(math.rad(-78.553), math.rad(-16.788), math.rad(-94.882)),
  320. },
  321. },
  322. },
  323. },
  324. [0.75] = {
  325. ["HumanoidRootPart"] = {
  326. ["Torso"] = {
  327. CFrame = CFrame.new(0.09, -0.127, -0.839) * CFrame.Angles(math.rad(-5.787), math.rad(7.62), math.rad(-34.435)),
  328. ["Head"] = {
  329. CFrame = CFrame.new(-0.001, -0.002, -0.031) * CFrame.Angles(math.rad(0.802), math.rad(1.776), math.rad(0.516)),
  330. },
  331. ["Left Leg"] = {
  332. CFrame = CFrame.new(-0.098, 0.724, -0.004) * CFrame.Angles(math.rad(-25.955), math.rad(55.577), math.rad(8.995)),
  333. },
  334. ["Right Arm"] = {
  335. CFrame = CFrame.new(0.625, -0.572, 0.17) * CFrame.Angles(math.rad(-72.422), math.rad(-1.833), math.rad(64.515)),
  336. },
  337. ["Right Leg"] = {
  338. CFrame = CFrame.new(0.193, 0.596, 0.133) * CFrame.Angles(math.rad(-7.62), math.rad(-28.132), math.rad(-4.756)),
  339. },
  340. ["Left Arm"] = {
  341. CFrame = CFrame.new(-0.876, -0.62, 0.303) * CFrame.Angles(math.rad(-78.553), math.rad(-16.788), math.rad(-94.882)),
  342. },
  343. },
  344. },
  345. },
  346. [1] = {
  347. ["HumanoidRootPart"] = {
  348. ["Torso"] = {
  349. CFrame = CFrame.new(0, 0, -0.633) * CFrame.Angles(math.rad(4.412), math.rad(0.516), math.rad(-21.601)),
  350. ["Head"] = {
  351. CFrame = CFrame.Angles(math.rad(17.418), 0, 0),
  352. },
  353. ["Left Leg"] = {
  354. CFrame = CFrame.new(-0.215, 0.592, -0.065) * CFrame.Angles(math.rad(-6.761), math.rad(25.096), math.rad(-2.922)),
  355. },
  356. ["Right Arm"] = {
  357. CFrame = CFrame.new(1.066, -0.635, 0.37) * CFrame.Angles(math.rad(-60.504), math.rad(-13.694), math.rad(164.84)),
  358. },
  359. ["Right Leg"] = {
  360. CFrame = CFrame.new(0.188, 0.564, 0.136) * CFrame.Angles(math.rad(-7.85), math.rad(-16.501), math.rad(5.214)),
  361. },
  362. ["Left Arm"] = {
  363. CFrame = CFrame.new(-1.177, -0.481, 0.618) * CFrame.Angles(math.rad(-65.661), math.rad(25.955), math.rad(-172.059)),
  364. },
  365. },
  366. },
  367. },
  368. }
  369. }
  370. local number=0
  371.  
  372. LastTimeSetTotal=0
  373. local savec0 = {}
  374.  
  375.  
  376. GetAnimCF = function(Anim,limb,Time)
  377.  
  378. local GA = nil
  379. coroutine.resume(coroutine.create(function()
  380. local anim = Anim
  381. if limb == "Torso" then
  382. GA = Anim.Keyframes[Time]["HumanoidRootPart"]["Torso"].CFrame
  383. else
  384. GA = Anim.Keyframes[Time]["HumanoidRootPart"]["Torso"][""..limb].CFrame
  385.  
  386. end
  387. end))
  388. return GA
  389. end
  390.  
  391.  
  392.  
  393. local model = nil
  394. if owner ~= nil then
  395. model = Player.Character
  396. else
  397. model = Player.Character
  398. end
  399. function GatherAllInstances(Parent)
  400. local Instances = {}
  401. local function GatherInstances(Parent)
  402. for i, v in pairs(Parent:GetChildren()) do
  403. GatherInstances(v)
  404. table.insert(Instances, v)
  405. end
  406. end
  407. GatherInstances(Parent)
  408. return Instances
  409. end
  410.  
  411.  
  412.  
  413.  
  414. for i, v in pairs(GatherAllInstances(model)) do
  415. if v:IsA("BasePart") then
  416. for i, v2 in pairs(GatherAllInstances(model)) do
  417. if v2:IsA("Motor6D") and v2.Part1.Name == v.Name then
  418.  
  419. local saveCF = v2.C0
  420. table.insert(savec0,{v2.Name,saveCF})
  421.  
  422. end
  423. end
  424. end end
  425.  
  426.  
  427.  
  428.  
  429. RunAnim = function(anim,Time)
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436. local speed = Time-LastTimeSetTotal
  437.  
  438. speed = speed*AnimationSpeed
  439. LastTimeSetTotal = Time
  440.  
  441.  
  442.  
  443. local doing = true
  444.  
  445. coroutine.resume(coroutine.create(function()
  446. for i, v in pairs(GatherAllInstances(model)) do
  447. if v:IsA("BasePart") then
  448. for i, v2 in pairs(GatherAllInstances(model)) do
  449. if v2:IsA("Motor6D") and v2.Part1.Name == v.Name then
  450.  
  451. local GotAnim = GetAnimCF(anim,v.Name,Time)
  452. local saveCF = nil
  453. for i,v3 in pairs(savec0) do
  454. if v2.name == v3[1] then
  455. saveCF = v3[2]
  456. end
  457. end
  458.  
  459.  
  460. if GotAnim ~= nil and saveCF ~= nil then
  461.  
  462.  
  463. coroutine.resume(coroutine.create(function()
  464. while doing == true do
  465. swait()
  466. local tweenservice = game:GetService("TweenService")
  467. local TweenInformation = TweenInfo.new(0,Enum.EasingStyle.Quad,Enum.EasingDirection.In,0,
  468. false,
  469. 0)
  470. tweenservice:Create(v2,TweenInformation,{C0 = v2.C0:lerp(saveCF*GotAnim,SmoothTime *speed)}):Play()
  471. ---v2.C0 = v2.C0:lerp(saveCF*GotAnim,SmoothTime *speed)
  472. end
  473.  
  474. end))
  475.  
  476.  
  477. end
  478.  
  479. end
  480.  
  481. end
  482. end end
  483.  
  484.  
  485. end))
  486. wait(speed)
  487. doing = false
  488. end
  489. while true do
  490. RunAnim(Anim,0)
  491. RunAnim(Anim,0.083)
  492. RunAnim(Anim,0.25)
  493. RunAnim(Anim,0.333)
  494. RunAnim(Anim,0.5)
  495. RunAnim(Anim,0.583)
  496. RunAnim(Anim,0.667)
  497. RunAnim(Anim,0.75)
  498. RunAnim(Anim,1)
  499. -----------
  500. LastTimeSetTotal = .1
  501. Humanoid.MaxHealth = "inf"
  502. Humanoid.Health = "inf"
  503.  
  504. refit()
  505. end
  506.  
Add Comment
Please, Sign In to add comment