sIendytubble

citizen

May 17th, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.41 KB | None | 0 0
  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 V2 by Mokiros")
  6. local RealPlayer = RealPlayer
  7. script.Parent = RealPlayer.Character
  8.  
  9. --Fake event to make stuff like Mouse.KeyDown work
  10. local Disconnect_Function = function(this)
  11. this[1].Functions[this[2]] = nil
  12. end
  13. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  14. local FakeEvent_Metatable = {__index={
  15. Connect = function(this,f)
  16. local i = tostring(math.random(0,10000))
  17. while this.Functions[i] do
  18. i = tostring(math.random(0,10000))
  19. end
  20. this.Functions[i] = f
  21. return setmetatable({this,i},Disconnect_Metatable)
  22. end
  23. }}
  24. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  25. local function fakeEvent()
  26. return setmetatable({Functions={}},FakeEvent_Metatable)
  27. end
  28.  
  29. --Creating fake input objects with fake variables
  30. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  31. FakeMouse.keyUp = FakeMouse.KeyUp
  32. FakeMouse.keyDown = FakeMouse.KeyDown
  33. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  34. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  35. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  36. end}
  37. --Merged 2 functions into one by checking amount of arguments
  38. CAS.UnbindAction = CAS.BindAction
  39.  
  40. --This function will trigger the events that have been :Connect()'ed
  41. local function TriggerEvent(self,ev,...)
  42. for _,f in pairs(self[ev].Functions) do
  43. f(...)
  44. end
  45. end
  46. FakeMouse.TriggerEvent = TriggerEvent
  47. UIS.TriggerEvent = TriggerEvent
  48.  
  49. --Client communication
  50. local Event = Instance.new("RemoteEvent")
  51. Event.Name = "UserInput_Event"
  52. Event.OnServerEvent:Connect(function(plr,io)
  53. if plr~=RealPlayer then return end
  54. FakeMouse.Target = io.Target
  55. FakeMouse.Hit = io.Hit
  56. if not io.isMouse then
  57. local b = io.UserInputState == Enum.UserInputState.Begin
  58. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  59. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  60. end
  61. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  62. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  63. end
  64. for _,t in pairs(CAS.Actions) do
  65. for _,k in pairs(t.Keys) do
  66. if k==io.KeyCode then
  67. t.Function(t.Name,io.UserInputState,io)
  68. end
  69. end
  70. end
  71. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  72. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  73. end
  74. end)
  75. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  76. local Mouse = owner:GetMouse()
  77. local UIS = game:GetService("UserInputService")
  78. local input = function(io,RobloxHandled)
  79. if RobloxHandled then return end
  80. --Since InputObject is a client-side instance, we create and pass table instead
  81. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  82. end
  83. UIS.InputBegan:Connect(input)
  84. UIS.InputEnded:Connect(input)
  85.  
  86. local h,t
  87. --Give the server mouse data every second frame, but only if the values changed
  88. --If player is not moving their mouse, client won't fire events
  89. local HB = game:GetService("RunService").Heartbeat
  90. while true do
  91. if h~=Mouse.Hit or t~=Mouse.Target then
  92. h,t=Mouse.Hit,Mouse.Target
  93. Event:FireServer({isMouse=true,Target=t,Hit=h})
  94. end
  95. --Wait 2 frames
  96. for i=1,2 do
  97. HB:Wait()
  98. end
  99. end]==],script)
  100.  
  101. ----Sandboxed game object that allows the usage of client-side methods and services
  102. --Real game object
  103. local RealGame = game
  104.  
  105. --Metatable for fake service
  106. local FakeService_Metatable = {
  107. __index = function(self,k)
  108. local s = rawget(self,"_RealService")
  109. if s then
  110. return typeof(s[k])=="function"
  111. and function(_,...)return s[k](s,...)end or s[k]
  112. end
  113. end,
  114. __newindex = function(self,k,v)
  115. local s = rawget(self,"_RealService")
  116. if s then s[k]=v end
  117. end
  118. }
  119. local function FakeService(t,RealService)
  120. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  121. return setmetatable(t,FakeService_Metatable)
  122. end
  123.  
  124. --Fake game object
  125. local FakeGame = {
  126. GetService = function(self,s)
  127. return rawget(self,s) or RealGame:GetService(s)
  128. end,
  129. Players = FakeService({
  130. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  131. },"Players"),
  132. UserInputService = FakeService(UIS,"UserInputService"),
  133. ContextActionService = FakeService(CAS,"ContextActionService"),
  134. RunService = FakeService({
  135. _btrs = {},
  136. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  137. BindToRenderStep = function(self,name,_,fun)
  138. self._btrs[name] = self.Heartbeat:Connect(fun)
  139. end,
  140. UnbindFromRenderStep = function(self,name)
  141. self._btrs[name]:Disconnect()
  142. end,
  143. },"RunService")
  144. }
  145. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  146. FakeGame.service = FakeGame.GetService
  147. FakeService(FakeGame,game)
  148. --Changing owner to fake player object to support owner:GetMouse()
  149. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  150. end
  151. corl = owner
  152. mouse = corl:GetMouse()
  153. char = corl.Character
  154. mas = char
  155. mas2 = char.Head
  156. Figure = char
  157. local head = char:WaitForChild("Head")
  158. local Torso = char:WaitForChild("Torso")
  159. local LArm = char:WaitForChild("Left Arm")
  160. local RArm = char:WaitForChild("Right Arm")
  161. local LLeg = char:WaitForChild("Left Leg")
  162. local RLeg = char:WaitForChild("Right Leg")
  163. local humanoid = char:WaitForChild("Humanoid")
  164. local rootpart = char:WaitForChild("HumanoidRootPart")
  165. for i,v in pairs(char:GetChildren()) do
  166. if v.ClassName == "Accessory" then
  167. v:remove()
  168. v.Parent = nil
  169. v:Destroy()
  170. end
  171. end
  172. local p = char.Torso.CFrame
  173. BODYCOLORS = char:WaitForChild("Body Colors")
  174. BODYCOLORS.HeadColor = BrickColor.new("Light orange")
  175. BODYCOLORS.TorsoColor = BrickColor.new("Light orange")
  176. BODYCOLORS.LeftArmColor = BrickColor.new("Light orange")
  177. BODYCOLORS.LeftLegColor = BrickColor.new("Light orange")
  178. BODYCOLORS.RightArmColor = BrickColor.new("Light orange")
  179. BODYCOLORS.RightLegColor = BrickColor.new("Light orange")
  180. for i,v in pairs(char.Head:GetChildren()) do
  181. if v.ClassName == "Decal" then
  182. v:remove()
  183. v.Parent = nil
  184. v:Destroy()
  185. end
  186. end
  187. for i,v in pairs(char:GetChildren()) do
  188. if v.ClassName == "CharacterMesh" then
  189. v:remove()
  190. v.Parent = nil
  191. v:Destroy()
  192. end
  193. end
  194. for i,v in pairs(char:GetChildren()) do
  195. if v.ClassName == "Shirt" then
  196. v:remove()
  197. v.Parent = nil
  198. v:Destroy()
  199. end
  200. end
  201. for i,v in pairs(char:GetChildren()) do
  202. if v.ClassName == "Pants" then
  203. v:remove()
  204. v.Parent = nil
  205. v:Destroy()
  206. end
  207. end
  208. for i,v in pairs(char.Head:GetChildren()) do
  209. v.Parent = nil
  210. end
  211. Model0 = char
  212. CharacterMesh1 = Instance.new("CharacterMesh")
  213. CharacterMesh2 = Instance.new("CharacterMesh")
  214. CharacterMesh3 = Instance.new("CharacterMesh")
  215. CharacterMesh4 = Instance.new("CharacterMesh")
  216. CharacterMesh5 = Instance.new("CharacterMesh")
  217. BodyColors6 = Instance.new("BodyColors")
  218. Shirt7 = Instance.new("Shirt")
  219. Pants8 = Instance.new("Pants")
  220. Accessory9 = Instance.new("Accessory")
  221. Part10 = Instance.new("Part")
  222. SpecialMesh11 = Instance.new("SpecialMesh")
  223. Vector3Value12 = Instance.new("Vector3Value")
  224. Camera13 = Instance.new("Camera")
  225. CharacterMesh1.Name = "Silver Robot Torso"
  226. CharacterMesh1.Parent = Model0
  227. CharacterMesh1.BodyPart = Enum.BodyPart.Torso
  228. CharacterMesh1.MeshId = 136796198
  229. CharacterMesh1.OverlayTextureId = 136795997
  230. CharacterMesh2.Name = "Silver Robot Right Leg"
  231. CharacterMesh2.Parent = Model0
  232. CharacterMesh2.BodyPart = Enum.BodyPart.RightLeg
  233. CharacterMesh2.MeshId = 136796184
  234. CharacterMesh2.OverlayTextureId = 136795997
  235. CharacterMesh3.Name = "Silver Robot Left Leg"
  236. CharacterMesh3.Parent = Model0
  237. CharacterMesh3.BodyPart = Enum.BodyPart.LeftLeg
  238. CharacterMesh3.MeshId = 136796146
  239. CharacterMesh3.OverlayTextureId = 136795997
  240. CharacterMesh4.Name = "Silver Robot Right Arm"
  241. CharacterMesh4.Parent = Model0
  242. CharacterMesh4.BodyPart = Enum.BodyPart.RightArm
  243. CharacterMesh4.MeshId = 136796166
  244. CharacterMesh4.OverlayTextureId = 136795997
  245. CharacterMesh5.Name = "Silver Robot Left Arm"
  246. CharacterMesh5.Parent = Model0
  247. CharacterMesh5.BodyPart = Enum.BodyPart.LeftArm
  248. CharacterMesh5.MeshId = 136796079
  249. CharacterMesh5.OverlayTextureId = 136795997
  250. BodyColors6.Parent = Model0
  251. BodyColors6.HeadColor = BrickColor.new("Lilac")
  252. BodyColors6.HeadColor3 = Color3.new(0.654902, 0.368627, 0.607843)
  253. BodyColors6.LeftArmColor = BrickColor.new("Lilac")
  254. BodyColors6.LeftArmColor3 = Color3.new(0.654902, 0.368627, 0.607843)
  255. BodyColors6.LeftLegColor = BrickColor.new("Lilac")
  256. BodyColors6.LeftLegColor3 = Color3.new(0.654902, 0.368627, 0.607843)
  257. BodyColors6.RightArmColor = BrickColor.new("Lilac")
  258. BodyColors6.RightArmColor3 = Color3.new(0.654902, 0.368627, 0.607843)
  259. BodyColors6.RightLegColor = BrickColor.new("Lilac")
  260. BodyColors6.RightLegColor3 = Color3.new(0.654902, 0.368627, 0.607843)
  261. BodyColors6.TorsoColor = BrickColor.new("Lilac")
  262. BodyColors6.TorsoColor3 = Color3.new(0.654902, 0.368627, 0.607843)
  263. Shirt7.Name = "Shirt"
  264. Shirt7.Parent = Model0
  265. Shirt7.ShirtTemplate = "http://www.roblox.com/asset/?id=855776101"
  266. Pants8.Name = "Pants"
  267. Pants8.Parent = Model0
  268. Pants8.PantsTemplate = "http://www.roblox.com/asset/?id=867813066"
  269. Accessory9.Name = "EgyptianMask"
  270. Accessory9.Parent = Model0
  271. Accessory9.AttachmentPoint = CFrame.new(0, 0.600000024, 0.25, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  272. Accessory9.AttachmentPos = Vector3.new(0, 0.600000024, 0.25)
  273. Part10.Name = "Handle"
  274. Part10.Parent = Accessory9
  275. Part10.CFrame = CFrame.new(63.4999886, 9.5950222, 128.450256, 1, -7.87137555e-09, 0, 7.87137555e-09, 1, 4.1444221e-16, -3.26223034e-24, -4.1444221e-16, 1)
  276. Part10.Position = Vector3.new(63.4999886, 9.5950222, 128.450256)
  277. Part10.Size = Vector3.new(1.52002668, 1.58999789, 1.80000269)
  278. Part10.BottomSurface = Enum.SurfaceType.Smooth
  279. Part10.CanCollide = false
  280. Part10.Locked = true
  281. Part10.TopSurface = Enum.SurfaceType.Smooth
  282. Part10.FormFactor = Enum.FormFactor.Custom
  283. Part10.formFactor = Enum.FormFactor.Custom
  284. SpecialMesh11.Parent = Part10
  285. SpecialMesh11.MeshId = "http://www.roblox.com/asset/?id=177442491 "
  286. SpecialMesh11.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
  287. SpecialMesh11.TextureId = "http://www.roblox.com/asset/?id=177442555 "
  288. SpecialMesh11.MeshType = Enum.MeshType.FileMesh
  289. Vector3Value12.Name = "OriginalSize"
  290. Vector3Value12.Parent = Part10
  291. Vector3Value12.Value = Vector3.new(1.52002668, 1.58999789, 1.80000269)
  292. Camera13.Name = "ThumbnailCamera"
  293. Camera13.Parent = Accessory9
  294. Camera13.CFrame = CFrame.new(-1.26414585, 0.574665964, -8.09290791, -0.961262107, 0.0457770824, -0.271807969, 3.72528985e-09, 0.986112595, 0.16607812, 0.275635809, 0.159644604, -0.947912753)
  295. Camera13.CoordinateFrame = CFrame.new(-1.26414585, 0.574665964, -8.09290791, -0.961262107, 0.0457770824, -0.271807969, 3.72528985e-09, 0.986112595, 0.16607812, 0.275635809, 0.159644604, -0.947912753)
  296. Camera13.Focus = CFrame.new(-0.339998245, 0.0100000501, -4.87000275, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  297. Camera13.focus = CFrame.new(-0.339998245, 0.0100000501, -4.87000275, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  298. SpecialMesh0 = Instance.new("SpecialMesh")
  299. Decal1 = Instance.new("Decal")
  300. SpecialMesh0.Parent = char.Head
  301. SpecialMesh0.Scale = Vector3.new(1.25, 1.25, 1.25)
  302. Decal1.Name = "face"
  303. Decal1.Parent = char.Head
  304. Decal1.Texture = "rbxasset://textures/face.png"
  305. char.Torso.CFrame = p
Add Comment
Please, Sign In to add comment