Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --https://github.com/Mokiros/roblox-FE-compatibility
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,game,owner = owner,game
- local RealPlayer = Player
- do
- print("FE Compatibility code V2 by Mokiros")
- local RealPlayer = RealPlayer
- script.Parent = RealPlayer.Character
- --Fake event to make stuff like Mouse.KeyDown work
- local Disconnect_Function = function(this)
- this[1].Functions[this[2]] = nil
- end
- local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
- local FakeEvent_Metatable = {__index={
- Connect = function(this,f)
- local i = tostring(math.random(0,10000))
- while this.Functions[i] do
- i = tostring(math.random(0,10000))
- end
- this.Functions[i] = f
- return setmetatable({this,i},Disconnect_Metatable)
- end
- }}
- FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
- local function fakeEvent()
- return setmetatable({Functions={}},FakeEvent_Metatable)
- end
- --Creating fake input objects with fake variables
- local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
- FakeMouse.keyUp = FakeMouse.KeyUp
- FakeMouse.keyDown = FakeMouse.KeyDown
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function TriggerEvent(self,ev,...)
- for _,f in pairs(self[ev].Functions) do
- f(...)
- end
- end
- FakeMouse.TriggerEvent = TriggerEvent
- UIS.TriggerEvent = TriggerEvent
- --Client communication
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=RealPlayer then return end
- FakeMouse.Target = io.Target
- FakeMouse.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
- end
- if io.UserInputType == Enum.UserInputType.MouseButton2 then
- return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
- local Mouse = owner:GetMouse()
- local UIS = game:GetService("UserInputService")
- local input = function(io,RobloxHandled)
- if RobloxHandled then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local h,t
- --Give the server mouse data every second frame, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- local HB = game:GetService("RunService").Heartbeat
- while true do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- --Wait 2 frames
- for i=1,2 do
- HB:Wait()
- end
- end]==],script)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local RealGame = game
- --Metatable for fake service
- local FakeService_Metatable = {
- __index = function(self,k)
- local s = rawget(self,"_RealService")
- if s then
- return typeof(s[k])=="function"
- and function(_,...)return s[k](s,...)end or s[k]
- end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end
- }
- local function FakeService(t,RealService)
- t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
- return setmetatable(t,FakeService_Metatable)
- end
- --Fake game object
- local FakeGame = {
- GetService = function(self,s)
- return rawget(self,s) or RealGame:GetService(s)
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- RunService = FakeService({
- _btrs = {},
- RenderStepped = RealGame:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- self._btrs[name] = self.Heartbeat:Connect(fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- }
- rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
- FakeGame.service = FakeGame.GetService
- FakeService(FakeGame,game)
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = FakeGame,FakeGame.Players.LocalPlayer
- end
- print('Guitar')
- print('By slenercat5')
- print('F to toggle Camera perspectives')--FANCY :D
- Player=game.Players.LocalPlayer
- Character=Player.Character
- Character.Animate.Disabled=true
- local LeftArm = Character["Left Arm"]
- local RightArm = Character["Right Arm"]
- local LeftLeg = Character["Left Leg"]
- local RightLeg = Character["Right Leg"]
- local Head = Character.Head
- local Torso = Character.Torso
- local Camera = game.Workspace.CurrentCamera
- local RootPart = Character.HumanoidRootPart
- local RootJoint = RootPart.RootJoint
- local Humanoid=Character.Humanoid
- CAM=Camera
- FF=Instance.new('ForceField',Character)
- FF.Visible=false
- Humanoid.Name='LOLOL YOU CANT HIT ME'
- Character.
- Health:remove()
- for i,v in pairs (Humanoid:GetPlayingAnimationTracks()) do
- v:Stop()
- end
- local newMotor = function(part0, part1, c0, c1)
- w = Instance.new('Motor')
- w.Parent = part0
- w.Part0 = part0
- w.Part1 = part1
- w.C0 = c0
- w.C1 = c1
- return w
- end
- RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
- NeckCF = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
- local RW = newMotor(Torso, RightArm, CFrame.new(2.5, 0, 0), CFrame.new(0, 0, 0))
- local LW = newMotor(Torso, LeftArm, CFrame.new(-2.5, 0, 0), CFrame.new(0, 0, 0))
- local RH = newMotor(Torso, RightLeg, CFrame.new(1.5, -3, 0), CFrame.new(0, 0, 0))
- local LH = newMotor(Torso, LeftLeg, CFrame.new(-1.5, -3, 0), CFrame.new(0, 0, 0))
- RootJoint.C1 = CFrame.new(0, 0, 0)
- RootJoint.C0 = CFrame.new(0, 0, 0)
- Torso.Neck.C1 = CFrame.new(0, 0, 0)
- Torso.Neck.C0 = CFrame.new(0, 2.5, 0)
- local rarmc1 = RW.C1
- local larmc1 = LW.C1
- local rlegc1 = RH.C1
- local llegc1 = LH.C1
- local resetc1 = false
- function clerp(a, b, t)
- return a:lerp(b, t)
- end
- function AutoWeld(Foop, OOF)
- local W = Instance.new("Weld")
- W.Part0 = Foop
- W.Part1 = OOF
- local CJ = CFrame.new(Foop.Position)
- local C0 = Foop.CFrame:inverse()*CJ
- local C1 = OOF.CFrame:inverse()*CJ
- W.C0 = C0
- W.C1 = C1
- W.Name='o0o'
- W.Parent = Foop
- end
- function PlayAnimationFromTable(table, speed, bool)
- RootJoint.C0 = clerp(RootJoint.C0, table[1], speed)
- Torso.Neck.C0 = clerp(Torso.Neck.C0, table[2], speed)
- RW.C0 = clerp(RW.C0, table[3], speed)
- LW.C0 = clerp(LW.C0, table[4], speed)
- RH.C0 = clerp(RH.C0, table[5], speed)
- LH.C0 = clerp(LH.C0, table[6], speed)
- if bool == true then
- if resetc1 == false then
- resetc1 = true
- RootJoint.C1 = RootJoint.C1
- Torso.Neck.C1 = Torso.Neck.C1
- RW.C1 = rarmc1
- LW.C1 = larmc1
- RH.C1 = rlegc1
- LH.C1 = llegc1
- end
- end
- end
- sine=1
- Torso.CFrame=Torso.CFrame*CFrame.new(0,1,0)
- Grass=Instance.new('Part',Character)
- Grass.Name='Grass'
- Grass.Anchored=true
- Grass.Size=Vector3.new(11.42, 0.17, 17.6)
- Grass.CFrame=Torso.CFrame*CFrame.new(-0.43, -3.905, -0.1)
- Grass.Material='Grass'
- Grass.BrickColor=BrickColor.new('Bright green')
- m=Instance.new('CylinderMesh',Grass)
- White=Instance.new('Part',Character)
- White.Name='White Space'
- White.Anchored=true
- White.Size=Vector3.new(35.2, 0.05, 17.6)
- White.CFrame=Torso.CFrame*CFrame.new(0.39, -3.965, -0.1)
- White.Material='Neon'
- White.BrickColor=BrickColor.new('Medium stone grey')
- m=Instance.new('CylinderMesh',White)
- Humanoid.AutoRotate=false
- Humanoid.WalkSpeed=0
- Humanoid.JumpPower=0
- Flute=Instance.new('Part',Character)
- Flute.Name='Flute'
- Flute.CFrame=Torso.CFrame*CFrame.new(-0.5,-.5,-1)*CFrame.Angles(0,0,-2.5)
- m=Instance.new('SpecialMesh',Flute)
- m.MeshId='http://www.roblox.com/asset/?id=161269074'
- m.TextureId='http://www.roblox.com/asset/?id=228874694'
- m.Scale=Vector3.new(0.922, 0.922, 0.922)
- Flute.Size=Vector3.new(.5,2,.5)
- AutoWeld(Flute,Torso)
- THEME=Instance.new('Sound',Character.Torso)
- music=nil
- firsttype=false
- Player.Chatted:connect(function(msg)
- for def in string.gmatch(msg, "%d+") do
- print(def)
- if def~=nil then
- music=def
- end
- end
- for def in string.gmatch(msg,"[%u%l%p]+") do
- print(def)
- if def=='Play/' and music~=nil then
- THEME:stop()
- THEME.SoundId='rbxassetid://'.. music
- THEME:play()
- elseif def=='Play/Demo' then
- THEME:stop()
- THEME.SoundId='rbxassetid://'.. 164167420
- THEME:play()
- elseif def=='S_Guitar' then
- THEME:stop()
- end
- end
- music=nil
- end)
- Ms=Player:GetMouse()
- Ms.KeyDown:connect(function(key)
- if key=='f' then
- if cam then
- cam=false
- CAM.CameraType='Custom'
- else
- cam=true
- CAM.CameraType='Scriptable'
- end
- end
- end)
- cam=true--Custom Camera Perspectives
- if cam==true then
- CAM.CameraType=Enum.CameraType.Scriptable
- end
- Campart1=Instance.new('Part',Character)
- Campart1.Transparency=1
- Campart1.Anchored=true
- Campart1.CanCollide=false
- Campart2=Campart1:clone()
- Campart2.Parent=Character
- Campart3=Campart1:clone()
- Campart3.Parent=Character
- camtime=0
- camphase=0
- while 1 do
- wait()
- sine=sine+1
- PlayAnimationFromTable({
- CFrame.new(-math.cos(sine/16)*.2, math.cos(sine/8)/8, 0) * CFrame.Angles(0, 0, 0),
- CFrame.new(0, 1.5, 0) * CFrame.new(0, 0, -.3) * CFrame.Angles(-.5,0.5-THEME.PlaybackLoudness/150, 0),
- CFrame.new(1.5-THEME.PlaybackLoudness/700, .5, -.5)*CFrame.Angles(1.5+THEME.PlaybackLoudness/700,0,0-THEME.PlaybackLoudness/700),
- CFrame.new(-1.5+THEME.PlaybackLoudness/700, 0, -.5)*CFrame.Angles(1-THEME.PlaybackLoudness/700,0,0+THEME.PlaybackLoudness/700),
- CFrame.new(1+math.cos(sine/16)*.2,-2-math.cos(sine/8)/8, 0)*CFrame.Angles(0,0,0.5) ,
- CFrame.new(-1+math.cos(sine/16)*.2,-2-math.cos(sine/8)/8,0)*CFrame.Angles(0,0,-0.5),
- }, .3, false)
- White.Size=Vector3.new(35.2+THEME.PlaybackLoudness/10, 0.05, 17.6+THEME.PlaybackLoudness/10)
- Campart1=Instance.new('Part')
- if cam==true then
- CAM.CameraType='Scriptable'
- Campart1.CFrame=Torso.CFrame*CFrame.new(8,8,8)*CFrame.Angles(-0.5,.5,-0.5)
- Campart2.CFrame=Torso.CFrame*CFrame.new(-8,-3,-5)*CFrame.Angles(-1,-2,-1)
- Campart3.CFrame=Flute.CFrame*CFrame.new(1.5,0,-1)*CFrame.Angles(0,1.8,3)
- if camphase==0 then
- if camtime<20+math.random(-2,2) then
- CAM.CFrame=Campart1.CFrame
- camtime=camtime+1
- else
- camtime=0
- camphase=camphase+1
- end
- elseif camphase==1 then
- if camtime<40+math.random(-8,12) then
- CAM.CFrame=Campart2.CFrame
- camtime=camtime+1
- else
- camtime=0
- camphase=camphase+1
- end
- elseif camphase==2 then
- if camtime<50+math.random(-2,5) then
- CAM.CFrame=Campart3.CFrame
- camtime=camtime+1
- else
- camtime=0
- camphase=camphase+1
- end
- elseif camphase==3 then
- camphase=0
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement