Advertisement
XSleepyDemonX_17

piAno

Mar 14th, 2020
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.89 KB | None | 0 0
  1. print("FE code by Starzozero, Thanks to him!")
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do
  6. print("FE Compatibility code by Mokiros, Edited by StarzoZero")
  7. local rp = RealPlayer
  8. script.Parent = rp.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent then
  34. for _,f in pairs(t.Functions) do
  35. f(...)
  36. end
  37. end
  38. end
  39. m.TrigEvent = te
  40. UIS.TrigEvent = te
  41.  
  42. Event.OnServerEvent:Connect(function(plr,io)
  43. if plr~=rp then return end
  44. m.Target = io.Target
  45. m.Hit = io.Hit
  46. if not io.isMouse then
  47. local b = io.UserInputState == Enum.UserInputState.Begin
  48. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  49. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  50. end
  51. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  52. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  53. end
  54. for _,t in pairs(CAS.Actions) do
  55. for _,k in pairs(t.Keys) do
  56. if k==io.KeyCode then
  57. t.Function(t.Name,io.UserInputState,io)
  58. end
  59. end
  60. end
  61. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  62. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  63. end
  64. end)
  65. Event.Parent = NLS([==[
  66. local Player = game:GetService("Players").LocalPlayer
  67. local Event = script:WaitForChild("UserInput_Event")
  68. local Mouse = Player:GetMouse()
  69. local UIS = game:GetService("UserInputService")
  70. local input = function(io,a)
  71. if a then return end
  72. --Since InputObject is a client-side instance, we create and pass table instead
  73. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  74. end
  75. UIS.InputBegan:Connect(input)
  76. UIS.InputEnded:Connect(input)
  77. local h,t
  78. --Give the server mouse data 30 times every second, but only if the values changed
  79. --If player is not moving their mouse, client won't fire events
  80. while wait(1/30) do
  81. if h~=Mouse.Hit or t~=Mouse.Target then
  82. h,t=Mouse.Hit,Mouse.Target
  83. Event:FireServer({isMouse=true,Target=t,Hit=h})
  84. end
  85. end]==],Player.Character)
  86.  
  87. ----Sandboxed game object that allows the usage of client-side methods and services
  88. --Real game object
  89. local _rg = game
  90.  
  91. --Metatable for fake service
  92. local fsmt = {
  93. __index = function(self,k)
  94. local s = rawget(self,"_RealService")
  95. if s then
  96. return typeof(s[k])=="function"
  97. and function(_,...)return s[k](s,...)end or s[k]
  98. end
  99. end,
  100. __newindex = function(self,k,v)
  101. local s = rawget(self,"_RealService")
  102. if s then s[k]=v end
  103. end
  104. }
  105. local function FakeService(t,RealService)
  106. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  107. return setmetatable(t,fsmt)
  108. end
  109.  
  110. --Fake game object
  111. local g = {
  112. GetService = function(self,s)
  113. return rawget(self,s) or _rg:GetService(s)
  114. end,
  115. Players = FakeService({
  116. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  117. },"Players"),
  118. UserInputService = FakeService(UIS,"UserInputService"),
  119. ContextActionService = FakeService(CAS,"ContextActionService"),
  120. RunService = FakeService({
  121. _btrs = {},
  122. RenderStepped = _rg:GetService("RunService").Heartbeat,
  123. BindToRenderStep = function(self,name,_,fun)
  124. self._btrs[name] = self.Heartbeat:Connect(fun)
  125. end,
  126. UnbindFromRenderStep = function(self,name)
  127. self._btrs[name]:Disconnect()
  128. end,
  129. },"RunService")
  130. }
  131. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  132. g.service = g.GetService
  133. FakeService(g,game)
  134. --Changing owner to fake player object to support owner:GetMouse()
  135. game,owner = g,g.Players.LocalPlayer
  136. end
  137.  
  138. warn("Z to start playing.")
  139. warn("C - Beethoven's moon sonata.")
  140. warn("V - Giorno meme")
  141. warn("M - InSaNiTy")
  142. warn("L - Can Can 1")
  143. warn("G - Can Can 2")
  144. warn("N - Megalovania")
  145. warn("B - We ArE NuMbEr LaSt")
  146. warn("X to stop.")
  147. warn("Made by Reset5017577.Edited by Xavier(added Giorno, InSaNiTy and Megalovania(b))")
  148.  
  149. plr = game.Players.LocalPlayer
  150. char = plr.Character
  151. mouse = plr:GetMouse()
  152. hum = char.HumanoidRootPart
  153. root = char.Torso
  154. left = char["Left Arm"]
  155. right = char["Right Arm"]
  156. rightl = char["Right Leg"]
  157. leftl = char["Left Leg"]
  158. tors = char["Torso"]
  159. piano = false
  160.  
  161. MUSIK2 = Instance.new("Sound",tors)
  162. MUSIK2.Playing = false
  163. MUSIK2.Looped = true
  164. MUSIK2.Pitch = 1
  165. MUSIK2.SoundId = "rbxassetid://142912516"
  166. MUSIK2.Volume = 10
  167.  
  168. MUSIK5 = Instance.new("Sound",tors)
  169. MUSIK5.Playing = false
  170. MUSIK5.Looped = true
  171. MUSIK5.Pitch = 1
  172. MUSIK5.SoundId = "rbxassetid://35930009"
  173. MUSIK5.Volume = 10
  174.  
  175. MUSIK8 = Instance.new("Sound",tors)
  176. MUSIK8.Playing = false
  177. MUSIK8.Looped = true
  178. MUSIK8.Pitch = 1
  179. MUSIK8.SoundId = "rbxassetid://1482802493"
  180. MUSIK8.Volume = 10
  181.  
  182. MUSIK9 = Instance.new("Sound",tors)
  183. MUSIK8.Playing = false
  184. MUSIK8.Looped = true
  185. MUSIK8.Pitch = 1
  186. MUSIK8.SoundId = "rbxassetid://2657605534"
  187. MUSIK8.Volume = 10
  188.  
  189.  
  190.  
  191. MUSIK6 = Instance.new("Sound",tors)
  192. MUSIK6.Playing = false
  193. MUSIK6.Looped = true
  194. MUSIK6.Pitch = 1
  195. MUSIK6.SoundId = "rbxassetid://2257648420"
  196. MUSIK6.Volume = 10
  197.  
  198.  
  199. MUSIK7 = Instance.new("Sound",tors)
  200. MUSIK7.Playing = false
  201. MUSIK7.Looped = true
  202. MUSIK7.Pitch = 1
  203. MUSIK7.SoundId = "rbxassetid://3951847031"
  204. MUSIK7.Volume = 10
  205.  
  206.  
  207. MUSIK = Instance.new("Sound",tors)
  208. MUSIK.Playing = false
  209. MUSIK.Looped = true
  210. MUSIK.Pitch = 1
  211. MUSIK.SoundId = "rbxassetid://4480615248"
  212. MUSIK.Volume = 10
  213.  
  214. MUSIK3 = Instance.new("Sound",tors)
  215. MUSIK3.Playing = false
  216. MUSIK3.Looped = true
  217. MUSIK3.Pitch = 1
  218. MUSIK3.SoundId = "rbxassetid://1307085614"
  219. MUSIK3.Volume = 10
  220.  
  221. MUSIK4 = Instance.new("Sound",tors)
  222. MUSIK4.Playing = false
  223. MUSIK4.Looped = true
  224. MUSIK4.Pitch = 1
  225. MUSIK4.SoundId = "rbxassetid://190835390"
  226. MUSIK4.Volume = 10
  227.  
  228. gutf = Instance.new("Part")
  229. gutf.Parent = tors
  230. gutf.Size = Vector3.new(1, 1, 1)
  231. gutf.CanCollide = false
  232.  
  233. wldf = Instance.new("Weld",owner.Character)
  234. wldf.Parent = gutf
  235. wldf.Part0 = gutf
  236. wldf.Part1 = root
  237. wldf.C0 = CFrame.new(0, 0.42,-3.5)
  238. wldf.C1 = CFrame.Angles(0, 9.45, 0)
  239.  
  240. utm = Instance.new("SpecialMesh",gutf)
  241. utm.MeshId = "rbxassetid://280038600"
  242. utm.TextureId = "rbxassetid://280038797"
  243. utm.Scale = Vector3.new(1, 1, 1)
  244.  
  245. arm1 = Instance.new("Weld")
  246. arm1.Parent = left
  247. arm1.Part0 = left
  248. arm1.Part1 = root
  249.  
  250. arm2 = Instance.new("Weld")
  251. arm2.Parent = right
  252. arm2.Part0 = right
  253. arm2.Part1 = root
  254.  
  255. arm2.C0 = CFrame.new(1.5, 1, 0.5)
  256. arm2.C1 = CFrame.Angles(20, 0, 0)
  257. arm1.C0 = CFrame.new(-1.5, 1, 0.5)
  258. arm1.C1 = CFrame.Angles(20, 0, 0)
  259.  
  260. function pianop()
  261. char.Humanoid.WalkSpeed = 0
  262. piano = true
  263. MUSIK2:Play()
  264.  
  265. while piano do
  266. wait(0.1)
  267. arm2.C0 = CFrame.new(1.5, 1.3, 0.5)
  268. arm2.C1 = CFrame.Angles(20, 0, 0)
  269. arm1.C0 = CFrame.new(-1.5, 1.3, 0.5)
  270. arm1.C1 = CFrame.Angles(20, 0, 0)
  271. wait(0.1)
  272. arm2.C0 = CFrame.new(1.5, 1, 0.5)
  273. arm2.C1 = CFrame.Angles(20, 0, 0)
  274. arm1.C0 = CFrame.new(-1.5, 1, 0.5)
  275. arm1.C1 = CFrame.Angles(20, 0, 0)
  276. end
  277. end
  278.  
  279. function pianop2()
  280. char.Humanoid.WalkSpeed = 0
  281. piano = true
  282. MUSIK:Play()
  283.  
  284. while piano do
  285. wait(0.3)
  286. arm2.C0 = CFrame.new(1.5, 1.3, 0.5)
  287. arm2.C1 = CFrame.Angles(20, 0, 0)
  288. arm1.C0 = CFrame.new(-1.5, 1.3, 0.5)
  289. arm1.C1 = CFrame.Angles(20, 0, 0)
  290. wait(0.3)
  291. arm2.C0 = CFrame.new(1.5, 1, 0.5)
  292. arm2.C1 = CFrame.Angles(20, 0, 0)
  293. arm1.C0 = CFrame.new(-1.5, 1, 0.5)
  294. arm1.C1 = CFrame.Angles(20, 0, 0)
  295. end
  296. end
  297.  
  298. function pianop3()
  299. char.Humanoid.WalkSpeed = 0
  300. piano = true
  301. MUSIK3:Play()
  302.  
  303. while piano do
  304. wait(0.3)
  305. arm2.C0 = CFrame.new(1.5, 1.3, 0.5)
  306. arm2.C1 = CFrame.Angles(20, 0, 0)
  307. arm1.C0 = CFrame.new(-1.5, 1.3, 0.5)
  308. arm1.C1 = CFrame.Angles(20, 0, 0)
  309. wait(0.3)
  310. arm2.C0 = CFrame.new(1.5, 1, 0.5)
  311. arm2.C1 = CFrame.Angles(20, 0, 0)
  312. arm1.C0 = CFrame.new(-1.5, 1, 0.5)
  313. arm1.C1 = CFrame.Angles(20, 0, 0)
  314. end
  315. end
  316.  
  317. function pianop4()
  318. char.Humanoid.WalkSpeed = 0
  319. piano = true
  320. MUSIK4:Play()
  321.  
  322. while piano do
  323. wait(0.1)
  324. arm2.C0 = CFrame.new(1.5, 1.3, 0.5)
  325. arm2.C1 = CFrame.Angles(20, 0, 0)
  326. arm1.C0 = CFrame.new(-1.5, 1.3, 0.5)
  327. arm1.C1 = CFrame.Angles(20, 0, 0)
  328. wait(0.1)
  329. arm2.C0 = CFrame.new(1.5, 1, 0.5)
  330. arm2.C1 = CFrame.Angles(20, 0, 0)
  331. arm1.C0 = CFrame.new(-1.5, 1, 0.5)
  332. arm1.C1 = CFrame.Angles(20, 0, 0)
  333. end
  334. end
  335.  
  336. function pianop5()
  337. char.Humanoid.WalkSpeed = 0
  338. piano = true
  339. MUSIK5:Play()
  340.  
  341. while piano do
  342. wait(0.1)
  343. arm2.C0 = CFrame.new(1.5, 1.3, 0.5)
  344. arm2.C1 = CFrame.Angles(20, 0, 0)
  345. arm1.C0 = CFrame.new(-1.5, 1.3, 0.5)
  346. arm1.C1 = CFrame.Angles(20, 0, 0)
  347. wait(0.1)
  348. arm2.C0 = CFrame.new(1.5, 1, 0.5)
  349. arm2.C1 = CFrame.Angles(20, 0, 0)
  350. arm1.C0 = CFrame.new(-1.5, 1, 0.5)
  351. arm1.C1 = CFrame.Angles(20, 0, 0)
  352. end
  353. end
  354.  
  355. function pianop6()
  356. char.Humanoid.WalkSpeed = 0
  357. piano = true
  358. MUSIK6:Play()
  359.  
  360. while piano do
  361. wait(0.1)
  362. arm2.C0 = CFrame.new(1.5, 1.3, 0.5)
  363. arm2.C1 = CFrame.Angles(20, 0, 0)
  364. arm1.C0 = CFrame.new(-1.5, 1.3, 0.5)
  365. arm1.C1 = CFrame.Angles(20, 0, 0)
  366. wait(0.1)
  367. arm2.C0 = CFrame.new(1.5, 1, 0.5)
  368. arm2.C1 = CFrame.Angles(20, 0, 0)
  369. arm1.C0 = CFrame.new(-1.5, 1, 0.5)
  370. arm1.C1 = CFrame.Angles(20, 0, 0)
  371. end
  372. end
  373.  
  374. function pianop7()
  375. char.Humanoid.WalkSpeed = 0
  376. piano = true
  377. MUSIK7:Play()
  378.  
  379. while piano do
  380. wait(0.1)
  381. arm2.C0 = CFrame.new(1.5, 1.3, 0.5)
  382. arm2.C1 = CFrame.Angles(20, 0, 0)
  383. arm1.C0 = CFrame.new(-1.5, 1.3, 0.5)
  384. arm1.C1 = CFrame.Angles(20, 0, 0)
  385. wait(0.1)
  386. arm2.C0 = CFrame.new(1.5, 1, 0.5)
  387. arm2.C1 = CFrame.Angles(20, 0, 0)
  388. arm1.C0 = CFrame.new(-1.5, 1, 0.5)
  389. arm1.C1 = CFrame.Angles(20, 0, 0)
  390. end
  391. end
  392.  
  393. function pianop8()
  394. char.Humanoid.WalkSpeed = 0
  395. piano = true
  396. MUSIK8:Play()
  397.  
  398. while piano do
  399. wait(0.1)
  400. arm2.C0 = CFrame.new(1.5, 1.3, 0.5)
  401. arm2.C1 = CFrame.Angles(20, 0, 0)
  402. arm1.C0 = CFrame.new(-1.5, 1.3, 0.5)
  403. arm1.C1 = CFrame.Angles(20, 0, 0)
  404. wait(0.1)
  405. arm2.C0 = CFrame.new(1.5, 1, 0.5)
  406. arm2.C1 = CFrame.Angles(20, 0, 0)
  407. arm1.C0 = CFrame.new(-1.5, 1, 0.5)
  408. arm1.C1 = CFrame.Angles(20, 0, 0)
  409. end
  410. end
  411.  
  412. function pianop9()
  413. char.Humanoid.WalkSpeed = 0
  414. piano = true
  415. MUSIK9:Play()
  416.  
  417. while piano do
  418. wait(0.1)
  419. arm2.C0 = CFrame.new(1.5, 1.3, 0.5)
  420. arm2.C1 = CFrame.Angles(20, 0, 0)
  421. arm1.C0 = CFrame.new(-1.5, 1.3, 0.5)
  422. arm1.C1 = CFrame.Angles(20, 0, 0)
  423. wait(0.1)
  424. arm2.C0 = CFrame.new(1.5, 1, 0.5)
  425. arm2.C1 = CFrame.Angles(20, 0, 0)
  426. arm1.C0 = CFrame.new(-1.5, 1, 0.5)
  427. arm1.C1 = CFrame.Angles(20, 0, 0)
  428. end
  429. end
  430.  
  431.  
  432.  
  433. function stop2()
  434. char.Humanoid.WalkSpeed = 16
  435. MUSIK2:Stop()
  436. MUSIK:Stop()
  437. MUSIK3:Stop()
  438. MUSIK4:Stop()
  439. MUSIK5:Stop()
  440. MUSIK6:Stop()
  441. MUSIK7:Stop()
  442. MUSIK8:Stop()
  443. MUSIK9:Stop()
  444. piano = false
  445. arm2.C0 = CFrame.new(1.5, 1, 0.5)
  446. arm2.C1 = CFrame.Angles(20, 0, 0)
  447. arm1.C0 = CFrame.new(-1.5, 1, 0.5)
  448. arm1.C1 = CFrame.Angles(20, 0, 0)
  449. end
  450.  
  451. mouse.KeyDown:connect(function(Press)
  452. Press=Press:lower()
  453. if Press=="z" and piano == false then
  454. pianop()
  455. end
  456. if Press=="c" and piano == false then
  457. pianop2()
  458. end
  459. if Press=="v" and piano == false then
  460. pianop3()
  461. end
  462. if Press=="b" and piano == false then
  463. pianop4()
  464. end
  465. if Press=="m" and piano == false then
  466. pianop5()
  467. end
  468. if Press=="l" and piano == false then
  469. pianop6()
  470. end
  471. if Press=="g" and piano == false then
  472. pianop7()
  473. end
  474. if Press=="n" and piano == false then
  475. pianop8()
  476. end
  477. if Press=="b" and piano == false then
  478. pianop9()
  479. end
  480. if Press=="x" and piano == true then
  481. stop2()
  482. end
  483. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement