-
Notifications
You must be signed in to change notification settings - Fork 0
/
Add UNC compatibility.lua
125 lines (97 loc) · 3.08 KB
/
Add UNC compatibility.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
local Global = getfenv(2)
local FakeCoreGuiEnv = game:FindFirstChildOfClass("CoreGui"):FindFirstChild("CoreScriptLocalization")
local VirtualInputManager = game:FindFirstChildOfClass("VirtualInputManager")
local HttpService = game:GetService("HttpService")
Global.getgenv = Global
loadstring = Global.load_string or loadstring -- A fix for celery (saw someone talk about it)
Global.loadstring = loadstring
local nilinstances = {}
game.DescendantRemoving:Connect(function(Descendant)
nilinstances[#nilinstances+1]=Descendant
end)
game.DescendantAdded:Connect(function(Descendant)
if table.find(nilinstances, Descendant) then
nilinstances[Descendant] = nil
end
end)
Global.getexecutorname = function() -- kade
return "Incognito"
end
Global.isnetworkowner = function(Part) -- kade
return Part.ReceiveAge == 0
end
Global.gethui = function(Part) -- kade
return FakeCoreGuiEnv
end
Global.getinstances = function() -- kade
local x = {}
for i,v in pairs(game:GetDescendants()) do
if v:IsA("Instance") then
x[#x+1]=v
end
end
return x
end
Global.getnilinstances = function() -- kade
return nilinstances
end
Global.getscripts = function()
local x = {}
local returned = {}
local getins, getnilins = getinstances(),getnilinstances()
for i,v in next, getins do
table.insert(x, v)
end
for i,v in next, getnilins do
table.insert(x, v)
end
for i,v in pairs(x) do
if v:IsA("LocalScript") or v:IsA("ModuleScript") or v:IsA("Script") then
returned[#returned+1]=v
end
end
return returned
end
Global.fireclickdetector = function(ClickDetector) -- pio
if typeof(ClickDetector) ~= "ClickDetector" then
return
end
local Parent = ClickDetector.Parent
if (not Parent) or Parent and typeof(Parent) ~= "Part" then
return
end
local CameraCalc = workspace.CurrentCamera:WorldToViewportPoint(ClickDetector.Parent.Position)
VirtualInputManager:SendMouseButtonEvent(res.X, res.Y, 0, true, game, 1)
VirtualInputManager:SendMouseButtonEvent(res.X, res.Y, 0, false, game, 1)
end
Global.request = function(Options) -- kade
local Response, Success = nil, nil
HttpService:RequestInternal(Options):Start(function(Success, Res) -- thanks len1781
task.delay(3, function()
Success = true
end)
Response = Res and Res or true
end)
repeat task.wait() until Response ~= nil
if typeof(Response) == "boolean" then
error("Request() timed out.")
return
end
return Response
end
Global.mouse1down = function() -- jxsh
VirtualInputManager:SendMouseButtonEvent(0, 0, 1, true, game, 1)
end
Global.mouse1up = function() -- jxsh
VirtualInputManager:SendMouseButtonEvent(0, 0, 1, false, game, 1)
end
Global.mouse1click = function() -- jxsh
mouse1down()
mouse1up()
end
Global.keypress = function(key) -- jxsh
VirtualInputManager:SendKeyEvent(true, key, false, game)
end
Global.keyrelease = function(key) -- jxsh
VirtualInputManager:SendKeyEvent(false, key, false, game)
end