SHOW:
|
|
- or go back to the newest paste.
1 | ||
2 | - | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end |
2 | + | |
3 | - | local Player,game,owner = owner,game |
3 | + | |
4 | - | local RealPlayer = Player |
4 | + | |
5 | - | do |
5 | + | |
6 | - | print("FE Compatibility code V2 by Mokiros") |
6 | + | |
7 | - | local RealPlayer = RealPlayer |
7 | + | |
8 | - | script.Parent = RealPlayer.Character |
8 | + | |
9 | - | |
9 | + | |
10 | - | --Fake event to make stuff like Mouse.KeyDown work |
10 | + | |
11 | - | local Disconnect_Function = function(this) |
11 | + | |
12 | - | this[1].Functions[this[2]] = nil |
12 | + | |
13 | - | end |
13 | + | |
14 | - | local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}} |
14 | + | |
15 | - | local FakeEvent_Metatable = {__index={ |
15 | + | |
16 | - | Connect = function(this,f) |
16 | + | |
17 | - | local i = tostring(math.random(0,10000)) |
17 | + | |
18 | - | while this.Functions[i] do |
18 | + | |
19 | - | i = tostring(math.random(0,10000)) |
19 | + | |
20 | - | end |
20 | + | |
21 | - | this.Functions[i] = f |
21 | + | |
22 | - | return setmetatable({this,i},Disconnect_Metatable) |
22 | + | |
23 | - | end |
23 | + | |
24 | - | }} |
24 | + | |
25 | - | FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect |
25 | + | |
26 | - | local function fakeEvent() |
26 | + | |
27 | - | return setmetatable({Functions={}},FakeEvent_Metatable) |
27 | + | |
28 | - | end |
28 | + | |
29 | - | |
29 | + | |
30 | - | --Creating fake input objects with fake variables |
30 | + | |
31 | - | local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()} |
31 | + | |
32 | - | FakeMouse.keyUp = FakeMouse.KeyUp |
32 | + | |
33 | - | FakeMouse.keyDown = FakeMouse.KeyDown |
33 | + | |
34 | - | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} |
34 | + | |
35 | - | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...) |
35 | + | |
36 | - | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil |
36 | + | |
37 | - | end} |
37 | + | |
38 | - | --Merged 2 functions into one by checking amount of arguments |
38 | + | |
39 | - | CAS.UnbindAction = CAS.BindAction |
39 | + |