Advertisement
Void_scripter0

Guitar

Feb 1st, 2019
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.72 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,game,owner = owner,game
  3. local RealPlayer = Player
  4. do
  5. print("FE Compatibility code by Mokiros | Showcase by Bacon Hair!")
  6. local rp = RealPlayer
  7. script.Parent = rp.Character
  8.  
  9. --RemoteEvent for communicating
  10. local Event = Instance.new("RemoteEvent")
  11. Event.Name = "UserInput_Event"
  12.  
  13. --Fake event to make stuff like Mouse.KeyDown work
  14. local function fakeEvent()
  15. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  16. t.connect = t.Connect
  17. return t
  18. end
  19.  
  20. --Creating fake input objects with fake variables
  21. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  22. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  23. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  24. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  25. end}
  26. --Merged 2 functions into one by checking amount of arguments
  27. CAS.UnbindAction = CAS.BindAction
  28.  
  29. --This function will trigger the events that have been :Connect()'ed
  30. local function te(self,ev,...)
  31. local t = m[ev]
  32. if t and t._fakeEvent then
  33. for _,f in pairs(t.Functions) do
  34. f(...)
  35. end
  36. end
  37. end
  38. m.TrigEvent = te
  39. UIS.TrigEvent = te
  40.  
  41. Event.OnServerEvent:Connect(function(plr,io)
  42. if plr~=rp then return end
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. if not io.isMouse then
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = game:GetService("Players").LocalPlayer
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local Mouse = Player:GetMouse()
  66. local UIS = game:GetService("UserInputService")
  67. local input = function(io,a)
  68. if a then return end
  69. --Since InputObject is a client-side instance, we create and pass table instead
  70. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  71. end
  72. UIS.InputBegan:Connect(input)
  73. UIS.InputEnded:Connect(input)
  74.  
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84.  
  85. ----Sandboxed game object that allows the usage of client-side methods and services
  86. --Real game object
  87. local _rg = game
  88.  
  89. --Metatable for fake service
  90. local fsmt = {
  91. __index = function(self,k)
  92. local s = rawget(self,"_RealService")
  93. if s then return s[k] end
  94. end,
  95. __newindex = function(self,k,v)
  96. local s = rawget(self,"_RealService")
  97. if s then s[k]=v end
  98. end,
  99. __call = function(self,...)
  100. local s = rawget(self,"_RealService")
  101. if s then return s(...) end
  102. end
  103. }
  104. local function FakeService(t,RealService)
  105. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  106. return setmetatable(t,fsmt)
  107. end
  108.  
  109. --Fake game object
  110. local g = {
  111. GetService = function(self,s)
  112. return self[s]
  113. end,
  114. Players = FakeService({
  115. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  116. },"Players"),
  117. UserInputService = FakeService(UIS,"UserInputService"),
  118. ContextActionService = FakeService(CAS,"ContextActionService"),
  119. }
  120. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  121. g.service = g.GetService
  122.  
  123. g.RunService = FakeService({
  124. RenderStepped = _rg:GetService("RunService").Heartbeat,
  125. BindToRenderStep = function(self,name,_,fun)
  126.  
  127. end,
  128. UnbindFromRenderStep = function(self,name)
  129. self._btrs[name]:Disconnect()
  130. end,
  131. },"RunService")
  132.  
  133. setmetatable(g,{
  134. __index=function(self,s)
  135. return _rg:GetService(s) or typeof(_rg[s])=="function"
  136. and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  137. end,
  138. __newindex = fsmt.__newindex,
  139. __call = fsmt.__call
  140. })
  141. --Changing owner to fake player object to support owner:GetMouse()
  142. game,owner = g,g.Players.LocalPlayer
  143. end
  144. print('Guitar')
  145. print('By slenercat5')
  146. print('F to toggle Camera perspectives')--FANCY :D
  147. Player=game.Players.LocalPlayer
  148. Character=Player.Character
  149. Character.Animate.Disabled=true
  150. local LeftArm = Character["Left Arm"]
  151. local RightArm = Character["Right Arm"]
  152. local LeftLeg = Character["Left Leg"]
  153. local RightLeg = Character["Right Leg"]
  154. local Head = Character.Head
  155. local Torso = Character.Torso
  156. local Camera = game.Workspace.CurrentCamera
  157. local RootPart = Character.HumanoidRootPart
  158. local RootJoint = RootPart.RootJoint
  159. local Humanoid=Character.Humanoid
  160. CAM=Camera
  161. FF=Instance.new('ForceField',Character)
  162. FF.Visible=false
  163. Humanoid.Name='LOLOL YOU CANT HIT ME'
  164. Character.
  165. Health:remove()
  166. for i,v in pairs (Humanoid:GetPlayingAnimationTracks()) do
  167. v:Stop()
  168. end
  169.  
  170. local newMotor = function(part0, part1, c0, c1)
  171. w = Instance.new('Motor')
  172. w.Parent = part0
  173. w.Part0 = part0
  174. w.Part1 = part1
  175. w.C0 = c0
  176. w.C1 = c1
  177.  
  178. return w
  179. end
  180.  
  181.  
  182.  
  183.  
  184. RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
  185. NeckCF = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  186.  
  187. local RW = newMotor(Torso, RightArm, CFrame.new(2.5, 0, 0), CFrame.new(0, 0, 0))
  188. local LW = newMotor(Torso, LeftArm, CFrame.new(-2.5, 0, 0), CFrame.new(0, 0, 0))
  189. local RH = newMotor(Torso, RightLeg, CFrame.new(1.5, -3, 0), CFrame.new(0, 0, 0))
  190. local LH = newMotor(Torso, LeftLeg, CFrame.new(-1.5, -3, 0), CFrame.new(0, 0, 0))
  191. RootJoint.C1 = CFrame.new(0, 0, 0)
  192. RootJoint.C0 = CFrame.new(0, 0, 0)
  193. Torso.Neck.C1 = CFrame.new(0, 0, 0)
  194. Torso.Neck.C0 = CFrame.new(0, 2.5, 0)
  195.  
  196. local rarmc1 = RW.C1
  197. local larmc1 = LW.C1
  198. local rlegc1 = RH.C1
  199. local llegc1 = LH.C1
  200.  
  201. local resetc1 = false
  202.  
  203. function clerp(a, b, t)
  204. return a:lerp(b, t)
  205. end
  206. function AutoWeld(Foop, OOF)
  207. local W = Instance.new("Weld")
  208. W.Part0 = Foop
  209. W.Part1 = OOF
  210. local CJ = CFrame.new(Foop.Position)
  211. local C0 = Foop.CFrame:inverse()*CJ
  212. local C1 = OOF.CFrame:inverse()*CJ
  213. W.C0 = C0
  214. W.C1 = C1
  215. W.Name='o0o'
  216. W.Parent = Foop
  217.  
  218. end
  219.  
  220.  
  221.  
  222. function PlayAnimationFromTable(table, speed, bool)
  223. RootJoint.C0 = clerp(RootJoint.C0, table[1], speed)
  224. Torso.Neck.C0 = clerp(Torso.Neck.C0, table[2], speed)
  225. RW.C0 = clerp(RW.C0, table[3], speed)
  226. LW.C0 = clerp(LW.C0, table[4], speed)
  227. RH.C0 = clerp(RH.C0, table[5], speed)
  228. LH.C0 = clerp(LH.C0, table[6], speed)
  229. if bool == true then
  230. if resetc1 == false then
  231. resetc1 = true
  232. RootJoint.C1 = RootJoint.C1
  233. Torso.Neck.C1 = Torso.Neck.C1
  234. RW.C1 = rarmc1
  235. LW.C1 = larmc1
  236. RH.C1 = rlegc1
  237. LH.C1 = llegc1
  238. end
  239. end
  240. end
  241. sine=1
  242.  
  243. Torso.CFrame=Torso.CFrame*CFrame.new(0,1,0)
  244.  
  245.  
  246. Grass=Instance.new('Part',Character)
  247. Grass.Name='Grass'
  248. Grass.Anchored=true
  249. Grass.Size=Vector3.new(11.42, 0.17, 17.6)
  250. Grass.CFrame=Torso.CFrame*CFrame.new(-0.43, -3.905, -0.1)
  251. Grass.Material='Grass'
  252. Grass.BrickColor=BrickColor.new('Bright green')
  253. m=Instance.new('CylinderMesh',Grass)
  254. White=Instance.new('Part',Character)
  255. White.Name='White Space'
  256. White.Anchored=true
  257. White.Size=Vector3.new(35.2, 0.05, 17.6)
  258. White.CFrame=Torso.CFrame*CFrame.new(0.39, -3.965, -0.1)
  259. White.Material='Neon'
  260. White.BrickColor=BrickColor.new('Medium stone grey')
  261. m=Instance.new('CylinderMesh',White)
  262.  
  263.  
  264. Humanoid.AutoRotate=false
  265. Humanoid.WalkSpeed=0
  266. Humanoid.JumpPower=0
  267.  
  268. Flute=Instance.new('Part',Character)
  269. Flute.Name='Flute'
  270. Flute.CFrame=Torso.CFrame*CFrame.new(-0.5,-.5,-1)*CFrame.Angles(0,0,-2.5)
  271. m=Instance.new('SpecialMesh',Flute)
  272. m.MeshId='http://www.roblox.com/asset/?id=161269074'
  273. m.TextureId='http://www.roblox.com/asset/?id=228874694'
  274. m.Scale=Vector3.new(0.922, 0.922, 0.922)
  275. Flute.Size=Vector3.new(.5,2,.5)
  276.  
  277. AutoWeld(Flute,Torso)
  278. THEME=Instance.new('Sound',Character.Torso)
  279. music=nil
  280. firsttype=false
  281. Player.Chatted:connect(function(msg)
  282. for def in string.gmatch(msg, "%d+") do
  283. print(def)
  284.  
  285. if def~=nil then
  286. music=def
  287. end
  288. end
  289.  
  290. for def in string.gmatch(msg,"[%u%l%p]+") do
  291. print(def)
  292. if def=='Play/' and music~=nil then
  293. THEME:stop()
  294. THEME.SoundId='rbxassetid://'.. music
  295. THEME:play()
  296. elseif def=='Play/Demo' then
  297. THEME:stop()
  298. THEME.SoundId='rbxassetid://'.. 164167420
  299. THEME:play()
  300. elseif def=='S_Guitar' then
  301. THEME:stop()
  302. end
  303. end
  304. music=nil
  305. end)
  306. Ms=Player:GetMouse()
  307. Ms.KeyDown:connect(function(key)
  308. if key=='f' then
  309. if cam then
  310. cam=false
  311. CAM.CameraType='Custom'
  312. else
  313. cam=true
  314. CAM.CameraType='Scriptable'
  315. end
  316. end
  317. end)
  318.  
  319.  
  320. cam=true--Custom Camera Perspectives
  321. if cam==true then
  322. CAM.CameraType=Enum.CameraType.Scriptable
  323.  
  324. end
  325. Campart1=Instance.new('Part',Character)
  326. Campart1.Transparency=1
  327. Campart1.Anchored=true
  328. Campart1.CanCollide=false
  329. Campart2=Campart1:clone()
  330. Campart2.Parent=Character
  331. Campart3=Campart1:clone()
  332. Campart3.Parent=Character
  333.  
  334. camtime=0
  335. camphase=0
  336.  
  337. while 1 do
  338. wait()
  339. sine=sine+1
  340. PlayAnimationFromTable({
  341. CFrame.new(-math.cos(sine/16)*.2, math.cos(sine/8)/8, 0) * CFrame.Angles(0, 0, 0),
  342. CFrame.new(0, 1.5, 0) * CFrame.new(0, 0, -.3) * CFrame.Angles(-.5,0.5-THEME.PlaybackLoudness/150, 0),
  343. CFrame.new(1.5-THEME.PlaybackLoudness/700, .5, -.5)*CFrame.Angles(1.5+THEME.PlaybackLoudness/700,0,0-THEME.PlaybackLoudness/700),
  344. CFrame.new(-1.5+THEME.PlaybackLoudness/700, 0, -.5)*CFrame.Angles(1-THEME.PlaybackLoudness/700,0,0+THEME.PlaybackLoudness/700),
  345. CFrame.new(1+math.cos(sine/16)*.2,-2-math.cos(sine/8)/8, 0)*CFrame.Angles(0,0,0.5) ,
  346. CFrame.new(-1+math.cos(sine/16)*.2,-2-math.cos(sine/8)/8,0)*CFrame.Angles(0,0,-0.5),
  347. }, .3, false)
  348.  
  349. White.Size=Vector3.new(35.2+THEME.PlaybackLoudness/10, 0.05, 17.6+THEME.PlaybackLoudness/10)
  350. Campart1=Instance.new('Part')
  351. if cam==true then
  352. CAM.CameraType='Scriptable'
  353. Campart1.CFrame=Torso.CFrame*CFrame.new(8,8,8)*CFrame.Angles(-0.5,.5,-0.5)
  354. Campart2.CFrame=Torso.CFrame*CFrame.new(-8,-3,-5)*CFrame.Angles(-1,-2,-1)
  355. Campart3.CFrame=Flute.CFrame*CFrame.new(1.5,0,-1)*CFrame.Angles(0,1.8,3)
  356. if camphase==0 then
  357. if camtime<20+math.random(-2,2) then
  358. CAM.CFrame=Campart1.CFrame
  359. camtime=camtime+1
  360. else
  361. camtime=0
  362. camphase=camphase+1
  363. end
  364. elseif camphase==1 then
  365. if camtime<40+math.random(-8,12) then
  366. CAM.CFrame=Campart2.CFrame
  367. camtime=camtime+1
  368. else
  369. camtime=0
  370. camphase=camphase+1
  371. end
  372. elseif camphase==2 then
  373. if camtime<50+math.random(-2,5) then
  374. CAM.CFrame=Campart3.CFrame
  375. camtime=camtime+1
  376. else
  377. camtime=0
  378. camphase=camphase+1
  379. end
  380.  
  381. elseif camphase==3 then
  382. camphase=0
  383. end
  384.  
  385.  
  386. end
  387. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement