Advertisement
Guest User

Untitled

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