SHARE
TWEET

Untitled

a guest May 19th, 2019 131 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. --https://github.com/Mokiros/roblox-FE-compatibility
  10. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  11. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  12. local RealPlayer = Player
  13. do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end
  14.  
  15.  
  16. Effects = { }
  17. local Player = game:service'Players'.localPlayer
  18. local chara = Player.Character
  19. local Humanoid = chara:FindFirstChildOfClass("Humanoid")
  20. local Mouse = Player:GetMouse()
  21. local LeftArm = chara["Left Arm"]
  22. local RightArm = chara["Right Arm"]
  23. local LeftLeg = chara["Left Leg"]
  24. local RightLeg = chara["Right Leg"]
  25. local Head = chara.Head
  26. local Torso = chara.Torso
  27. local Camera = game.Workspace.CurrentCamera
  28. local RootPart = chara.HumanoidRootPart
  29. local RootJoint = RootPart.RootJoint
  30. local attack = false
  31. local Anim = 'Idle'
  32. local attacktype = 1
  33. local delays = false
  34. local play = true
  35. local targetted = nil
  36. local Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
  37. local velocity = RootPart.Velocity.y
  38. local sine = 0
  39. local change = 1
  40. local doe = 0
  41. local Create = LoadLibrary("RbxUtility").Create
  42. Humanoid.WalkSpeed = 2
  43.  
  44. Humanoid.Animator.Parent = nil
  45. chara.Animate.Parent = nil
  46.  
  47. local newMotor = function(part0, part1, c0, c1)
  48.     local w = Create('Motor'){
  49.         Parent = part0,
  50.         Part0 = part0,
  51.         Part1 = part1,
  52.         C0 = c0,
  53.         C1 = c1,
  54.     }
  55.     return w
  56. end
  57.  
  58. function clerp(a, b, t)
  59.     return a:lerp(b, t)
  60. end
  61.  
  62. RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
  63. NeckCF = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  64.  
  65. local RW = newMotor(Torso, RightArm, CFrame.new(1.5, 0, 0), CFrame.new(0, 0, 0))
  66. local LW = newMotor(Torso, LeftArm, CFrame.new(-1.5, 0, 0), CFrame.new(0, 0, 0))
  67. local RH = newMotor(Torso, RightLeg, CFrame.new(.5, -2, 0), CFrame.new(0, 0, 0))
  68. local LH = newMotor(Torso, LeftLeg, CFrame.new(-.5, -2, 0), CFrame.new(0, 0, 0))
  69. RootJoint.C1 = CFrame.new(0, 0, 0)
  70. RootJoint.C0 = CFrame.new(0, 0, 0)
  71. Torso.Neck.C1 = CFrame.new(0, 0, 0)
  72. Torso.Neck.C0 = CFrame.new(0, 1.5, 0)
  73.  
  74. local rarmc1 = RW.C1
  75. local larmc1 = LW.C1
  76. local rlegc1 = RH.C1
  77. local llegc1 = LH.C1
  78.  
  79. local resetc1 = false
  80.  
  81. function PlayAnimationFromTable(table, speed, bool)
  82.     RootJoint.C0 = clerp(RootJoint.C0, table[1], speed)
  83.     Torso.Neck.C0 = clerp(Torso.Neck.C0, table[2], speed)
  84.     RW.C0 = clerp(RW.C0, table[3], speed)
  85.     LW.C0 = clerp(LW.C0, table[4], speed)
  86.     RH.C0 = clerp(RH.C0, table[5], speed)
  87.     LH.C0 = clerp(LH.C0, table[6], speed)
  88.     if bool == true then
  89.         if resetc1 == false then
  90.             resetc1 = true
  91.             RootJoint.C1 = RootJoint.C1
  92.             Torso.Neck.C1 = Torso.Neck.C1
  93.             RW.C1 = rarmc1
  94.             LW.C1 = larmc1
  95.             RH.C1 = rlegc1
  96.             LH.C1 = llegc1
  97.         end
  98.     end
  99. end
  100.  
  101. ArtificialHB = Instance.new("BindableEvent", script)
  102. ArtificialHB.Name = "Heartbeat"
  103. script:WaitForChild("Heartbeat")
  104. frame = 0.03333333333333
  105. tf = 0
  106. allowframeloss = false
  107. tossremainder = false
  108. lastframe = tick()
  109. script.Heartbeat:Fire()
  110. game:GetService("RunService").Heartbeat:connect(function(s, p)
  111.   tf = tf + s
  112.   if tf >= frame then
  113.     if allowframeloss then
  114.       script.Heartbeat:Fire()
  115.       lastframe = tick()
  116.     else
  117.       for i = 1, math.floor(tf / frame) do
  118.         script.Heartbeat:Fire()
  119.       end
  120.       lastframe = tick()
  121.     end
  122.     if tossremainder then
  123.       tf = 0
  124.     else
  125.       tf = tf - frame * math.floor(tf / frame)
  126.     end
  127.   end
  128. end)
  129. function swait(num)
  130.   if num == 0 or num == nil then
  131.     ArtificialHB.Event:wait()
  132.   else
  133.     for i = 0, num do
  134.       ArtificialHB.Event:wait()
  135.     end
  136.   end
  137. end
  138.  
  139. function RemoveOutlines(part)
  140.     part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
  141. end
  142.  
  143. sndid = "rbxassetid://176322684"
  144. sndpi = .7
  145. saun = Instance.new("Sound",Head)
  146. saun.Volume = 1
  147. saun.Pitch = sndpi
  148. saun.SoundId = sndid
  149. saun.Name = "a"
  150. saun.Looped = true
  151. saun:Play()
  152.  
  153. dant = 0
  154.  
  155. Mouse.KeyDown:connect(function(key)
  156. key=key:lower()
  157. if key=="e" then
  158. if dant == 0 then
  159. dant = 1
  160. sndid = "rbxassetid://448668887"
  161. sndpi = 1
  162. elseif dant == 1 then
  163. dant = 0
  164. sndid = "rbxassetid://176322684"
  165. sndpi = .7
  166. end
  167. saun.Pitch = sndpi
  168. saun.SoundId = sndid
  169. saun:Play()
  170. end
  171. end)
  172.  
  173. while true do
  174. if Head:FindFirstChild("a")==nil then
  175. saun = Instance.new("Sound",Head)
  176. saun.Volume = 1
  177. saun.Pitch = sndpi
  178. saun.SoundId = sndid
  179. saun.Name = "a"
  180. saun.Looped = true
  181. saun:Play()
  182. end
  183. if dant == 0 then
  184. for i = 0, 1, 0.25 do
  185. swait()
  186. PlayAnimationFromTable({
  187. CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  188. CFrame.new(0, 1.4999938, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  189. 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),
  190. 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),
  191. CFrame.new(0.5, -2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  192. CFrame.new(-0.5, -2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  193. }, .5, false)
  194. end
  195. for i = 0, 1, 0.25 do
  196. swait()
  197. PlayAnimationFromTable({
  198. CFrame.new(-0.268402338, -0.187939167, 0, 0.939692736, 0.342019886, 0, -0.342019916, 0.939692736, 0, 0, 0, 1),
  199. CFrame.new(-0.409892142, 1.36144388, 0, 0.766044796, -0.642787218, 0, 0.642787218, 0.766044855, 0, 0, 0, 1),
  200. 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),
  201. 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),
  202. CFrame.new(0.951213062, -1.54518354, 0, 0.866025686, -0.499999642, 0, 0.499999642, 0.866025686, 0, 0, 0, 1),
  203. CFrame.new(0.214191973, -1.8503952, 0, 0.766044796, -0.642787218, 0, 0.642787218, 0.766044855, 0, 0, 0, 1),
  204. }, .5, false)
  205. end
  206. for i = 0, 1, 0.25 do
  207. swait()
  208. PlayAnimationFromTable({
  209. CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  210. CFrame.new(0, 1.4999938, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  211. 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),
  212. 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),
  213. CFrame.new(0.5, -2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  214. CFrame.new(-0.5, -2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  215. }, .5, false)
  216. end
  217. for i = 0, 1, 0.25 do
  218. swait()
  219. PlayAnimationFromTable({
  220. CFrame.new(0.268400908, -0.187940732, 0, 0.939692855, -0.342019945, 0, 0.342019975, 0.939692795, 0, 0, 0, 1),
  221. CFrame.new(0.409947664, 1.36144304, 0, 0.766039729, 0.642798781, 0, -0.642787337, 0.766043961, 0, 0, 0, 1),
  222. 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),
  223. 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),
  224. CFrame.new(-0.214235365, -1.8503921, 0, 0.766041398, 0.64279145, 0, -0.64279151, 0.766041279, 0, 0, 0, 1),
  225. CFrame.new(-0.965987146, -1.57677674, 0, 0.866024733, 0.500001609, 0, -0.500001609, 0.866024613, 0, 0, 0, 1),
  226. }, .5, false)
  227. end
  228. elseif dant == 1 then
  229. for i = 0, 1, 0.1 do
  230. swait()
  231. PlayAnimationFromTable({
  232. CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  233. CFrame.new(0, 1.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  234. CFrame.new(1.09999847, 1.1920929e-07, -0.600001514, 0, 0, 1, 0.173647985, 0.984807849, 0, -0.984807849, 0.173647985, 0),
  235. CFrame.new(-1.09999847, 1.1920929e-07, -0.600001514, 0, 0, -1, -0.173647985, 0.984807849, 0, 0.984807849, 0.173647985, 0),
  236. CFrame.new(0.5, -1.99999881, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  237. CFrame.new(-0.5, -1.99999881, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  238. }, .2, false)
  239. end
  240. for i = 0, 1, 0.1 do
  241. swait()
  242. PlayAnimationFromTable({
  243. CFrame.new(-0.0436433926, 0, -0.113613628, 0.64278698, 0, -0.766044974, 0, 1, 0, 0.766044974, 0, 0.64278698),
  244. CFrame.new(0, 1.49999809, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  245. CFrame.new(1.09998989, 1, -0.599998474, 0, 0, 1, 1, 0, 0, 0, 1, 0),
  246. CFrame.new(-1.10000229, 1, -0.599998474, 0, 0, -1, -1, 0, 0, 0, 1, 0),
  247. CFrame.new(0.499988556, -1.99999797, -3.81469727e-06, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  248. CFrame.new(-0.500012398, -1.78038144, -0.819608092, 1, 0, 1.49011612e-08, 0, 0.499999046, -0.866025984, 0, 0.866026044, 0.499999046),
  249. }, .2, false)
  250. end
  251. for i = 0, 1, 0.1 do
  252. swait()
  253. PlayAnimationFromTable({
  254. CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  255. CFrame.new(0, 1.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  256. CFrame.new(1.09999847, 1.1920929e-07, -0.600001514, 0, 0, 1, 0.173647985, 0.984807849, 0, -0.984807849, 0.173647985, 0),
  257. CFrame.new(-1.09999847, 1.1920929e-07, -0.600001514, 0, 0, -1, -0.173647985, 0.984807849, 0, 0.984807849, 0.173647985, 0),
  258. CFrame.new(0.5, -1.99999881, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  259. CFrame.new(-0.5, -1.99999881, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  260. }, .2, false)
  261. end
  262. for i = 0, 1, 0.1 do
  263. swait()
  264. PlayAnimationFromTable({
  265. CFrame.new(0.261404335, 0, -0.167939946, 0.76604414, 0, 0.642788053, 0, 1, 0, -0.642788053, 0, 0.76604414),
  266. CFrame.new(0, 1.49999285, 0, 1.00000012, 0, 0, 0, 1, 0, 0, 0, 1.00000012),
  267. CFrame.new(1.10000622, 0.999999046, -0.599996626, 0, 0, 1.00000012, 1, 0, 0, 0, 1.00000012, 0),
  268. CFrame.new(-1.09999859, 0.999999046, -0.59999758, 0, 0, -1.00000012, -1, 0, 0, 0, 1.00000012, 0),
  269. 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),
  270. CFrame.new(-0.500003874, -1.99999893, 3.81469772e-06, 1.00000012, 0, 0, 0, 1, 0, 0, 0, 1.00000012),
  271. }, .2, false)
  272. end
  273. end
  274. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top