-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathTest.lua
43 lines (34 loc) · 1.15 KB
/
Test.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
local Utility = sharedRequire('@utils/Utility.lua');
local createBaseESP = sharedRequire('@utils/createBaseESP.lua');
local library = sharedRequire('@UILibrary.lua');
local partsESP = createBaseESP('npcs');
local c = 0;
local function onPartAdded(obj)
local esp;
local code = [[
local obj = ...;
local FindFirstChildWhichIsA = game.FindFirstChildWhichIsA;
return setmetatable({}, {
__index = function(_, p)
if (p == 'Position') then
return obj.Position
end;
end,
});
]]
esp = partsESP.new({code = code, vars = {obj}}, obj.Name .. tostring(math.random()) .. ' DA OP', nil, true);
local con;
con = obj:GetPropertyChangedSignal('Parent'):Connect(function()
if (obj.Parent) then return end;
print('destroyed');
con:Disconnect();
esp:Destroy();
end);
end
function Utility:renderOverload(data)
data.column1:AddSection('Parts ESP'):AddToggle({
text = 'Enable',
flag = 'Npcs'
})
end;
Utility.listenToChildAdded(workspace.Parts, onPartAdded);