ItzInfern

guitar test

Jan 26th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.52 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  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,Mouse,mouse,UserInputService,ContextActionService = owner
  4. local RealPlayer = Player
  5. 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
  6.  
  7. print('Guitar')
  8. print('By slenercat5')
  9. print('F to toggle Camera perspectives')--FANCY :D
  10. Player=game.Players.LocalPlayer
  11. Character=Player.Character
  12. Character.Animate.Disabled=true
  13. local LeftArm = Character["Left Arm"]
  14. local RightArm = Character["Right Arm"]
  15. local LeftLeg = Character["Left Leg"]
  16. local RightLeg = Character["Right Leg"]
  17. local Head = Character.Head
  18. local Torso = Character.Torso
  19. local Camera = game.Workspace.CurrentCamera
  20. local RootPart = Character.HumanoidRootPart
  21. local RootJoint = RootPart.RootJoint
  22. local Humanoid=Character.Humanoid
  23. CAM=Camera
  24. FF=Instance.new('ForceField',Character)
  25. FF.Visible=false
  26. Humanoid.Name='LOLOL YOU CANT HIT ME'
  27. Character.
  28. Health:remove()
  29. for i,v in pairs (Humanoid:GetPlayingAnimationTracks()) do
  30. v:Stop()
  31. end
  32.  
  33. local newMotor = function(part0, part1, c0, c1)
  34. w = Instance.new('Motor')
  35. w.Parent = part0
  36. w.Part0 = part0
  37. w.Part1 = part1
  38. w.C0 = c0
  39. w.C1 = c1
  40.  
  41. return w
  42. end
  43.  
  44.  
  45.  
  46.  
  47. RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
  48. NeckCF = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  49.  
  50. local RW = newMotor(Torso, RightArm, CFrame.new(2.5, 0, 0), CFrame.new(0, 0, 0))
  51. local LW = newMotor(Torso, LeftArm, CFrame.new(-2.5, 0, 0), CFrame.new(0, 0, 0))
  52. local RH = newMotor(Torso, RightLeg, CFrame.new(1.5, -3, 0), CFrame.new(0, 0, 0))
  53. local LH = newMotor(Torso, LeftLeg, CFrame.new(-1.5, -3, 0), CFrame.new(0, 0, 0))
  54. RootJoint.C1 = CFrame.new(0, 0, 0)
  55. RootJoint.C0 = CFrame.new(0, 0, 0)
  56. Torso.Neck.C1 = CFrame.new(0, 0, 0)
  57. Torso.Neck.C0 = CFrame.new(0, 2.5, 0)
  58.  
  59. local rarmc1 = RW.C1
  60. local larmc1 = LW.C1
  61. local rlegc1 = RH.C1
  62. local llegc1 = LH.C1
  63.  
  64. local resetc1 = false
  65.  
  66. function clerp(a, b, t)
  67. return a:lerp(b, t)
  68. end
  69. function AutoWeld(Foop, OOF)
  70. local W = Instance.new("Weld")
  71. W.Part0 = Foop
  72. W.Part1 = OOF
  73. local CJ = CFrame.new(Foop.Position)
  74. local C0 = Foop.CFrame:inverse()*CJ
  75. local C1 = OOF.CFrame:inverse()*CJ
  76. W.C0 = C0
  77. W.C1 = C1
  78. W.Name='o0o'
  79. W.Parent = Foop
  80.  
  81. end
  82.  
  83.  
  84.  
  85. function PlayAnimationFromTable(table, speed, bool)
  86. RootJoint.C0 = clerp(RootJoint.C0, table[1], speed)
  87. Torso.Neck.C0 = clerp(Torso.Neck.C0, table[2], speed)
  88. RW.C0 = clerp(RW.C0, table[3], speed)
  89. LW.C0 = clerp(LW.C0, table[4], speed)
  90. RH.C0 = clerp(RH.C0, table[5], speed)
  91. LH.C0 = clerp(LH.C0, table[6], speed)
  92. if bool == true then
  93. if resetc1 == false then
  94. resetc1 = true
  95. RootJoint.C1 = RootJoint.C1
  96. Torso.Neck.C1 = Torso.Neck.C1
  97. RW.C1 = rarmc1
  98. LW.C1 = larmc1
  99. RH.C1 = rlegc1
  100. LH.C1 = llegc1
  101. end
  102. end
  103. end
  104. sine=1
  105.  
  106. Torso.CFrame=Torso.CFrame*CFrame.new(0,1,0)
  107.  
  108.  
  109. Grass=Instance.new('Part',Character)
  110. Grass.Name='Grass'
  111. Grass.Anchored=true
  112. Grass.Size=Vector3.new(11.42, 0.17, 17.6)
  113. Grass.CFrame=Torso.CFrame*CFrame.new(-0.43, -3.905, -0.1)
  114. Grass.Material='Grass'
  115. Grass.BrickColor=BrickColor.new('Bright green')
  116. m=Instance.new('CylinderMesh',Grass)
  117. White=Instance.new('Part',Character)
  118. White.Name='White Space'
  119. White.Anchored=true
  120. White.Size=Vector3.new(35.2, 0.05, 17.6)
  121. White.CFrame=Torso.CFrame*CFrame.new(0.39, -3.965, -0.1)
  122. White.Material='Neon'
  123. White.BrickColor=BrickColor.new('Medium stone grey')
  124. m=Instance.new('CylinderMesh',White)
  125.  
  126.  
  127. Humanoid.AutoRotate=false
  128. Humanoid.WalkSpeed=0
  129. Humanoid.JumpPower=0
  130.  
  131. Flute=Instance.new('Part',Character)
  132. Flute.Name='Flute'
  133. Flute.CFrame=Torso.CFrame*CFrame.new(-0.5,-.5,-1)*CFrame.Angles(0,0,-2.5)
  134. m=Instance.new('SpecialMesh',Flute)
  135. m.MeshId='http://www.roblox.com/asset/?id=161269074'
  136. m.TextureId='http://www.roblox.com/asset/?id=228874694'
  137. m.Scale=Vector3.new(0.922, 0.922, 0.922)
  138. Flute.Size=Vector3.new(.5,2,.5)
  139.  
  140. AutoWeld(Flute,Torso)
  141. THEME=Instance.new('Sound',Character.Torso)
  142. music=nil
  143. firsttype=false
  144. Player.Chatted:connect(function(msg)
  145. for def in string.gmatch(msg, "%d+") do
  146. print(def)
  147.  
  148. if def~=nil then
  149. music=def
  150. end
  151. end
  152.  
  153. for def in string.gmatch(msg,"[%u%l%p]+") do
  154. print(def)
  155. if def=='Play/' and music~=nil then
  156. THEME:stop()
  157. THEME.SoundId='rbxassetid://'.. music
  158. THEME:play()
  159. elseif def=='Play/Demo' then
  160. THEME:stop()
  161. THEME.SoundId='rbxassetid://'.. 164167420
  162. THEME:play()
  163. elseif def=='S_Guitar' then
  164. THEME:stop()
  165. end
  166. end
  167. music=nil
  168. end)
  169. Ms=Player:GetMouse()
  170. Ms.KeyDown:connect(function(key)
  171. if key=='f' then
  172. if cam then
  173. cam=false
  174. CAM.CameraType='Custom'
  175. else
  176. cam=true
  177. CAM.CameraType='Scriptable'
  178. end
  179. end
  180. end)
  181.  
  182.  
  183. cam=true--Custom Camera Perspectives
  184. if cam==true then
  185. CAM.CameraType=Enum.CameraType.Scriptable
  186.  
  187. end
  188. Campart1=Instance.new('Part',Character)
  189. Campart1.Transparency=1
  190. Campart1.Anchored=true
  191. Campart1.CanCollide=false
  192. Campart2=Campart1:clone()
  193. Campart2.Parent=Character
  194. Campart3=Campart1:clone()
  195. Campart3.Parent=Character
  196.  
  197. camtime=0
  198. camphase=0
  199.  
  200. while 1 do
  201. wait()
  202. sine=sine+1
  203. PlayAnimationFromTable({
  204. CFrame.new(-math.cos(sine/16)*.2, math.cos(sine/8)/8, 0) * CFrame.Angles(0, 0, 0),
  205. CFrame.new(0, 1.5, 0) * CFrame.new(0, 0, -.3) * CFrame.Angles(-.5,0.5-THEME.PlaybackLoudness/150, 0),
  206. CFrame.new(1.5-THEME.PlaybackLoudness/700, .5, -.5)*CFrame.Angles(1.5+THEME.PlaybackLoudness/700,0,0-THEME.PlaybackLoudness/700),
  207. CFrame.new(-1.5+THEME.PlaybackLoudness/700, 0, -.5)*CFrame.Angles(1-THEME.PlaybackLoudness/700,0,0+THEME.PlaybackLoudness/700),
  208. CFrame.new(1+math.cos(sine/16)*.2,-2-math.cos(sine/8)/8, 0)*CFrame.Angles(0,0,0.5) ,
  209. CFrame.new(-1+math.cos(sine/16)*.2,-2-math.cos(sine/8)/8,0)*CFrame.Angles(0,0,-0.5),
  210. }, .3, false)
  211.  
  212. White.Size=Vector3.new(35.2+THEME.PlaybackLoudness/10, 0.05, 17.6+THEME.PlaybackLoudness/10)
  213. Campart1=Instance.new('Part')
  214. if cam==true then
  215. CAM.CameraType='Scriptable'
  216. Campart1.CFrame=Torso.CFrame*CFrame.new(8,8,8)*CFrame.Angles(-0.5,.5,-0.5)
  217. Campart2.CFrame=Torso.CFrame*CFrame.new(-8,-3,-5)*CFrame.Angles(-1,-2,-1)
  218. Campart3.CFrame=Flute.CFrame*CFrame.new(1.5,0,-1)*CFrame.Angles(0,1.8,3)
  219. if camphase==0 then
  220. if camtime<20+math.random(-2,2) then
  221. CAM.CFrame=Campart1.CFrame
  222. camtime=camtime+1
  223. else
  224. camtime=0
  225. camphase=camphase+1
  226. end
  227. elseif camphase==1 then
  228. if camtime<40+math.random(-8,12) then
  229. CAM.CFrame=Campart2.CFrame
  230. camtime=camtime+1
  231. else
  232. camtime=0
  233. camphase=camphase+1
  234. end
  235. elseif camphase==2 then
  236. if camtime<50+math.random(-2,5) then
  237. CAM.CFrame=Campart3.CFrame
  238. camtime=camtime+1
  239. else
  240. camtime=0
  241. camphase=camphase+1
  242. end
  243.  
  244. elseif camphase==3 then
  245. camphase=0
  246. end
  247.  
  248.  
  249. end
  250. end
Add Comment
Please, Sign In to add comment