-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathAimbot.lua
More file actions
269 lines (217 loc) · 8.84 KB
/
Aimbot.lua
File metadata and controls
269 lines (217 loc) · 8.84 KB
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
local Maid = sharedRequire('../../utils/Maid.lua');
local Services = sharedRequire('../../utils/Services.lua');
local library = sharedRequire('../../UILibrary.lua');
local Utility = sharedRequire('../../utils/Utility.lua');
local RunService, UserInputService = Services:Get('RunService', 'UserInputService');
local UserService = game:GetService('UserService');
local maid = Maid.new();
local Circle = Drawing.new('Circle');
local targetLine = Drawing.new('Line');
Circle.Transparency = 1;
Circle.Visible = false;
Circle.Color = Color3.fromRGB(255, 255, 255);
Circle.Radius = 100;
Circle.Thickness = 1;
targetLine = Drawing.new('Line');
targetLine.Visible = true;
targetLine.Transparency = 1;
targetLine.Thickness = 1;
targetLine.Color = Color3.fromRGB(255, 255, 255);
local function Aimbot(ended)
if (ended) then
maid.aimbot = nil;
return;
end;
maid.aimbot = RunService.RenderStepped:Connect(function()
if(not library) then
maid.aimbot = nil;
return;
end;
local Character = Utility:getClosestCharacter()
Character = Character and Character.Character;
if(not Character) then return end;
local head = Character:FindFirstChild('Head');
local hitPos = head and head.CFrame.Position;
local Camera = workspace.CurrentCamera;
if(not Camera) then return end;
local aimPart = library.flags.aimPart;
if(aimPart == 'Torso') then
hitPos = hitPos - Vector3.new(0, 1.5, 0);
elseif(aimPart == 'Leg') then
hitPos = hitPos - Vector3.new(0, 3, 0);
end;
local hitPosition2D, visible = Camera:WorldToViewportPoint(hitPos);
if (not visible) then return end;
hitPosition2D = Vector2.new(hitPosition2D.X, hitPosition2D.Y);
local mousePosition = UserInputService:GetMouseLocation();
local final = (hitPosition2D - mousePosition) / (_G.test or 10);
mousemoverel(final.X, final.Y);
end);
end;
local function updateCircleProp(property)
return function(value)
if (property == "NumSides" and value == 50) then
value = 500;
elseif (property == "Filled" and library.flags.circleTransparency == 1) then
library.flags.circleTransparency = 0.9;
Circle.Transparency = 0.9;
end
Circle[property] = value;
end;
end;
local function toggleRainbowCircle(toggle)
if(not toggle) then
maid.toggleRainbowCircle = nil;
return;
end;
local circleColor = library.options.circleColor;
maid.toggleRainbowCircle = RunService.RenderStepped:Connect(function()
circleColor:SetColor(library.chromaColor);
end);
end;
local function showCircle(toggle)
Circle.Visible = toggle;
if(not toggle) then
maid.updateCirclePosition = nil;
return;
end;
maid.updateCirclePosition = RunService.Heartbeat:Connect(function()
-- if(library.flags.unlockCircle) then
if(Circle) then
Circle.Position = UserInputService:GetMouseLocation()
end;
-- else
-- local camera = workspace.CurrentCamera;
-- if(not camera) then return end;
-- local cameraViewPortSize = camera.ViewportSize;
-- local x = cameraViewPortSize.X / 2;
-- local y = cameraViewPortSize.Y / 2;
-- Circle.Position = Vector2.new(x, y);
-- end;
end);
end;
local Window = library:AddTab('Aimbot');
local section1 = Window:AddColumn();
local section2 = Window:AddColumn();
local aimbotSettings = section1:AddSection('Aimbot Settings');
local circleSettings = section2:AddSection('Circle Settings');
local aimbotWhitelist = section1:AddSection('Aimbot Whitelist');
do -- Render gui
do -- // Circle Settings
circleSettings:AddToggle({
text = 'Show Circle',
callback = showCircle
}):AddColor({
color = Color3.fromRGB(255, 0, 0),
trans = 1,
flag = 'Circle Color',
calltrans = updateCircleProp('Transparency'),
callback = updateCircleProp('Color')
})
circleSettings:AddToggle({
text = 'Rainbow Circle',
callback = toggleRainbowCircle
})
circleSettings:AddToggle({
text = 'Fill Circle',
callback = updateCircleProp('Filled')
})
circleSettings:AddSlider({
text = 'Circle Shape',
value = 50,
min = 4,
max = 50,
float = 2,
callback = updateCircleProp('NumSides')
})
circleSettings:AddSlider({
text = 'Circle Thickness',
value = 1,
max = 50,
callback = updateCircleProp('Thickness')
});
end;
do -- // Aimbot Settings
aimbotSettings:AddBind({
text = 'Enable',
flag = 'Toggle Aimbot',
mode = 'hold',
callback = Aimbot
})
aimbotSettings:AddSlider({
text = 'Field Of View',
flag = 'Aimbot F O V',
min = 0,
value = 100,
max = 800,
callback = updateCircleProp('Radius')
})
aimbotSettings:AddList({
text = 'Aim Part',
values = {'Head', 'Torso', 'Leg'}
})
aimbotSettings:AddToggle({
text = 'Use Field Of View',
flag = 'use F O V'
})
aimbotSettings:AddToggle({
text = 'Visibility Check',
})
aimbotSettings:AddToggle({
text = 'Check Team',
state = true
})
end;
do -- // Aimbot Whitelist
local usersInfosByName = {};
local function addPlayer(userId, isTextBox)
if (not isTextBox) then
userId = library.flags.aimbotWhitelistPlayers;
userId = userId and userId.UserId;
end;
if (not userId) then return print('no user id', userId, isTextBox); end;
local suc, userInfos = pcall(function()
return UserService:GetUserInfosByUserIdsAsync({userId});
end);
if (not suc) then
return warn(userInfos);
end;
local userInfo = userInfos[1];
if (not userInfo) then return end;
library.options.aimbotWhitelistedPlayers:AddValue(userInfo.Username);
local aimbotWhitelistedPlayers = library.configVars.aimbotWhitelistedPlayers;
if (not aimbotWhitelistedPlayers) then
aimbotWhitelistedPlayers = {};
library.configVars.aimbotWhitelistedPlayers = aimbotWhitelistedPlayers;
end;
if (not table.find(aimbotWhitelistedPlayers, userInfo.Id)) then
table.insert(aimbotWhitelistedPlayers, userInfo.Id);
usersInfosByName[userInfo.Username] = userInfo;
end;
end;
local function removePlayer()
local userInfo = usersInfosByName[library.flags.aimbotWhitelistedPlayers];
if (not userInfo) then return end;
library.options.aimbotWhitelistedPlayers:RemoveValue(userInfo.Username);
local whitelistedPlayers = library.configVars.aimbotWhitelistedPlayers;
table.remove(whitelistedPlayers, table.find(whitelistedPlayers, userInfo.Id));
end;
library.OnLoad:Connect(function()
local whitelistedPlayers = library.configVars.aimbotWhitelistedPlayers or {};
local userInfos = UserService:GetUserInfosByUserIdsAsync(whitelistedPlayers);
for _, userInfo in next, userInfos do
library.options.aimbotWhitelistedPlayers:AddValue(userInfo.Username);
usersInfosByName[userInfo.Username] = userInfo;
end;
end);
aimbotWhitelist:AddDivider('Add Player');
aimbotWhitelist:AddList({text = 'Players', flag = 'Aimbot Whitelist Players', playerOnly = true, noSave = true});
aimbotWhitelist:AddButton({text = 'Add Player', callback = addPlayer});
aimbotWhitelist:AddDivider('Remove Player');
aimbotWhitelist:AddList({text = 'Whitelisted Players', flag = 'Aimbot Whitelisted Players'});
aimbotWhitelist:AddButton({text = 'Remove Player', callback = removePlayer});
aimbotWhitelist:AddDivider('Advanced Whitelist');
aimbotWhitelist:AddBox({text = 'Player UserId', flag = 'Aimbot Whitelist Player Box'});
aimbotWhitelist:AddButton({text = 'Add Player By User Id', callback = function() addPlayer(tonumber(library.flags.aimbotWhitelistPlayerBox), true) end});
end;
end;