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
- --[[
- creeper aw man
- by ethanhong0407
- what does this script do?
- absolutely nothing else but creeper awman
- enjoy lads
- dont look at the messy script pls im bad
- ]]
- local plr = owner
- local char = plr.Character
- local hum = char.Humanoid
- local rarm = char["Right Arm"]
- local larm = char["Left Arm"]
- local rleg = char["Right Leg"]
- local lleg = char["Left Leg"]
- local root = char.HumanoidRootPart
- local tors = char.Torso
- local head = char.Head
- local action = ""
- local t = tick()
- local RunS = game:GetService("RunService")
- local playback = 0
- hum.HipHeight = 0.5
- hum.WalkSpeed = 20
- head.Size = Vector3.new(2, 2, 2)
- rarm.Size = Vector3.new(1, 3, 1)
- larm.Size = Vector3.new(1, 3, 1)
- tors.Size = Vector3.new(2, 3, 1)
- rleg.Size = Vector3.new(1, 3, 1)
- lleg.Size = Vector3.new(1, 3, 1)
- local f = Instance.new("Decal", head)
- f.Name = "Texture"
- f.Texture = "rbxassetid://3755253739"
- f.Face = "Front"
- local fc = f:Clone()
- fc.Parent = head
- fc.Texture = "rbxassetid://3755175019"
- fc.Face = "Back"
- local fc = f:Clone()
- fc.Parent = head
- fc.Texture = "rbxassetid://3755174443"
- fc.Face = "Left"
- local fc = f:Clone()
- fc.Parent = head
- fc.Texture = "rbxassetid://3755252237"
- fc.Face = "Right"
- local fc = f:Clone()
- fc.Parent = head
- fc.Texture = "rbxassetid://3755175626"
- fc.Face = "Top"
- local glasses = Instance.new("Part", char)
- glasses.Anchored = false
- glasses.CanCollide = false
- glasses.Material = "Neon"
- glasses.Transparency = 1
- glasses.Size = Vector3.new(2.25, 2.25, 2.25)
- glasses.CastShadow = false
- local g = Instance.new("Decal", glasses)
- g.Name = "Texture"
- g.Texture = "rbxassetid://3755176276"
- g.Face = "Front"
- local gc = g:Clone()
- gc.Parent = glasses
- gc.Texture = "rbxassetid://3755177267"
- gc.Face = "Right"
- local gc = g:Clone()
- gc.Parent = glasses
- gc.Texture = "rbxassetid://3755176850"
- gc.Face = "Left"
- local glassesw = Instance.new("Weld", glasses)
- glassesw.Part0 = head
- glassesw.Part1 = glasses
- local mouth = Instance.new("Part", char)
- mouth.Name = "Mouth"
- mouth.BrickColor = BrickColor.new(Color3.new(0, 0, 0))
- mouth.Size = Vector3.new(1, 0.5, 2)
- local mouthm = Instance.new("Weld", mouth)
- mouthm.Part0 = head
- mouthm.Part1 = mouth
- mouthm.C0 = CFrame.new(0, -0.6, -0.01)
- local mouthsize = Instance.new("BlockMesh", mouth)
- for i,stuff in pairs(char:GetChildren()) do
- if stuff:IsA("Shirt") or stuff:IsA("Pants") or stuff:IsA("BodyColors") or stuff:IsA("Hat") or stuff:IsA("Accessory") or stuff:IsA("Accoutrement") or stuff:IsA("CharacterMesh") then
- stuff:Destroy()
- end
- end
- local music = Instance.new("Sound", head)
- music.SoundId = "rbxassetid://3807239428"
- music.Name = "Music"
- music.Volume = 5
- music.Looped = true
- music:Play()
- if head:FindFirstChild("Mesh") then head.Mesh:Destroy() end
- if head:FindFirstChild("face") then head.face:Destroy() end
- local shirt = Instance.new("Shirt", char)
- shirt.ShirtTemplate = "rbxassetid://3516317543"
- local pants = Instance.new("Pants", char)
- pants.PantsTemplate = "rbxassetid://3516314876"
- local colors = Instance.new("BodyColors", char)
- colors.HeadColor = BrickColor.new("Brick yellow")
- colors.LeftArmColor = BrickColor.new("Brick yellow")
- colors.RightArmColor = BrickColor.new("Brick yellow")
- colors.TorsoColor = BrickColor.new("Brick yellow")
- colors.LeftLegColor = BrickColor.new("Brick yellow")
- colors.RightLegColor = BrickColor.new("Brick yellow")
- function createJoint(wp0, wp1, wc0x, wc0y, wc0z, wc1x, wc1y, wc1z, name)
- local joint = Instance.new("Weld", wp0)
- joint.Part0 = wp0
- joint.Part1 = wp1
- joint.C0 = CFrame.new(wc0x, wc0y, wc0z)
- joint.C1 = CFrame.new(wc1x, wc1y, wc1z)
- joint.Name = name
- return joint
- end
- local RS = createJoint(char.Torso, char["Right Arm"], 1.5, 1, 0, 0, 1, 0, "Right Shoulder")
- local TS = createJoint(char.HumanoidRootPart, char.Torso, 0, 0, 0, 0, 0, 0, "RootJoint")
- local LS = createJoint(char.Torso, char["Left Arm"], -1.5, 1, 0, 0, 1, 0, "Left Shoulder")
- local RH = createJoint(char.Torso, char["Right Leg"], 0.5, -1.5, 0, 0, 1.5, 0, "Right Hip")
- local LH = createJoint(char.Torso, char["Left Leg"], -0.5, -1.5, 0, 0, 1.5, 0, "Left Hip")
- local NK = createJoint(char.Torso, char.Head, 0, 2, 0, 0, -1/2, 0, "Neck")
- local rsc0 = RS.C0
- local lsc0 = LS.C0
- local tsc0 = TS.C0
- local rhc0 = RH.C0
- local lhc0 = LH.C0
- local nkc0 = NK.C0
- local remote = Instance.new("RemoteFunction", char)
- remote.Name = "MouthRemote"
- function recieveInfo(player, info, n, t, ls, rs, lh, rh)
- playback = info
- NK.C0 = n
- TS.C0 = t
- LS.C0 = ls
- RS.C0 = rs
- LH.C0 = lh
- RH.C0 = rh
- return info
- end
- remote.OnServerInvoke = recieveInfo
- NLS([[
- local plr = owner
- local cam = workspace.CurrentCamera
- local char = plr.Character
- local NK = char.Torso:WaitForChild("Neck")
- local RS = char.Torso:WaitForChild("Right Shoulder")
- local LS = char.Torso:WaitForChild("Left Shoulder")
- local RH = char.Torso:WaitForChild("Right Hip")
- local LH = char.Torso:WaitForChild("Left Hip")
- local TS = char.HumanoidRootPart:WaitForChild("RootJoint")
- local hum = char.Humanoid
- local rsc0 = CFrame.new(1.5, 1, 0)
- local lsc0 = CFrame.new(-1.5, 1, 0)
- local tsc0 = CFrame.new()
- local rhc0 = CFrame.new(0.5, -1.5, 0)
- local lhc0 =CFrame.new(-0.5, -1.5, 0)
- local nkc0 = CFrame.new(0, 2, 0)
- local music = owner.Character.Head:WaitForChild("Music")
- local mouth = char:WaitForChild("Mouth")
- local mouthsize = mouth:WaitForChild("Mesh")
- local t = tick()
- local root = char.HumanoidRootPart
- local action = ""
- function lerp(a, b, t)
- return a * (1-t) + (b*t)
- end
- game:GetService("RunService").RenderStepped:connect(function()
- t = t + 0.5
- local playback = music.PlaybackLoudness
- local a = playback - 350
- a = a * 3
- if a < 0 then
- a = 0
- elseif a > 45 then
- a = 45
- end
- cam.FieldOfView = lerp(cam.FieldOfView, 70 + playback/20, 0.3)
- NK.C0 = NK.C0:lerp(nkc0 * CFrame.Angles(math.rad(a)/3, 0, 0), 0.1)
- mouthsize.Scale = mouthsize.Scale:lerp(Vector3.new(0.75+a/45/2, a/45, 1), 0.1)
- if not hum.Sit then
- if math.abs(root.Velocity.x) > 1 or math.abs(root.Velocity.z) > 1 and hum:GetState() ~= Enum.HumanoidStateType.Freefall then
- action = "Walk"
- elseif math.abs(root.Velocity.x) < 1 or math.abs(root.Velocity.z) < 1 then
- action = "Idle"
- end
- else
- action = "Sit"
- end
- NK.C0 = NK.C0:lerp(nkc0 * CFrame.Angles(math.rad(a)/3, 0, 0), 0.1)
- mouthsize.Scale = mouthsize.Scale:lerp(Vector3.new(0.75+a/45/2, a/45, 1), 0.1)
- if action == "Idle" then
- speed = 0.5
- TS.C0 = TS.C0:lerp(tsc0, speed)
- LS.C0 = LS.C0:lerp(lsc0 * CFrame.Angles(0, 0, math.rad(-2) + -math.sin(t/20)/10/2), speed)
- RS.C0 = RS.C0:lerp(rsc0 * CFrame.Angles(0, 0, math.rad(2) + math.sin(t/20)/10/2), speed)
- LH.C0 = LH.C0:lerp(lhc0, speed)
- RH.C0 = RH.C0:lerp(rhc0, speed)
- elseif action == "Walk" then
- speed = 0.5
- TS.C0 = TS.C0:lerp(tsc0, speed)
- LS.C0 = LS.C0:lerp(lsc0 * CFrame.Angles(math.sin(t/3)/1.5, 0, 0), speed)
- RS.C0 = RS.C0:lerp(rsc0 * CFrame.Angles(-math.sin(t/3)/1.5, 0, 0), speed)
- LH.C0 = LH.C0:lerp(lhc0 * CFrame.Angles(-math.sin(t/3)/1.5, 0, 0), speed)
- RH.C0 = RH.C0:lerp(rhc0 * CFrame.Angles(math.sin(t/3)/1.5, 0, 0), speed)
- elseif action == "Sit" then
- speed = 0.5
- TS.C0 = TS.C0:lerp(tsc0 * CFrame.new(0, 0.5, 0), speed)
- LS.C0 = LS.C0:lerp(lsc0 * CFrame.Angles(math.rad(15), 0, math.rad(-2) + -math.sin(t/20)/10/2), speed)
- RS.C0 = RS.C0:lerp(rsc0 * CFrame.Angles(math.rad(15), 0, math.rad(2) + math.sin(t/20)/10/2), speed)
- LH.C0 = LH.C0:lerp(lhc0 * CFrame.Angles(math.rad(90), 0, -math.rad(15)), speed)
- RH.C0 = RH.C0:lerp(rhc0 * CFrame.Angles(math.rad(90), 0, math.rad(15)), speed)
- end
- if owner.Character:WaitForChild("MouthRemote") then
- owner.Character.MouthRemote:InvokeServer(music.PlaybackLoudness, NK.C0, TS.C0, LS.C0, RS.C0, LH.C0, RH.C0)
- end
- end)
- ]], char)
- RunS.Stepped:connect(function()
- t = t + 0.5
- local a = playback - 350
- a = a * 3
- if a < 0 then
- a = 0
- elseif a > 45 then
- a = 45
- end
- NK.C0 = NK.C0:lerp(nkc0 * CFrame.Angles(math.rad(a)/3, 0, 0), 0.1)
- mouthsize.Scale = mouthsize.Scale:lerp(Vector3.new(0.75+a/45/2, a/45, 1), 0.1)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement