SHOW:
|
|
- or go back to the newest paste.
1 | - | print('Guitar') |
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 | - | Player=game.Players.LocalPlayer |
4 | + | do |
5 | print("FE Compatibility code by retram") | |
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(),Button2Up=fakeEvent(),Button2Down=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 | if io.UserInputType == Enum.UserInputType.MouseButton2 then | |
51 | return m:TrigEvent(b and "Button2Down" or "Button2Up") | |
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 | local Mouse = Player:GetMouse() | |
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,Hit=Mouse.Hit,Target=Mouse.Target}) | |
73 | end | |
74 | UIS.InputBegan:Connect(input) | |
75 | UIS.InputEnded:Connect(input) | |
76 | local h,t | |
77 | --Give the server mouse data 30 times every second, but only if the values changed | |
78 | --If player is not moving their mouse, client won't fire events | |
79 | while wait(1/30) do | |
80 | if h~=Mouse.Hit or t~=Mouse.Target then | |
81 | h,t=Mouse.Hit,Mouse.Target | |
82 | Event:FireServer({isMouse=true,Target=t,Hit=h}) | |
83 | end | |
84 | end]==],Player.Character) | |
85 | ||
86 | ----Sandboxed game object that allows the usage of client-side methods and services | |
87 | --Real game object | |
88 | local _rg = game | |
89 | ||
90 | --Metatable for fake service | |
91 | local fsmt = { | |
92 | __index = function(self,k) | |
93 | local s = rawget(self,"_RealService") | |
94 | if s then | |
95 | return typeof(s[k])=="function" | |
96 | and function(_,...)return s[k](s,...)end or s[k] | |
97 | end | |
98 | end, | |
99 | __newindex = function(self,k,v) | |
100 | local s = rawget(self,"_RealService") | |
101 | if s then s[k]=v 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 rawget(self,s) or _rg:GetService(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 | RunService = FakeService({ | |
120 | _btrs = {}, | |
121 | RenderStepped = _rg:GetService("RunService").Heartbeat, | |
122 | BindToRenderStep = function(self,name,_,fun) | |
123 | self._btrs[name] = self.Heartbeat:Connect(fun) | |
124 | end, | |
125 | UnbindFromRenderStep = function(self,name) | |
126 | self._btrs[name]:Disconnect() | |
127 | end, | |
128 | },"RunService") | |
129 | } | |
130 | rawset(g.Players,"localPlayer",g.Players.LocalPlayer) | |
131 | g.service = g.GetService | |
132 | FakeService(g,game) | |
133 | --Changing owner to fake player object to support owner:GetMouse() | |
134 | game,owner = g,g.Players.LocalPlayer | |
135 | end print('Guitar') | |
136 | print('By slenercat5') | |
137 | print('F to toggle Camera perspectives')--FANCY :D | |
138 | warn("Fe by retram Play/id") Player=game.Players.LocalPlayer | |
139 | Character=Player.Character | |
140 | Character.Animate.Disabled=true | |
141 | local LeftArm = Character["Left Arm"] | |
142 | local RightArm = Character["Right Arm"] | |
143 | local LeftLeg = Character["Left Leg"] | |
144 | local RightLeg = Character["Right Leg"] | |
145 | local Head = Character.Head | |
146 | local Torso = Character.Torso | |
147 | local Camera = game.Workspace.CurrentCamera | |
148 | local RootPart = Character.HumanoidRootPart | |
149 | local RootJoint = RootPart.RootJoint | |
150 | local Humanoid=Character.Humanoid | |
151 | CAM=Camera | |
152 | FF=Instance.new('ForceField',Character) | |
153 | FF.Visible=false | |
154 | Humanoid.Name='LOLOL YOU CANT HIT ME' | |
155 | Character. | |
156 | Health:remove() | |
157 | for i,v in pairs (Humanoid:GetPlayingAnimationTracks()) do | |
158 | v:Stop() | |
159 | end | |
160 | ||
161 | local newMotor = function(part0, part1, c0, c1) | |
162 | w = Instance.new('Motor') | |
163 | w.Parent = part0 | |
164 | w.Part0 = part0 | |
165 | w.Part1 = part1 | |
166 | w.C0 = c0 | |
167 | w.C1 = c1 | |
168 | ||
169 | return w | |
170 | end | |
171 | ||
172 | ||
173 | ||
174 | ||
175 | RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14) | |
176 | NeckCF = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
177 | ||
178 | local RW = newMotor(Torso, RightArm, CFrame.new(2.5, 0, 0), CFrame.new(0, 0, 0)) | |
179 | local LW = newMotor(Torso, LeftArm, CFrame.new(-2.5, 0, 0), CFrame.new(0, 0, 0)) | |
180 | local RH = newMotor(Torso, RightLeg, CFrame.new(1.5, -3, 0), CFrame.new(0, 0, 0)) | |
181 | local LH = newMotor(Torso, LeftLeg, CFrame.new(-1.5, -3, 0), CFrame.new(0, 0, 0)) | |
182 | RootJoint.C1 = CFrame.new(0, 0, 0) | |
183 | RootJoint.C0 = CFrame.new(0, 0, 0) | |
184 | Torso.Neck.C1 = CFrame.new(0, 0, 0) | |
185 | Torso.Neck.C0 = CFrame.new(0, 2.5, 0) | |
186 | ||
187 | local rarmc1 = RW.C1 | |
188 | local larmc1 = LW.C1 | |
189 | local rlegc1 = RH.C1 | |
190 | local llegc1 = LH.C1 | |
191 | ||
192 | local resetc1 = false | |
193 | ||
194 | function clerp(a, b, t) | |
195 | return a:lerp(b, t) | |
196 | end | |
197 | function AutoWeld(Foop, OOF) | |
198 | local W = Instance.new("Weld") | |
199 | W.Part0 = Foop | |
200 | W.Part1 = OOF | |
201 | local CJ = CFrame.new(Foop.Position) | |
202 | local C0 = Foop.CFrame:inverse()*CJ | |
203 | local C1 = OOF.CFrame:inverse()*CJ | |
204 | W.C0 = C0 | |
205 | W.C1 = C1 | |
206 | W.Name='o0o' | |
207 | W.Parent = Foop | |
208 | ||
209 | end | |
210 | ||
211 | ||
212 | ||
213 | function PlayAnimationFromTable(table, speed, bool) | |
214 | RootJoint.C0 = clerp(RootJoint.C0, table[1], speed) | |
215 | Torso.Neck.C0 = clerp(Torso.Neck.C0, table[2], speed) | |
216 | RW.C0 = clerp(RW.C0, table[3], speed) | |
217 | LW.C0 = clerp(LW.C0, table[4], speed) | |
218 | RH.C0 = clerp(RH.C0, table[5], speed) | |
219 | LH.C0 = clerp(LH.C0, table[6], speed) | |
220 | if bool == true then | |
221 | if resetc1 == false then | |
222 | resetc1 = true | |
223 | RootJoint.C1 = RootJoint.C1 | |
224 | Torso.Neck.C1 = Torso.Neck.C1 | |
225 | RW.C1 = rarmc1 | |
226 | LW.C1 = larmc1 | |
227 | RH.C1 = rlegc1 | |
228 | LH.C1 = llegc1 | |
229 | end | |
230 | end | |
231 | end | |
232 | sine=1 | |
233 | ||
234 | Torso.CFrame=Torso.CFrame*CFrame.new(0,1,0) | |
235 | ||
236 | ||
237 | Grass=Instance.new('Part',Character) | |
238 | Grass.Name='Grass' | |
239 | Grass.Anchored=true | |
240 | Grass.Size=Vector3.new(11.42, 0.17, 17.6) | |
241 | Grass.CFrame=Torso.CFrame*CFrame.new(-0.43, -3.905, -0.1) | |
242 | Grass.Material='Grass' | |
243 | Grass.BrickColor=BrickColor.new('Bright green') | |
244 | m=Instance.new('CylinderMesh',Grass) | |
245 | White=Instance.new('Part',Character) | |
246 | White.Name='White Space' | |
247 | White.Anchored=true | |
248 | White.Size=Vector3.new(35.2, 0.05, 17.6) | |
249 | White.CFrame=Torso.CFrame*CFrame.new(0.39, -3.965, -0.1) | |
250 | White.Material='Neon' | |
251 | White.BrickColor=BrickColor.new('Medium stone grey') | |
252 | m=Instance.new('CylinderMesh',White) | |
253 | ||
254 | ||
255 | Humanoid.AutoRotate=false | |
256 | Humanoid.WalkSpeed=0 | |
257 | Humanoid.JumpPower=0 | |
258 | ||
259 | Flute=Instance.new('Part',Character) | |
260 | Flute.Name='Flute' | |
261 | Flute.CFrame=Torso.CFrame*CFrame.new(-0.5,-.5,-1)*CFrame.Angles(0,0,-2.5) | |
262 | m=Instance.new('SpecialMesh',Flute) | |
263 | m.MeshId='http://www.roblox.com/asset/?id=161269074' | |
264 | m.TextureId='http://www.roblox.com/asset/?id=228874694' | |
265 | m.Scale=Vector3.new(0.922, 0.922, 0.922) | |
266 | Flute.Size=Vector3.new(.5,2,.5) | |
267 | ||
268 | AutoWeld(Flute,Torso) | |
269 | THEME=Instance.new('Sound',Character.Torso) | |
270 | music=nil | |
271 | firsttype=false | |
272 | Player.Chatted:connect(function(msg) | |
273 | for def in string.gmatch(msg, "%d+") do | |
274 | print(def) | |
275 | ||
276 | if def~=nil then | |
277 | music=def | |
278 | end | |
279 | end | |
280 | ||
281 | for def in string.gmatch(msg,"[%u%l%p]+") do | |
282 | print(def) | |
283 | if def=='Play/' and music~=nil then | |
284 | THEME:stop() | |
285 | THEME.SoundId='rbxassetid://'.. music | |
286 | THEME:play() | |
287 | elseif def=='Play/Demo' then | |
288 | THEME:stop() | |
289 | THEME.SoundId='rbxassetid://'.. 164167420 | |
290 | THEME:play() | |
291 | elseif def=='S_Guitar' then | |
292 | THEME:stop() | |
293 | end | |
294 | end | |
295 | music=nil | |
296 | end) | |
297 | Ms=Player:GetMouse() | |
298 | Ms.KeyDown:connect(function(key) | |
299 | if key=='f' then | |
300 | if cam then | |
301 | cam=false | |
302 | CAM.CameraType='Custom' | |
303 | else | |
304 | cam=true | |
305 | CAM.CameraType='Scriptable' | |
306 | end | |
307 | end | |
308 | end) | |
309 | ||
310 | ||
311 | cam=true--Custom Camera Perspectives | |
312 | if cam==true then | |
313 | CAM.CameraType=Enum.CameraType.Scriptable | |
314 | ||
315 | end | |
316 | Campart1=Instance.new('Part',Character) | |
317 | Campart1.Transparency=1 | |
318 | Campart1.Anchored=true | |
319 | Campart1.CanCollide=false | |
320 | Campart2=Campart1:clone() | |
321 | Campart2.Parent=Character | |
322 | Campart3=Campart1:clone() | |
323 | Campart3.Parent=Character | |
324 | ||
325 | camtime=0 | |
326 | camphase=0 | |
327 | ||
328 | while 1 do | |
329 | wait() | |
330 | sine=sine+1 | |
331 | PlayAnimationFromTable({ | |
332 | CFrame.new(-math.cos(sine/16)*.2, math.cos(sine/8)/8, 0) * CFrame.Angles(0, 0, 0), | |
333 | CFrame.new(0, 1.5, 0) * CFrame.new(0, 0, -.3) * CFrame.Angles(-.5,0.5-THEME.PlaybackLoudness/150, 0), | |
334 | CFrame.new(1.5-THEME.PlaybackLoudness/700, .5, -.5)*CFrame.Angles(1.5+THEME.PlaybackLoudness/700,0,0-THEME.PlaybackLoudness/700), | |
335 | CFrame.new(-1.5+THEME.PlaybackLoudness/700, 0, -.5)*CFrame.Angles(1-THEME.PlaybackLoudness/700,0,0+THEME.PlaybackLoudness/700), | |
336 | CFrame.new(1+math.cos(sine/16)*.2,-2-math.cos(sine/8)/8, 0)*CFrame.Angles(0,0,0.5) , | |
337 | CFrame.new(-1+math.cos(sine/16)*.2,-2-math.cos(sine/8)/8,0)*CFrame.Angles(0,0,-0.5), | |
338 | }, .3, false) | |
339 | ||
340 | White.Size=Vector3.new(35.2+THEME.PlaybackLoudness/10, 0.05, 17.6+THEME.PlaybackLoudness/10) | |
341 | Campart1=Instance.new('Part') | |
342 | if cam==true then | |
343 | CAM.CameraType='Scriptable' | |
344 | Campart1.CFrame=Torso.CFrame*CFrame.new(8,8,8)*CFrame.Angles(-0.5,.5,-0.5) | |
345 | Campart2.CFrame=Torso.CFrame*CFrame.new(-8,-3,-5)*CFrame.Angles(-1,-2,-1) | |
346 | Campart3.CFrame=Flute.CFrame*CFrame.new(1.5,0,-1)*CFrame.Angles(0,1.8,3) | |
347 | if camphase==0 then | |
348 | if camtime<20+math.random(-2,2) then | |
349 | CAM.CFrame=Campart1.CFrame | |
350 | camtime=camtime+1 | |
351 | else | |
352 | camtime=0 | |
353 | camphase=camphase+1 | |
354 | end | |
355 | elseif camphase==1 then | |
356 | if camtime<40+math.random(-8,12) then | |
357 | CAM.CFrame=Campart2.CFrame | |
358 | camtime=camtime+1 | |
359 | else | |
360 | camtime=0 | |
361 | camphase=camphase+1 | |
362 | end | |
363 | elseif camphase==2 then | |
364 | if camtime<50+math.random(-2,5) then | |
365 | CAM.CFrame=Campart3.CFrame | |
366 | camtime=camtime+1 | |
367 | else | |
368 | camtime=0 | |
369 | camphase=camphase+1 | |
370 | end | |
371 | ||
372 | elseif camphase==3 then | |
373 | camphase=0 | |
374 | end | |
375 | ||
376 | ||
377 | end | |
378 | end |