SHOW:
|
|
- or go back to the newest paste.
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 |
2 | + | if game:GetService("RunService"):IsClient() then error("Use h/ To work.") end |
3 | local Player,game,owner = owner,game | |
4 | local RealPlayer = Player | |
5 | do | |
6 | - | print("FE Compatibility code V2 by Mokiros") |
6 | + | print("SCP 106 By DenisPitu06_YT") |
7 | print("E To Teleport.") | |
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 | ||
88 | local h,t | |
89 | --Give the server mouse data every second frame, but only if the values changed | |
90 | --If player is not moving their mouse, client won't fire events | |
91 | local HB = game:GetService("RunService").Heartbeat | |
92 | while true do | |
93 | if h~=Mouse.Hit or t~=Mouse.Target then | |
94 | h,t=Mouse.Hit,Mouse.Target | |
95 | Event:FireServer({isMouse=true,Target=t,Hit=h}) | |
96 | end | |
97 | --Wait 2 frames | |
98 | for i=1,2 do | |
99 | HB:Wait() | |
100 | end | |
101 | end]==],script) | |
102 | ||
103 | ----Sandboxed game object that allows the usage of client-side methods and services | |
104 | --Real game object | |
105 | local RealGame = game | |
106 | ||
107 | --Metatable for fake service | |
108 | local FakeService_Metatable = { | |
109 | __index = function(self,k) | |
110 | local s = rawget(self,"_RealService") | |
111 | if s then | |
112 | return typeof(s[k])=="function" | |
113 | and function(_,...)return s[k](s,...)end or s[k] | |
114 | end | |
115 | end, | |
116 | __newindex = function(self,k,v) | |
117 | local s = rawget(self,"_RealService") | |
118 | if s then s[k]=v end | |
119 | end | |
120 | } | |
121 | local function FakeService(t,RealService) | |
122 | t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService | |
123 | return setmetatable(t,FakeService_Metatable) | |
124 | end | |
125 | ||
126 | --Fake game object | |
127 | local FakeGame = { | |
128 | GetService = function(self,s) | |
129 | return rawget(self,s) or RealGame:GetService(s) | |
130 | end, | |
131 | Players = FakeService({ | |
132 | LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player) | |
133 | },"Players"), | |
134 | UserInputService = FakeService(UIS,"UserInputService"), | |
135 | ContextActionService = FakeService(CAS,"ContextActionService"), | |
136 | RunService = FakeService({ | |
137 | _btrs = {}, | |
138 | RenderStepped = RealGame:GetService("RunService").Heartbeat, | |
139 | BindToRenderStep = function(self,name,_,fun) | |
140 | self._btrs[name] = self.Heartbeat:Connect(fun) | |
141 | end, | |
142 | UnbindFromRenderStep = function(self,name) | |
143 | self._btrs[name]:Disconnect() | |
144 | end, | |
145 | },"RunService") | |
146 | } | |
147 | rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer) | |
148 | FakeGame.service = FakeGame.GetService | |
149 | FakeService(FakeGame,game) | |
150 | --Changing owner to fake player object to support owner:GetMouse() | |
151 | game,owner = FakeGame,FakeGame.Players.LocalPlayer | |
152 | end | |
153 | --SCP-457 Remake script by basstracker1970 | |
154 | plr = game.Players.LocalPlayer | |
155 | wait(1) | |
156 | for i,v in next, game.Players.LocalPlayer.Character:GetChildren() do | |
157 | if v:IsA("Accessory") then | |
158 | v:Remove() | |
159 | end | |
160 | end | |
161 | - | plr.Character.Head.face:Remove() |
161 | + | |
162 | - | sound = Instance.new("Sound",plr.Character) |
162 | + | mouse = plr:GetMouse() |
163 | - | sound.SoundId = "rbxassetid://886077843" |
163 | + | local sound = Instance.new("Sound", plr.Character) |
164 | sound.SoundId = "rbxassetid://1747972604" | |
165 | sound:Play() | |
166 | - | plr.Character.Head.Transparency = 1 |
166 | + | plr.Character.Head.BrickColor = BrickColor.new("Really black") |
167 | - | plr.Character.Torso.Transparency = 1 |
167 | + | plr.Character.Torso.BrickColor = BrickColor.new("Really black") |
168 | - | plr.Character["Right Arm"].Transparency = 1 |
168 | + | plr.Character["Right Arm"].BrickColor = BrickColor.new("Really black") |
169 | - | plr.Character["Left Arm"].Transparency = 1 |
169 | + | plr.Character["Left Arm"].BrickColor = BrickColor.new("Really black") |
170 | - | plr.Character["Right Leg"].Transparency = 1 |
170 | + | plr.Character["Right Leg"].BrickColor = BrickColor.new("Really black") |
171 | - | plr.Character["Left Leg"].Transparency = 1 |
171 | + | plr.Character["Left Leg"].BrickColor = BrickColor.new("Really black") |
172 | - | fire = Instance.new("Fire",plr.Character.Torso) |
172 | + | plr.Character.Head.face:Destroy() |
173 | plr.Character.Humanoid.WalkSpeed = 8 | |
174 | - | plr.Character.Torso.Fire:Clone().Parent = hit.Parent.Torso |
174 | + | plr.Character.Humanoid.JumpPower = 0 |
175 | - | sound = Instance.new("Sound",hit.Parent) |
175 | + | |
176 | - | sound.SoundId = "rbxassetid://147758618" |
176 | + | hit.Parent.Humanoid.WalkSpeed = 0 |
177 | local sound = Instance.new("Sound", hit.Parent) | |
178 | - | wait(14) |
178 | + | sound.SoundId = "rbxassetid://1135476193" |
179 | - | hit.Parent:BreakJoints() |
179 | + | sound:Play() |
180 | wait(3) | |
181 | hit.Parent:BreakJoints() | |
182 | end) | |
183 | function Teleport() | |
184 | local sound2 = Instance.new("Sound", plr.Character) | |
185 | sound2.SoundId = "rbxassetid://1135476193" | |
186 | sound2:Play() | |
187 | plr.Character.Torso.CFrame = mouse.Hit + Vector3.new(0,3,0) | |
188 | end | |
189 | mouse.KeyDown:connect(function(k) | |
190 | if k == "e" then | |
191 | Teleport() | |
192 | end | |
193 | end) |