ImmortalBlue

Testing FE 7 (Credit to Mokiros)

Jan 25th, 2020
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.96 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do
  6. print("FE Compatibility code V2 by Mokiros")
  7. local RealPlayer = RealPlayer
  8. script.Parent = RealPlayer.Character
  9.  
  10. --Fake event to make stuff like Mouse.KeyDown work
  11. local Disconnect_Function = function(this)
  12. this[1].Functions[this[2]] = nil
  13. end
  14. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  15. local FakeEvent_Metatable = {__index={
  16. Connect = function(this,f)
  17. local i = tostring(math.random(0,10000))
  18. while this.Functions[i] do
  19. i = tostring(math.random(0,10000))
  20. end
  21. this.Functions[i] = f
  22. return setmetatable({this,i},Disconnect_Metatable)
  23. end
  24. }}
  25. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  26. local function fakeEvent()
  27. return setmetatable({Functions={}},FakeEvent_Metatable)
  28. end
  29.  
  30. --Creating fake input objects with fake variables
  31. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  32. FakeMouse.keyUp = FakeMouse.KeyUp
  33. FakeMouse.keyDown = FakeMouse.KeyDown
  34. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  35. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  36. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  37. end}
  38. --Merged 2 functions into one by checking amount of arguments
  39. CAS.UnbindAction = CAS.BindAction
  40.  
  41. --This function will trigger the events that have been :Connect()'ed
  42. local function TriggerEvent(self,ev,...)
  43. for _,f in pairs(self[ev].Functions) do
  44. f(...)
  45. end
  46. end
  47. FakeMouse.TriggerEvent = TriggerEvent
  48. UIS.TriggerEvent = TriggerEvent
  49.  
  50. --Client communication
  51. local Event = Instance.new("RemoteEvent")
  52. Event.Name = "UserInput_Event"
  53. Event.OnServerEvent:Connect(function(plr,io)
  54. if plr~=RealPlayer then return end
  55. FakeMouse.Target = io.Target
  56. FakeMouse.Hit = io.Hit
  57. if not io.isMouse then
  58. local b = io.UserInputState == Enum.UserInputState.Begin
  59. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  60. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  61. end
  62. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  63. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  64. end
  65. for _,t in pairs(CAS.Actions) do
  66. for _,k in pairs(t.Keys) do
  67. if k==io.KeyCode then
  68. t.Function(t.Name,io.UserInputState,io)
  69. end
  70. end
  71. end
  72. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  73. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  74. end
  75. end)
  76. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  77. local Mouse = owner:GetMouse()
  78. local UIS = game:GetService("UserInputService")
  79. local input = function(io,RobloxHandled)
  80. if RobloxHandled then return end
  81. --Since InputObject is a client-side instance, we create and pass table instead
  82. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  83. end
  84. UIS.InputBegan:Connect(input)
  85. UIS.InputEnded:Connect(input)
  86.  
  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. --SCP-035 [OBJECT CLASS: KETER]
  153.  
  154. ply = game.Players.LocalPlayer
  155. mouse = ply:GetMouse()
  156. char = ply.Character
  157. cam = game.Workspace.CurrentCamera
  158. minicooldown = 0
  159.  
  160. repeat wait() until ply and char and cam and mouse
  161. state = nil
  162. function create()
  163. tool = Instance.new("Tool", workspace)
  164. tool.Name = "SCP-035"
  165. tool.GripPos = Vector3.new(0, 0, .2)
  166. tool.CanBeDropped = false
  167. handle = Instance.new("Part", tool)
  168. handle.Name = "Handle"
  169. handle.Size = Vector3.new(.5, .5, .5)
  170. handle.CanCollide = true
  171. handle.Anchored = false
  172. handle.CFrame = char.Torso.CFrame
  173. specmesh = Instance.new("SpecialMesh", handle)
  174. specmesh.MeshId = "rbxassetid://13520257"
  175. specmesh.TextureId = "rbxassetid://149756906"
  176. bgui = Instance.new("BillboardGui", handle)
  177. bgui.Active = false
  178. bgui.AlwaysOnTop = true
  179. bgui.Enabled = true
  180. bgui.MaxDistance = 100
  181. bgui.Size = UDim2.new(0.5, 0, 0.5, 0)
  182. bgui.SizeOffset = Vector2.new(-20, 5)
  183. bgui.Name = "FrameHolder"
  184. bgui.Adornee = handle
  185. frame = Instance.new("Frame", bgui)
  186. frame.Active = false
  187. frame.BackgroundTransparency = 1
  188. frame.Size = UDim2.new(42, 0, 4, 0)
  189. frame.Name = "Frame"
  190. text = Instance.new("TextLabel", frame)
  191. text.Active = false
  192. text.BackgroundTransparency = 1
  193. text.Size = UDim2.new(1, 0, 1, 0)
  194. text.Visible = true
  195. text.Font = "Antique"
  196. text.TextScaled = true
  197. text.TextSize = 14
  198. text.TextColor3 = Color3.new(255/255, 0/255, 0/255)
  199. text.TextTransparency = 0.5
  200. text.Text = ""
  201.  
  202. cam.CameraSubject = handle
  203. cam.CameraType = "Custom"
  204. char.Parent = nil
  205.  
  206. end
  207.  
  208. create()
  209.  
  210.  
  211. tool.Handle.Touched:connect(function(hit)
  212. print(hit.Parent)
  213. end)
  214.  
  215. store = {}
  216.  
  217. function lerp(a, b, t)
  218. return a:lerp(b, t)
  219. end
  220.  
  221. mouse.KeyDown:connect(function(key)
  222. if key == "f" and tool.Parent:FindFirstChild("Humanoid") then
  223. dir = tool.Parent
  224. if dir.Torso["Right Shoulder"] and state ~= "Possessing" then
  225. minicooldown = 1
  226. state = "Possessing"
  227. handle.Transparency = 1
  228. mask = Instance.new("Part", dir)
  229. mask.Anchored = false
  230. mask.CanCollide = false
  231. mask.Size = Vector3.new(.5, .5, .5)
  232. local mesh = Instance.new("SpecialMesh", mask)
  233. mesh.MeshId = "rbxassetid://13520257"
  234. mesh.TextureId = "rbxassetid://149756906"
  235. local weldpart = Instance.new("Weld", mask)
  236. weldpart.Part0 = mask
  237. weldpart.Part1 = dir["Right Arm"]
  238. weldpart.C0 = CFrame.new(0, .48, 0) *CFrame.Angles(0, math.rad(25), 0)
  239. weld = Instance.new("Weld", dir.Torso)
  240. weld.Part0 = dir.Torso["Right Shoulder"].Part0
  241. weld.Part1 = dir.Torso["Right Shoulder"].Part1
  242. weld.Name = dir.Torso["Right Shoulder"].Name
  243. weld.C0 = dir.Torso["Right Shoulder"].C0
  244. weld.C1 = dir.Torso["Right Shoulder"].C1
  245. table.insert(store, dir.Torso["Right Shoulder"])
  246. dir.Torso["Right Shoulder"]:Remove()
  247. print(dir.Torso["Right Shoulder"].C0)
  248. for i = 0, 1, .1 do
  249. wait()
  250. weld.C0 = lerp(weld.C0, CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0) *CFrame.Angles(math.rad(-10), math.rad(85), math.rad(-195)), i)
  251. end
  252. mask2 = Instance.new("Part", dir)
  253. mask2.Anchored = false
  254. mask2.CanCollide = false
  255. mask2.Size = Vector3.new(.5, .5, .5)
  256. local mesh = Instance.new("SpecialMesh", mask2)
  257. mesh.MeshId = "rbxassetid://13520257"
  258. mesh.TextureId = "rbxassetid://149756906"
  259. local weldparts = Instance.new("Weld", mask2)
  260. weldparts.Part0 = mask2
  261. weldparts.Part1 = dir["Head"]
  262. weldparts.C0 = CFrame.new(0, 0, 0.54)
  263. mask.Transparency = 1
  264. for i = 0, 1, .1 do
  265. wait()
  266. weld.C0 = lerp(weld.C0, store[1].C0, .1)
  267. end
  268. mask:Remove()
  269. store[1].Parent = weld.Parent
  270. weld:Remove()
  271. store = {}
  272. bgui2 = Instance.new("BillboardGui", mask2)
  273. bgui2.Active = false
  274. bgui2.AlwaysOnTop = true
  275. bgui2.Enabled = true
  276. bgui2.MaxDistance = 100
  277. bgui2.Size = UDim2.new(0.5, 0, 0.5, 0)
  278. bgui2.SizeOffset = Vector2.new(-20, 5)
  279. bgui2.Name = "FrameHolder"
  280. bgui2.Adornee = dir.Head
  281. frame2 = Instance.new("Frame", bgui2)
  282. frame2.Active = false
  283. frame2.BackgroundTransparency = 1
  284. frame2.Size = UDim2.new(42, 0, 4, 0)
  285. frame2.Name = "Frame"
  286. text2 = Instance.new("TextLabel", frame2)
  287. text2.Active = false
  288. text2.BackgroundTransparency = 1
  289. text2.Size = UDim2.new(1, 0, 1, 0)
  290. text2.Visible = true
  291. text2.Font = "Antique"
  292. text2.TextScaled = true
  293. text2.TextSize = 14
  294. text2.TextColor3 = Color3.new(255/255, 0/255, 0/255)
  295. text2.TextTransparency = 0.5
  296. text2.Text = ""
  297. tool.Parent = nil
  298. cam.CameraSubject = dir.Humanoid
  299. dir.Humanoid.MaxHealth = math.huge
  300. char.Parent = workspace
  301. for i, v in pairs(char:GetChildren()) do
  302. if v:IsA("Part") or v:IsA("MeshPart") then
  303. v.Transparency = 1
  304. end
  305. end
  306.  
  307. dir.Humanoid.WalkSpeed = 0
  308. dir.Humanoid.JumpPower = 0
  309. dir.Humanoid.PlatformStand = true
  310. weld1 = Instance.new("Weld", char.Torso)
  311. weld1.Part0 = char.Torso
  312. weld1.Part1 = dir.Torso
  313. weld1.C0 = CFrame.new(0, 0, 0)
  314. weld2 = Instance.new("Weld", char.Torso)
  315. weld2.Part0 = char["Right Arm"]
  316. weld2.Part1 = dir["Right Arm"]
  317. weld2.C0 = CFrame.new(0, 0, 0)
  318. weld3 = Instance.new("Weld", char.Torso)
  319. weld3.Part0 = char["Left Arm"]
  320. weld3.Part1 = dir["Left Arm"]
  321. weld3.C0 = CFrame.new(0, 0, 0)
  322. weld4 = Instance.new("Weld", char.Torso)
  323. weld4.Part0 = char["Left Leg"]
  324. weld4.Part1 = dir["Left Leg"]
  325. weld4.C0 = CFrame.new(0, 0, 0)
  326. weld5 = Instance.new("Weld", char.Torso)
  327. weld5.Part0 = char["Right Leg"]
  328. weld5.Part1 = dir["Right Leg"]
  329. weld5.C0 = CFrame.new(0, 0, 0)
  330. weld5 = Instance.new("Weld", char.Torso)
  331. weld5.Part0 = char.Head
  332. weld5.Part1 = dir.Head
  333. weld5.C0 = CFrame.new(0, 0, 0)
  334. if dir:FindFirstChild("HumanoidRootPart") ~= nil then
  335. weld6 = Instance.new("Weld", char.Torso)
  336. weld6.Part0 = char.HumanoidRootPart
  337. weld6.Part1 = dir.HumanoidRootPart
  338. weld6.C0 = CFrame.new(0, 0, 0)
  339. end
  340. for i, v in pairs(dir:GetChildren()) do
  341. if v:IsA("Part") or v:IsA("MeshPart") then
  342. v.CanCollide = false
  343. end
  344. end
  345. char.Humanoid.MaxHealth = math.huge
  346. minicooldown = 2
  347. end
  348. elseif key == "g" and state == "Possessing" and minicooldown == 2 then
  349. state = nil
  350. weld1:Remove()
  351. weld2:Remove()
  352. weld3:Remove()
  353. weld4:Remove()
  354. weld5:Remove()
  355. if weld6 ~= nil then
  356. weld6:Remove()
  357. end
  358. tool.Parent = workspace
  359. tool.Handle.CanCollide = true
  360. tool.Handle.Transparency = 0
  361. tool.Handle.CFrame = char.Torso.CFrame *CFrame.new(0, 0, -3)
  362. cam.CameraSubject = tool.Handle
  363. local pos = char.Torso.CFrame
  364. char.Parent = nil
  365. minicooldown = 0
  366. for i, v in pairs(dir:GetChildren()) do
  367. if v:IsA("Part") or v:IsA("MeshPart") then
  368. v.BrickColor = BrickColor.new("Really black")
  369. end
  370. end
  371. dir:BreakJoints()
  372. local blackblood = Instance.new("Part", dir)
  373. blackblood.Anchored = true
  374. blackblood.BrickColor = BrickColor.new("Really black")
  375. blackblood.Size = Vector3.new(0.05, 1, 1)
  376. blackblood.Shape = "Cylinder"
  377. blackblood.CanCollide = false
  378. blackblood.CFrame = CFrame.new(pos.X, pos.Y-2.95, pos.Z)
  379. blackblood.Orientation = Vector3.new(0, 90, 90)
  380. for i = 1, 100 do
  381. wait()
  382. blackblood.Orientation = Vector3.new(0, 90, 90)
  383. blackblood.Size = blackblood.Size +Vector3.new(0, .1, .1)
  384. end
  385. end
  386. end)
  387.  
  388.  
  389. ply.Chatted:connect(function(msg)
  390. if msg and state ~= "Possessing" then
  391. for i = 1, string.len(msg) do
  392. wait()
  393. text.Text = string.sub(msg, 1, i)
  394. end
  395. wait(2)
  396. text.Text = ""
  397. elseif msg and state == "Possessing" then
  398. for i = 1, string.len(msg) do
  399. wait()
  400. text2.Text = string.sub(msg, 1, i)
  401. end
  402. wait(2)
  403. text2.Text = ""
  404. end
  405. end)
  406.  
  407. game:GetService("RunService").RenderStepped:connect(function()
  408. end)
  409.  
  410. game.Players.PlayerRemoving:connect(function(playr)
  411. if playr.Name == "w3w123ALT" then
  412. tool:Remove()
  413. end
  414. end)
Add Comment
Please, Sign In to add comment