Advertisement
ItzInfern

guitat

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