Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.12 KB | None | 0 0
  1.  
  2. --https://github.com/Mokiros/roblox-FE-compatibility
  3. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  4. local Player,game,owner = owner,game
  5. local RealPlayer = Player
  6. do
  7. print("FE Compatibility code V2 by Mokiros")
  8. local RealPlayer = RealPlayer
  9. script.Parent = RealPlayer.Character
  10.  
  11. --Fake event to make stuff like Mouse.KeyDown work
  12. local Disconnect_Function = function(this)
  13. this[1].Functions[this[2]] = nil
  14. end
  15. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  16. local FakeEvent_Metatable = {__index={
  17. Connect = function(this,f)
  18. local i = tostring(math.random(0,10000))
  19. while this.Functions[i] do
  20. i = tostring(math.random(0,10000))
  21. end
  22. this.Functions[i] = f
  23. return setmetatable({this,i},Disconnect_Metatable)
  24. end
  25. }}
  26. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  27. local function fakeEvent()
  28. return setmetatable({Functions={}},FakeEvent_Metatable)
  29. end
  30.  
  31. --Creating fake input objects with fake variables
  32. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  33. FakeMouse.keyUp = FakeMouse.KeyUp
  34. FakeMouse.keyDown = FakeMouse.KeyDown
  35. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  36. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  37. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  38. end}
  39. --Merged 2 functions into one by checking amount of arguments
  40. CAS.UnbindAction = CAS.BindAction
  41.  
  42. --This function will trigger the events that have been :Connect()'ed
  43. local function TriggerEvent(self,ev,...)
  44. for _,f in pairs(self[ev].Functions) do
  45. f(...)
  46. end
  47. end
  48. FakeMouse.TriggerEvent = TriggerEvent
  49. UIS.TriggerEvent = TriggerEvent
  50.  
  51. --Client communication
  52. local Event = Instance.new("RemoteEvent")
  53. Event.Name = "UserInput_Event"
  54. Event.OnServerEvent:Connect(function(plr,io)
  55. if plr~=RealPlayer then return end
  56. FakeMouse.Target = io.Target
  57. FakeMouse.Hit = io.Hit
  58. if not io.isMouse then
  59. local b = io.UserInputState == Enum.UserInputState.Begin
  60. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  61. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  62. end
  63. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  64. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  65. end
  66. for _,t in pairs(CAS.Actions) do
  67. for _,k in pairs(t.Keys) do
  68. if k==io.KeyCode then
  69. t.Function(t.Name,io.UserInputState,io)
  70. end
  71. end
  72. end
  73. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  74. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  75. end
  76. end)
  77. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  78. local Mouse = owner:GetMouse()
  79. local UIS = game:GetService("UserInputService")
  80. local input = function(io,RobloxHandled)
  81. if RobloxHandled then return end
  82. --Since InputObject is a client-side instance, we create and pass table instead
  83. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  84. end
  85. UIS.InputBegan:Connect(input)
  86. UIS.InputEnded:Connect(input)
  87. local h,t
  88. --Give the server mouse data every second frame, but only if the values changed
  89. --If player is not moving their mouse, client won't fire events
  90. local HB = game:GetService("RunService").Heartbeat
  91. while true do
  92. if h~=Mouse.Hit or t~=Mouse.Target then
  93. h,t=Mouse.Hit,Mouse.Target
  94. Event:FireServer({isMouse=true,Target=t,Hit=h})
  95. end
  96. --Wait 2 frames
  97. for i=1,2 do
  98. HB:Wait()
  99. end
  100. end]==],script)
  101.  
  102. ----Sandboxed game object that allows the usage of client-side methods and services
  103. --Real game object
  104. local RealGame = game
  105.  
  106. --Metatable for fake service
  107. local FakeService_Metatable = {
  108. __index = function(self,k)
  109. local s = rawget(self,"_RealService")
  110. if s then
  111. return typeof(s[k])=="function"
  112. and function(_,...)return s[k](s,...)end or s[k]
  113. end
  114. end,
  115. __newindex = function(self,k,v)
  116. local s = rawget(self,"_RealService")
  117. if s then s[k]=v end
  118. end
  119. }
  120. local function FakeService(t,RealService)
  121. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  122. return setmetatable(t,FakeService_Metatable)
  123. end
  124.  
  125. --Fake game object
  126. local FakeGame = {
  127. GetService = function(self,s)
  128. return rawget(self,s) or RealGame:GetService(s)
  129. end,
  130. Players = FakeService({
  131. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  132. },"Players"),
  133. UserInputService = FakeService(UIS,"UserInputService"),
  134. ContextActionService = FakeService(CAS,"ContextActionService"),
  135. RunService = FakeService({
  136. _btrs = {},
  137. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  138. BindToRenderStep = function(self,name,_,fun)
  139. self._btrs[name] = self.Heartbeat:Connect(fun)
  140. end,
  141. UnbindFromRenderStep = function(self,name)
  142. self._btrs[name]:Disconnect()
  143. end,
  144. },"RunService")
  145. }
  146. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  147. FakeGame.service = FakeGame.GetService
  148. FakeService(FakeGame,game)
  149. --Changing owner to fake player object to support owner:GetMouse()
  150. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  151. end
  152. introsound = Instance.new("Sound",Head)
  153. introsound.SoundId = "rbxassetid://2698534079"
  154. introsound.Volume = 3.5
  155. introsound:Play()
  156. end
  157. player = game.Players.LocalPlayer
  158. char = player.Character
  159. mouse = player:GetMouse()
  160.  
  161. local skincolor = "Light orange" -- change this to whatever brickcolor you want
  162.  
  163. ls = char.Torso["Left Shoulder"]:Clone()
  164. rs = char.Torso["Right Shoulder"]:Clone()
  165. lh = char.Torso["Left Hip"]:Clone()
  166. rh = char.Torso["Right Hip"]:Clone()
  167. ne = char.Torso.Neck
  168. rj = char.HumanoidRootPart.RootJoint
  169.  
  170. char.Torso.BrickColor = BrickColor.new(skincolor)
  171. char.Head.BrickColor = BrickColor.new(skincolor)
  172. char["Right Arm"].BrickColor = BrickColor.new(skincolor)
  173. char["Left Arm"].BrickColor = BrickColor.new(skincolor)
  174. char["Right Leg"].BrickColor = BrickColor.new(skincolor)
  175. char["Left Leg"].BrickColor = BrickColor.new(skincolor)
  176.  
  177. e = Instance.new("Sound", char.Head)
  178. e.SoundId = "rbxassetid://880159023"
  179.  
  180. char.Head.Mesh.Scale = Vector3.new(3.25, 3.25, 3.25)
  181. char["Left Arm"].Size = Vector3.new(1, 3, 1)
  182. char["Right Arm"].Size = Vector3.new(1, 3, 1)
  183. char["Left Leg"].Size = Vector3.new(1, 3, 1)
  184. char["Right Leg"].Size = Vector3.new(1, 3, 1)
  185.  
  186. rj.C0 = CFrame.new(0, -1.5, 0) * CFrame.Angles(0, math.rad(180), 0)
  187. ne.C0 = CFrame.new(0, 1, 0.5) * CFrame.Angles(0, 0, math.rad(180))
  188.  
  189. leftshoulder = ls:Clone()
  190. leftshoulder.Parent = char.Torso
  191. leftshoulder.C0 = CFrame.new(-2, 0.5, -0.5) * CFrame.Angles(math.rad(90), math.rad(90), 0)
  192.  
  193. rightshoulder = rs:Clone()
  194. rightshoulder.Parent = char.Torso
  195. rightshoulder.C0 = CFrame.new(1, 0.5, -0.5) * CFrame.Angles(math.rad(90), math.rad(90), 0)
  196.  
  197. leftleg = lh:Clone()
  198. leftleg.Parent = char.Torso
  199. leftleg.C0 = CFrame.new(1, -1.5, -0) * CFrame.Angles(math.rad(90), math.rad(90), 0)
  200.  
  201. rightleg = rh:Clone()
  202. rightleg.Parent = char.Torso
  203. rightleg.C0 = CFrame.new(0, -1.5, -0) * CFrame.Angles(math.rad(90), math.rad(90), 0)
  204.  
  205. for i, v in pairs(char:GetChildren()) do
  206. if v.ClassName == "Accessory" or v.ClassName == "Shirt" or v.ClassName == "Pants" then
  207. v:Remove()
  208. end
  209. end
  210.  
  211. char.Humanoid.WalkSpeed = 450
  212. char.Humanoid.JumpPower = 150
  213. char.Humanoid.MaxHealth = math.huge
  214. char.Humanoid.Health = math.huge
  215.  
  216. char.Head.face:Remove()
  217.  
  218. char.Head.Touched:connect(function(h)
  219. if h.Parent ~= char then
  220. egg = h.Parent:FindFirstChild("Humanoid")
  221. if egg ~= nil then
  222. egg.Health = egg.Health - 5
  223. egg.WalkSpeed = egg.WalkSpeed - 30
  224. egg.JumpPower = egg.JumpPower - 4
  225. e:Play()
  226. mouse.KeyDown:connect(function(Press)
  227. Press=Press:lower()
  228. if Press=='k' then
  229. jam = Instance.new("Sound",Torso)
  230. jam.SoundId = "rbxassetid://665751753"
  231. jam.Volume = 8
  232. jam.Looped = true
  233. jam.TimePosition = 22.3
  234. jam:Play()
  235. end
  236. end
  237. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement