SHOW:
|
|
- or go back to the newest paste.
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") | |
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 | self._btrs[name] = self.Heartbeat:Connect(fun) | |
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 | ||
145 | print('Guitar') | |
146 | print('By slenercat5') | |
147 | print('F to toggle Camera perspectives')--FANCY :D | |
148 | Player=game.Players.LocalPlayer | |
149 | Character=Player.Character | |
150 | Character.Animate.Disabled=true | |
151 | local LeftArm = Character["Left Arm"] | |
152 | local RightArm = Character["Right Arm"] | |
153 | local LeftLeg = Character["Left Leg"] | |
154 | local RightLeg = Character["Right Leg"] | |
155 | local Head = Character.Head | |
156 | local Torso = Character.Torso | |
157 | local Camera = game.Workspace.CurrentCamera | |
158 | local RootPart = Character.HumanoidRootPart | |
159 | local RootJoint = RootPart.RootJoint | |
160 | local Humanoid=Character.Humanoid | |
161 | CAM=Camera | |
162 | FF=Instance.new('ForceField',Character) | |
163 | FF.Visible=false | |
164 | Humanoid.Name='LOLOL YOU CANT HIT ME' | |
165 | Character. | |
166 | Health:remove() | |
167 | for i,v in pairs (Humanoid:GetPlayingAnimationTracks()) do | |
168 | v:Stop() | |
169 | end | |
170 | ||
171 | local newMotor = function(part0, part1, c0, c1) | |
172 | w = Instance.new('Motor') | |
173 | w.Parent = part0 | |
174 | w.Part0 = part0 | |
175 | w.Part1 = part1 | |
176 | w.C0 = c0 | |
177 | w.C1 = c1 | |
178 | ||
179 | return w | |
180 | end | |
181 | ||
182 | ||
183 | ||
184 | ||
185 | RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14) | |
186 | NeckCF = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
187 | ||
188 | local RW = newMotor(Torso, RightArm, CFrame.new(2.5, 0, 0), CFrame.new(0, 0, 0)) | |
189 | local LW = newMotor(Torso, LeftArm, CFrame.new(-2.5, 0, 0), CFrame.new(0, 0, 0)) | |
190 | local RH = newMotor(Torso, RightLeg, CFrame.new(1.5, -3, 0), CFrame.new(0, 0, 0)) | |
191 | local LH = newMotor(Torso, LeftLeg, CFrame.new(-1.5, -3, 0), CFrame.new(0, 0, 0)) | |
192 | RootJoint.C1 = CFrame.new(0, 0, 0) | |
193 | RootJoint.C0 = CFrame.new(0, 0, 0) | |
194 | Torso.Neck.C1 = CFrame.new(0, 0, 0) | |
195 | Torso.Neck.C0 = CFrame.new(0, 2.5, 0) | |
196 | ||
197 | local rarmc1 = RW.C1 | |
198 | local larmc1 = LW.C1 | |
199 | local rlegc1 = RH.C1 | |
200 | local llegc1 = LH.C1 | |
201 | ||
202 | local resetc1 = false | |
203 | ||
204 | function clerp(a, b, t) | |
205 | return a:lerp(b, t) | |
206 | end | |
207 | function AutoWeld(Foop, OOF) | |
208 | local W = Instance.new("Weld") | |
209 | W.Part0 = Foop | |
210 | W.Part1 = OOF | |
211 | local CJ = CFrame.new(Foop.Position) | |
212 | local C0 = Foop.CFrame:inverse()*CJ | |
213 | local C1 = OOF.CFrame:inverse()*CJ | |
214 | W.C0 = C0 | |
215 | W.C1 = C1 | |
216 | W.Name='o0o' | |
217 | W.Parent = Foop | |
218 | ||
219 | end | |
220 | ||
221 | ||
222 | ||
223 | function PlayAnimationFromTable(table, speed, bool) | |
224 | RootJoint.C0 = clerp(RootJoint.C0, table[1], speed) | |
225 | Torso.Neck.C0 = clerp(Torso.Neck.C0, table[2], speed) | |
226 | RW.C0 = clerp(RW.C0, table[3], speed) | |
227 | LW.C0 = clerp(LW.C0, table[4], speed) | |
228 | RH.C0 = clerp(RH.C0, table[5], speed) | |
229 | LH.C0 = clerp(LH.C0, table[6], speed) | |
230 | if bool == true then | |
231 | if resetc1 == false then | |
232 | resetc1 = true | |
233 | RootJoint.C1 = RootJoint.C1 | |
234 | Torso.Neck.C1 = Torso.Neck.C1 | |
235 | RW.C1 = rarmc1 | |
236 | LW.C1 = larmc1 | |
237 | RH.C1 = rlegc1 | |
238 | LH.C1 = llegc1 | |
239 | end | |
240 | end | |
241 | end | |
242 | sine=1 | |
243 | ||
244 | Torso.CFrame=Torso.CFrame*CFrame.new(0,1,0) | |
245 | ||
246 | ||
247 | Grass=Instance.new('Part',Character) | |
248 | Grass.Name='Grass' | |
249 | Grass.Anchored=true | |
250 | Grass.Size=Vector3.new(11.42, 0.17, 17.6) | |
251 | Grass.CFrame=Torso.CFrame*CFrame.new(-0.43, -3.905, -0.1) | |
252 | Grass.Material='Grass' | |
253 | Grass.BrickColor=BrickColor.new('Bright green') | |
254 | m=Instance.new('CylinderMesh',Grass) | |
255 | White=Instance.new('Part',Character) | |
256 | White.Name='White Space' | |
257 | White.Anchored=true | |
258 | White.Size=Vector3.new(35.2, 0.05, 17.6) | |
259 | White.CFrame=Torso.CFrame*CFrame.new(0.39, -3.965, -0.1) | |
260 | White.Material='Neon' | |
261 | White.BrickColor=BrickColor.new('Medium stone grey') | |
262 | m=Instance.new('CylinderMesh',White) | |
263 | ||
264 | ||
265 | Humanoid.AutoRotate=false | |
266 | Humanoid.WalkSpeed=0 | |
267 | Humanoid.JumpPower=0 | |
268 | ||
269 | Flute=Instance.new('Part',Character) | |
270 | Flute.Name='Flute' | |
271 | Flute.CFrame=Torso.CFrame*CFrame.new(-0.5,-.5,-1)*CFrame.Angles(0,0,-2.5) | |
272 | m=Instance.new('SpecialMesh',Flute) | |
273 | m.MeshId='http://www.roblox.com/asset/?id=161269074' | |
274 | m.TextureId='http://www.roblox.com/asset/?id=228874694' | |
275 | m.Scale=Vector3.new(0.922, 0.922, 0.922) | |
276 | Flute.Size=Vector3.new(.5,2,.5) | |
277 | ||
278 | AutoWeld(Flute,Torso) | |
279 | THEME=Instance.new('Sound',Character.Torso) | |
280 | music=nil | |
281 | firsttype=false | |
282 | Player.Chatted:connect(function(msg) | |
283 | for def in string.gmatch(msg, "%d+") do | |
284 | print(def) | |
285 | ||
286 | if def~=nil then | |
287 | music=def | |
288 | end | |
289 | end | |
290 | ||
291 | for def in string.gmatch(msg,"[%u%l%p]+") do | |
292 | print(def) | |
293 | if def=='Play/' and music~=nil then | |
294 | THEME:stop() | |
295 | THEME.SoundId='rbxassetid://'.. music | |
296 | THEME:play() | |
297 | elseif def=='Play/Demo' then | |
298 | THEME:stop() | |
299 | THEME.SoundId='rbxassetid://'.. 164167420 | |
300 | THEME:play() | |
301 | elseif def=='S_Guitar' then | |
302 | THEME:stop() | |
303 | end | |
304 | end | |
305 | music=nil | |
306 | end) | |
307 | Ms=Player:GetMouse() | |
308 | Ms.KeyDown:connect(function(key) | |
309 | if key=='f' then | |
310 | if cam then | |
311 | cam=false | |
312 | CAM.CameraType='Custom' | |
313 | else | |
314 | cam=true | |
315 | CAM.CameraType='Scriptable' | |
316 | end | |
317 | end | |
318 | end) | |
319 | ||
320 | ||
321 | cam=true--Custom Camera Perspectives | |
322 | if cam==true then | |
323 | CAM.CameraType=Enum.CameraType.Scriptable | |
324 | ||
325 | end | |
326 | Campart1=Instance.new('Part',Character) | |
327 | Campart1.Transparency=1 | |
328 | Campart1.Anchored=true | |
329 | Campart1.CanCollide=false | |
330 | Campart2=Campart1:clone() | |
331 | Campart2.Parent=Character | |
332 | Campart3=Campart1:clone() | |
333 | Campart3.Parent=Character | |
334 | ||
335 | camtime=0 | |
336 | camphase=0 | |
337 | ||
338 | while 1 do | |
339 | wait() | |
340 | sine=sine+1 | |
341 | PlayAnimationFromTable({ | |
342 | CFrame.new(-math.cos(sine/16)*.2, math.cos(sine/8)/8, 0) * CFrame.Angles(0, 0, 0), | |
343 | CFrame.new(0, 1.5, 0) * CFrame.new(0, 0, -.3) * CFrame.Angles(-.5,0.5-THEME.PlaybackLoudness/150, 0), | |
344 | CFrame.new(1.5-THEME.PlaybackLoudness/700, .5, -.5)*CFrame.Angles(1.5+THEME.PlaybackLoudness/700,0,0-THEME.PlaybackLoudness/700), | |
345 | CFrame.new(-1.5+THEME.PlaybackLoudness/700, 0, -.5)*CFrame.Angles(1-THEME.PlaybackLoudness/700,0,0+THEME.PlaybackLoudness/700), | |
346 | CFrame.new(1+math.cos(sine/16)*.2,-2-math.cos(sine/8)/8, 0)*CFrame.Angles(0,0,0.5) , | |
347 | CFrame.new(-1+math.cos(sine/16)*.2,-2-math.cos(sine/8)/8,0)*CFrame.Angles(0,0,-0.5), | |
348 | }, .3, false) | |
349 | ||
350 | White.Size=Vector3.new(35.2+THEME.PlaybackLoudness/10, 0.05, 17.6+THEME.PlaybackLoudness/10) | |
351 | Campart1=Instance.new('Part') | |
352 | if cam==true then | |
353 | CAM.CameraType='Scriptable' | |
354 | Campart1.CFrame=Torso.CFrame*CFrame.new(8,8,8)*CFrame.Angles(-0.5,.5,-0.5) | |
355 | Campart2.CFrame=Torso.CFrame*CFrame.new(-8,-3,-5)*CFrame.Angles(-1,-2,-1) | |
356 | Campart3.CFrame=Flute.CFrame*CFrame.new(1.5,0,-1)*CFrame.Angles(0,1.8,3) | |
357 | if camphase==0 then | |
358 | if camtime<20+math.random(-2,2) then | |
359 | CAM.CFrame=Campart1.CFrame | |
360 | camtime=camtime+1 | |
361 | else | |
362 | camtime=0 | |
363 | camphase=camphase+1 | |
364 | end | |
365 | elseif camphase==1 then | |
366 | if camtime<40+math.random(-8,12) then | |
367 | CAM.CFrame=Campart2.CFrame | |
368 | camtime=camtime+1 | |
369 | else | |
370 | camtime=0 | |
371 | camphase=camphase+1 | |
372 | end | |
373 | elseif camphase==2 then | |
374 | if camtime<50+math.random(-2,5) then | |
375 | CAM.CFrame=Campart3.CFrame | |
376 | camtime=camtime+1 | |
377 | else | |
378 | camtime=0 | |
379 | camphase=camphase+1 | |
380 | end | |
381 | ||
382 | elseif camphase==3 then | |
383 | camphase=0 | |
384 | end | |
385 | ||
386 | ||
387 | end | |
388 | end |