Advertisement
wamandnj

Untitled

Oct 17th, 2018
226
0
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. -- This script has been converted to FE by iPxter
  8.  
  9.  
  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. do
  13. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  14. script.Parent = Player.Character
  15.  
  16. --RemoteEvent for communicating
  17. local Event = Instance.new("RemoteEvent")
  18. Event.Name = "UserInput_Event"
  19.  
  20. --Fake event to make stuff like Mouse.KeyDown work
  21. local function fakeEvent()
  22. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  23. t.connect = t.Connect
  24. return t
  25. end
  26.  
  27. --Creating fake input objects with fake variables
  28. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  29. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  30. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  31. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  32. end}
  33. --Merged 2 functions into one by checking amount of arguments
  34. CAS.UnbindAction = CAS.BindAction
  35.  
  36. --This function will trigger the events that have been :Connect()'ed
  37. local function te(self,ev,...)
  38. local t = m[ev]
  39. if t and t._fakeEvent and t.Function then
  40. t.Function(...)
  41. end
  42. end
  43. m.TrigEvent = te
  44. UIS.TrigEvent = te
  45.  
  46. Event.OnServerEvent:Connect(function(plr,io)
  47. if plr~=Player then return end
  48. if io.isMouse then
  49. m.Target = io.Target
  50. m.Hit = io.Hit
  51. else
  52. local b = io.UserInputState == Enum.UserInputState.Begin
  53. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  54. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  55. end
  56. for _,t in pairs(CAS.Actions) do
  57. for _,k in pairs(t.Keys) do
  58. if k==io.KeyCode then
  59. t.Function(t.Name,io.UserInputState,io)
  60. end
  61. end
  62. end
  63. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  64. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  65. end
  66. end)
  67. Event.Parent = NLS([==[
  68. local Player = game:GetService("Players").LocalPlayer
  69. local Event = script:WaitForChild("UserInput_Event")
  70.  
  71. local UIS = game:GetService("UserInputService")
  72. local input = function(io,a)
  73. if a then return end
  74. --Since InputObject is a client-side instance, we create and pass table instead
  75. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  76. end
  77. UIS.InputBegan:Connect(input)
  78. UIS.InputEnded:Connect(input)
  79.  
  80. local Mouse = Player:GetMouse()
  81. local h,t
  82. --Give the server mouse data 30 times every second, but only if the values changed
  83. --If player is not moving their mouse, client won't fire events
  84. while wait(1/30) do
  85. if h~=Mouse.Hit or t~=Mouse.Target then
  86. h,t=Mouse.Hit,Mouse.Target
  87. Event:FireServer({isMouse=true,Target=t,Hit=h})
  88. end
  89. end]==],Player.Character)
  90. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  91. end
  92.  
  93. wait(1/60)
  94. Effects = { }
  95. local Player = owner
  96. local chara = Player.Character
  97. local Humanoid = chara:FindFirstChildOfClass("Humanoid")
  98. local LeftArm = chara["Left Arm"]
  99. local RightArm = chara["Right Arm"]
  100. local LeftLeg = chara["Left Leg"]
  101. local RightLeg = chara["Right Leg"]
  102. local Head = chara.Head
  103. local Torso = chara.Torso
  104. local Camera = game.Workspace.CurrentCamera
  105. local RootPart = chara.HumanoidRootPart
  106. local RootJoint = RootPart.RootJoint
  107. local attack = false
  108. local Anim = 'Idle'
  109. local attacktype = 1
  110. local delays = false
  111. local play = true
  112. local targetted = nil
  113. local Torsovelocity = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
  114. local velocity = RootPart.Velocity.y
  115. local sine = 0
  116. local change = 1
  117. local doe = 0
  118. local Create = LoadLibrary("RbxUtility").Create
  119. Humanoid.WalkSpeed = 2
  120.  
  121. Humanoid.Animator.Parent = nil
  122. chara.Animate.Parent = nil
  123.  
  124. local newMotor = function(part0, part1, c0, c1)
  125. local w = Create('Motor'){
  126. Parent = part0,
  127. Part0 = part0,
  128. Part1 = part1,
  129. C0 = c0,
  130. C1 = c1,
  131. }
  132. return w
  133. end
  134.  
  135. function clerp(a, b, t)
  136. return a:lerp(b, t)
  137. end
  138.  
  139. RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
  140. NeckCF = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  141.  
  142. local RW = newMotor(Torso, RightArm, CFrame.new(1.5, 0, 0), CFrame.new(0, 0, 0))
  143. local LW = newMotor(Torso, LeftArm, CFrame.new(-1.5, 0, 0), CFrame.new(0, 0, 0))
  144. local RH = newMotor(Torso, RightLeg, CFrame.new(.5, -2, 0), CFrame.new(0, 0, 0))
  145. local LH = newMotor(Torso, LeftLeg, CFrame.new(-.5, -2, 0), CFrame.new(0, 0, 0))
  146. RootJoint.C1 = CFrame.new(0, 0, 0)
  147. RootJoint.C0 = CFrame.new(0, 0, 0)
  148. Torso.Neck.C1 = CFrame.new(0, 0, 0)
  149. Torso.Neck.C0 = CFrame.new(0, 1.5, 0)
  150.  
  151. local rarmc1 = RW.C1
  152. local larmc1 = LW.C1
  153. local rlegc1 = RH.C1
  154. local llegc1 = LH.C1
  155.  
  156. local resetc1 = false
  157.  
  158. function PlayAnimationFromTable(table, speed, bool)
  159. RootJoint.C0 = clerp(RootJoint.C0, table[1], speed)
  160. Torso.Neck.C0 = clerp(Torso.Neck.C0, table[2], speed)
  161. RW.C0 = clerp(RW.C0, table[3], speed)
  162. LW.C0 = clerp(LW.C0, table[4], speed)
  163. RH.C0 = clerp(RH.C0, table[5], speed)
  164. LH.C0 = clerp(LH.C0, table[6], speed)
  165. if bool == true then
  166. if resetc1 == false then
  167. resetc1 = true
  168. RootJoint.C1 = RootJoint.C1
  169. Torso.Neck.C1 = Torso.Neck.C1
  170. RW.C1 = rarmc1
  171. LW.C1 = larmc1
  172. RH.C1 = rlegc1
  173. LH.C1 = llegc1
  174. end
  175. end
  176. end
  177.  
  178. ArtificialHB = Instance.new("BindableEvent", script)
  179. ArtificialHB.Name = "Heartbeat"
  180. script:WaitForChild("Heartbeat")
  181. frame = 0.03333333333333
  182. tf = 0
  183. allowframeloss = false
  184. tossremainder = false
  185. lastframe = tick()
  186. script.Heartbeat:Fire()
  187. game:GetService("RunService").Heartbeat:connect(function(s, p)
  188. tf = tf + s
  189. if tf >= frame then
  190. if allowframeloss then
  191. script.Heartbeat:Fire()
  192. lastframe = tick()
  193. else
  194. for i = 1, math.floor(tf / frame) do
  195. script.Heartbeat:Fire()
  196. end
  197. lastframe = tick()
  198. end
  199. if tossremainder then
  200. tf = 0
  201. else
  202. tf = tf - frame * math.floor(tf / frame)
  203. end
  204. end
  205. end)
  206. function swait(num)
  207. if num == 0 or num == nil then
  208. ArtificialHB.Event:wait()
  209. else
  210. for i = 0, num do
  211. ArtificialHB.Event:wait()
  212. end
  213. end
  214. end
  215.  
  216. function RemoveOutlines(part)
  217. part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
  218. end
  219.  
  220. sndid = "rbxassetid://176322684"
  221. sndpi = .7
  222. saun = Instance.new("Sound",Head)
  223. saun.Volume = 1
  224. saun.Pitch = sndpi
  225. saun.SoundId = sndid
  226. saun.Name = "a"
  227. saun.Looped = true
  228. saun:Play()
  229.  
  230. dant = 0
  231.  
  232. Mouse.KeyDown:connect(function(key)
  233. key=key:lower()
  234. if key=="e" then
  235. if dant == 0 then
  236. dant = 1
  237. sndid = "rbxassetid://448668887"
  238. sndpi = 1
  239. elseif dant == 1 then
  240. dant = 0
  241. sndid = "rbxassetid://176322684"
  242. sndpi = .7
  243. end
  244. saun.Pitch = sndpi
  245. saun.SoundId = sndid
  246. saun:Play()
  247. end
  248. end)
  249.  
  250. while true do
  251. if Head:FindFirstChild("a")==nil then
  252. saun = Instance.new("Sound",Head)
  253. saun.Volume = 1
  254. saun.Pitch = sndpi
  255. saun.SoundId = sndid
  256. saun.Name = "a"
  257. saun.Looped = true
  258. saun:Play()
  259. end
  260. if dant == 0 then
  261. for i = 0, 1, 0.25 do
  262. swait()
  263. PlayAnimationFromTable({
  264. CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  265. CFrame.new(0, 1.4999938, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  266. 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),
  267. 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),
  268. CFrame.new(0.5, -2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  269. CFrame.new(-0.5, -2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  270. }, .5, false)
  271. end
  272. for i = 0, 1, 0.25 do
  273. swait()
  274. PlayAnimationFromTable({
  275. CFrame.new(-0.268402338, -0.187939167, 0, 0.939692736, 0.342019886, 0, -0.342019916, 0.939692736, 0, 0, 0, 1),
  276. CFrame.new(-0.409892142, 1.36144388, 0, 0.766044796, -0.642787218, 0, 0.642787218, 0.766044855, 0, 0, 0, 1),
  277. 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),
  278. 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),
  279. CFrame.new(0.951213062, -1.54518354, 0, 0.866025686, -0.499999642, 0, 0.499999642, 0.866025686, 0, 0, 0, 1),
  280. CFrame.new(0.214191973, -1.8503952, 0, 0.766044796, -0.642787218, 0, 0.642787218, 0.766044855, 0, 0, 0, 1),
  281. }, .5, false)
  282. end
  283. for i = 0, 1, 0.25 do
  284. swait()
  285. PlayAnimationFromTable({
  286. CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  287. CFrame.new(0, 1.4999938, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  288. 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),
  289. 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),
  290. CFrame.new(0.5, -2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  291. CFrame.new(-0.5, -2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  292. }, .5, false)
  293. end
  294. for i = 0, 1, 0.25 do
  295. swait()
  296. PlayAnimationFromTable({
  297. CFrame.new(0.268400908, -0.187940732, 0, 0.939692855, -0.342019945, 0, 0.342019975, 0.939692795, 0, 0, 0, 1),
  298. CFrame.new(0.409947664, 1.36144304, 0, 0.766039729, 0.642798781, 0, -0.642787337, 0.766043961, 0, 0, 0, 1),
  299. 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),
  300. 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),
  301. CFrame.new(-0.214235365, -1.8503921, 0, 0.766041398, 0.64279145, 0, -0.64279151, 0.766041279, 0, 0, 0, 1),
  302. CFrame.new(-0.965987146, -1.57677674, 0, 0.866024733, 0.500001609, 0, -0.500001609, 0.866024613, 0, 0, 0, 1),
  303. }, .5, false)
  304. end
  305. elseif dant == 1 then
  306. for i = 0, 1, 0.1 do
  307. swait()
  308. PlayAnimationFromTable({
  309. CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  310. CFrame.new(0, 1.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  311. CFrame.new(1.09999847, 1.1920929e-07, -0.600001514, 0, 0, 1, 0.173647985, 0.984807849, 0, -0.984807849, 0.173647985, 0),
  312. CFrame.new(-1.09999847, 1.1920929e-07, -0.600001514, 0, 0, -1, -0.173647985, 0.984807849, 0, 0.984807849, 0.173647985, 0),
  313. CFrame.new(0.5, -1.99999881, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  314. CFrame.new(-0.5, -1.99999881, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  315. }, .2, false)
  316. end
  317. for i = 0, 1, 0.1 do
  318. swait()
  319. PlayAnimationFromTable({
  320. CFrame.new(-0.0436433926, 0, -0.113613628, 0.64278698, 0, -0.766044974, 0, 1, 0, 0.766044974, 0, 0.64278698),
  321. CFrame.new(0, 1.49999809, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  322. CFrame.new(1.09998989, 1, -0.599998474, 0, 0, 1, 1, 0, 0, 0, 1, 0),
  323. CFrame.new(-1.10000229, 1, -0.599998474, 0, 0, -1, -1, 0, 0, 0, 1, 0),
  324. CFrame.new(0.499988556, -1.99999797, -3.81469727e-06, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  325. CFrame.new(-0.500012398, -1.78038144, -0.819608092, 1, 0, 1.49011612e-08, 0, 0.499999046, -0.866025984, 0, 0.866026044, 0.499999046),
  326. }, .2, false)
  327. end
  328. for i = 0, 1, 0.1 do
  329. swait()
  330. PlayAnimationFromTable({
  331. CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  332. CFrame.new(0, 1.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  333. CFrame.new(1.09999847, 1.1920929e-07, -0.600001514, 0, 0, 1, 0.173647985, 0.984807849, 0, -0.984807849, 0.173647985, 0),
  334. CFrame.new(-1.09999847, 1.1920929e-07, -0.600001514, 0, 0, -1, -0.173647985, 0.984807849, 0, 0.984807849, 0.173647985, 0),
  335. CFrame.new(0.5, -1.99999881, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  336. CFrame.new(-0.5, -1.99999881, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  337. }, .2, false)
  338. end
  339. for i = 0, 1, 0.1 do
  340. swait()
  341. PlayAnimationFromTable({
  342. CFrame.new(0.261404335, 0, -0.167939946, 0.76604414, 0, 0.642788053, 0, 1, 0, -0.642788053, 0, 0.76604414),
  343. CFrame.new(0, 1.49999285, 0, 1.00000012, 0, 0, 0, 1, 0, 0, 0, 1.00000012),
  344. CFrame.new(1.10000622, 0.999999046, -0.599996626, 0, 0, 1.00000012, 1, 0, 0, 0, 1.00000012, 0),
  345. CFrame.new(-1.09999859, 0.999999046, -0.59999758, 0, 0, -1.00000012, -1, 0, 0, 0, 1.00000012, 0),
  346. 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),
  347. CFrame.new(-0.500003874, -1.99999893, 3.81469772e-06, 1.00000012, 0, 0, 0, 1, 0, 0, 0, 1.00000012),
  348. }, .2, false)
  349. end
  350. end
  351. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement