· 6 years ago · Mar 03, 2020, 05:00 PM
1-- Made by Pyseph#0001
2
3-- Important shit
4local toProtect = {};
5local toHook = {game.FindFirstChild, game.FindFirstChildWhichIsA};
6
7local oldFfc;
8local oldFfcwia;
9
10for i,v in next, toHook do
11 local Old;
12 Old = hookfunction(v, newcclosure(function(self, ...)
13 local Args = {...};
14 local w,e = pcall(function()
15 local Result = Old(self, unpack(Args));
16 if toProtect[Result] then return 'Found'; end;
17 end);
18 if w and e == 'Found' then
19 return;
20 else
21 return Old(self, ...);
22 end;
23 end));
24end;
25
26local function protect_instance(Object)
27 toProtect[Object] = true;
28 Object.DescendantAdded:Connect(function(obj)
29 toProtect[obj] = true;
30 end);
31end;
32
33
34-- Yes, I used GUI to Lua, deal with it :smile:
35local SentinelESP = Instance.new("ScreenGui")
36protect_instance(SentinelESP);
37local Main = Instance.new("ImageLabel")
38local Top = Instance.new("ImageLabel")
39local Title = Instance.new("TextLabel")
40local Holder = Instance.new("Frame")
41local UIListLayout = Instance.new("UIListLayout")
42
43-- Main Types
44local Toggle = Instance.new("ImageLabel")
45local Toggle_2 = Instance.new("ImageLabel")
46local toggleName = Instance.new("TextLabel")
47local Hitbox = Instance.new("Frame")
48
49local Keybind = Instance.new("TextLabel")
50local keybindBox = Instance.new("TextLabel")
51local Keybind_Roundify_5px = Instance.new("ImageLabel")
52
53local Slider = Instance.new("ImageLabel")
54local sliderLine = Instance.new("ImageLabel")
55local sliderButton = Instance.new("ImageLabel")
56local sliderValue = Instance.new("TextLabel")
57local sliderName = Instance.new("TextLabel")
58
59SentinelESP.Name = "SentinelESP"
60SentinelESP.Parent = game:GetService'CoreGui'
61
62Main.Name = "Main"
63Main.Parent = SentinelESP
64Main.Active = true
65Main.AnchorPoint = Vector2.new(0, 0.5)
66Main.BackgroundColor3 = Color3.new(1, 1, 1)
67Main.BackgroundTransparency = 1
68Main.Position = UDim2.new(0, 15, 0.5, 0)
69Main.Size = UDim2.new(0, 180, 0, 300)
70Main.Image = "rbxassetid://3570695787"
71Main.ImageColor3 = Color3.new(0.12549, 0.12549, 0.12549)
72Main.ScaleType = Enum.ScaleType.Slice
73Main.SliceCenter = Rect.new(100, 100, 100, 100)
74Main.SliceScale = 0.08;
75
76Top.Name = "Top"
77Top.Parent = Main
78Top.BackgroundColor3 = Color3.new(0.0941176, 0.0941176, 0.0941176)
79Top.BackgroundTransparency = 1
80Top.Size = UDim2.new(1, 0, 0, 20)
81Top.Image = "rbxassetid://3570695787"
82Top.ImageColor3 = Color3.new(0.0941176, 0.0941176, 0.0941176)
83Top.ScaleType = Enum.ScaleType.Slice
84Top.SliceCenter = Rect.new(100, 100, 100, 100)
85Top.SliceScale = 0.08;
86
87local pMouse = game:GetService'Players'.LocalPlayer:GetMouse();
88Top.InputBegan:Connect(function(input)
89 if input.UserInputType == Enum.UserInputType.MouseButton1 then
90 local Start = Vector2.new(pMouse.X, pMouse.Y) - Vector2.new(Main.AbsolutePosition.X, Main.AbsolutePosition.Y);
91 while game:GetService'RunService'.RenderStepped:Wait() and game:GetService'UserInputService':IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do
92 Main.Position = UDim2.new(0, pMouse.X - Start.X, 0, pMouse.Y - (Start.Y - (Main.AbsoluteSize.Y / 2)));
93 end;
94 end;
95end);
96
97local Logo = Instance.new'ImageLabel';
98Logo.Parent = Top;
99Logo.Size = UDim2.new(0, 20, 0, 20);
100Logo.BackgroundTransparency = 1;
101Logo.Image = 'http://www.roblox.com/asset/?id=4625223690';
102
103Title.Name = "Title"
104Title.Parent = Top
105Title.BackgroundColor3 = Color3.new(1, 1, 1)
106Title.BackgroundTransparency = 1
107Title.Size = UDim2.new(1, 0, 0, 20)
108Title.Font = Enum.Font.SourceSans
109Title.Text = "Sentinel ESP - F4 to close"
110Title.TextColor3 = Color3.new(1, 1, 1)
111Title.TextSize = 14
112
113Holder.Name = "Holder"
114Holder.Parent = Main
115Holder.BackgroundColor3 = Color3.new(1, 1, 1)
116Holder.BackgroundTransparency = 1
117Holder.Position = UDim2.new(0, 15, 0, 30)
118Holder.Size = UDim2.new(0, 158, 0, 274)
119
120UIListLayout.Parent = Holder
121UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
122UIListLayout.Padding = UDim.new(0, 5)
123
124Toggle.Name = "Toggle"
125Toggle.BackgroundColor3 = Color3.new(1, 1, 1)
126Toggle.BackgroundTransparency = 1
127Toggle.Size = UDim2.new(0, 14, 0, 14);
128Toggle.Image = "rbxassetid://3570695787"
129Toggle.ImageColor3 = Color3.new(0.0941176, 0.0941176, 0.0941176)
130Toggle.ScaleType = Enum.ScaleType.Slice
131Toggle.SliceCenter = Rect.new(100, 100, 100, 100)
132Toggle.SliceScale = 0.05;
133
134Toggle_2.Name = "Toggle"
135Toggle_2.Parent = Toggle
136Toggle_2.BackgroundColor3 = Color3.new(1, 0.235294, 0.247059)
137Toggle_2.BackgroundTransparency = 1
138Toggle_2.Position = UDim2.new(0, 7.5, 0, 7.5)
139Toggle_2.Size = UDim2.new();
140Toggle_2.AnchorPoint = Vector2.new(0.5, 0.5)
141Toggle_2.Image = "rbxassetid://3570695787"
142Toggle_2.ImageColor3 = Color3.new(0.878431, 0.137255, 0.266667)
143Toggle_2.ScaleType = Enum.ScaleType.Slice
144Toggle_2.SliceCenter = Rect.new(100, 100, 100, 100)
145Toggle_2.SliceScale = 0.05;
146
147toggleName.Name = "objectName"
148toggleName.Parent = Toggle
149toggleName.BackgroundColor3 = Color3.new(1, 1, 1)
150toggleName.BackgroundTransparency = 1
151toggleName.Position = UDim2.new(1, 4, 0, 0)
152toggleName.Size = UDim2.new(0, 100, 0, 14)
153toggleName.Font = Enum.Font.SourceSans
154toggleName.Text = "Ut utamur officiis mei,"
155toggleName.TextColor3 = Color3.new(1, 1, 1)
156toggleName.TextSize = 14
157toggleName.TextXAlignment = Enum.TextXAlignment.Left
158
159Hitbox.Name = "Hitbox"
160Hitbox.Parent = Toggle
161Hitbox.BackgroundColor3 = Color3.new(1, 1, 1)
162Hitbox.BackgroundTransparency = 1
163Hitbox.Size = UDim2.new(11, 0, 0, 14)
164
165Keybind.Name = "Keybind"
166Keybind.BackgroundColor3 = Color3.new(1, 1, 1)
167Keybind.BackgroundTransparency = 1
168Keybind.BorderColor3 = Color3.new(0.105882, 0.164706, 0.207843)
169Keybind.Size = UDim2.new(1, 0, 0, 20)
170Keybind.Font = Enum.Font.SourceSans
171Keybind.Text = "Mei liber intellegam"
172Keybind.TextColor3 = Color3.new(1, 1, 1)
173Keybind.TextSize = 14
174Keybind.TextXAlignment = Enum.TextXAlignment.Left
175
176keybindBox.Name = "Keybind"
177keybindBox.Parent = Keybind
178keybindBox.BackgroundColor3 = Color3.new(0.0941176, 0.0941176, 0.0941176)
179keybindBox.BackgroundTransparency = 1
180keybindBox.BorderSizePixel = 0
181keybindBox.Position = UDim2.new(1, 0, 0, 0)
182keybindBox.Size = UDim2.new(0, -55, 0, 20)
183keybindBox.ZIndex = 2
184keybindBox.Font = Enum.Font.SourceSansSemibold
185keybindBox.Text = "A"
186keybindBox.TextColor3 = Color3.new(1, 1, 1)
187keybindBox.TextSize = 13
188keybindBox.TextWrapped = true
189
190Keybind_Roundify_5px.Name = "Keybind_Roundify_5px"
191Keybind_Roundify_5px.Parent = keybindBox
192Keybind_Roundify_5px.AnchorPoint = Vector2.new(0.5, 0.5)
193Keybind_Roundify_5px.BackgroundColor3 = Color3.new(1, 1, 1)
194Keybind_Roundify_5px.BackgroundTransparency = 1
195Keybind_Roundify_5px.Position = UDim2.new(0.5, 0, 0.5, 0)
196Keybind_Roundify_5px.Size = UDim2.new(1, 0, 1, 0)
197Keybind_Roundify_5px.Image = "rbxassetid://3570695787"
198Keybind_Roundify_5px.ImageColor3 = Color3.new(0.0941176, 0.0941176, 0.0941176)
199Keybind_Roundify_5px.ScaleType = Enum.ScaleType.Slice
200Keybind_Roundify_5px.SliceCenter = Rect.new(100, 100, 100, 100)
201Keybind_Roundify_5px.SliceScale = 0.05;
202
203Slider.Name = "Slider"
204Slider.BackgroundColor3 = Color3.new(1, 1, 1)
205Slider.BackgroundTransparency = 1
206Slider.Size = UDim2.new(0, 14, 0, 30)
207Slider.ImageColor3 = Color3.new(0.0941176, 0.0941176, 0.0941176)
208Slider.ScaleType = Enum.ScaleType.Slice
209Slider.SliceCenter = Rect.new(100, 100, 100, 100)
210Slider.SliceScale = 0.05;
211
212sliderLine.Name = "sliderLine"
213sliderLine.Parent = Slider
214sliderLine.BackgroundColor3 = Color3.new(1, 1, 1)
215sliderLine.BackgroundTransparency = 1
216sliderLine.Position = UDim2.new(6.85699987, 0, 0, 8)
217sliderLine.Size = UDim2.new(0, 63, 0, 5)
218sliderLine.Image = "rbxassetid://3570695787"
219sliderLine.ImageColor3 = Color3.new(0.0941176, 0.0941176, 0.0941176)
220sliderLine.ScaleType = Enum.ScaleType.Slice
221sliderLine.SliceCenter = Rect.new(100, 100, 100, 100)
222sliderLine.SliceScale = 0.05;
223
224sliderButton.Name = "sliderButton"
225sliderButton.Parent = sliderLine
226sliderButton.AnchorPoint = Vector2.new(0.5, 0.5)
227sliderButton.BackgroundColor3 = Color3.new(1, 1, 1)
228sliderButton.BackgroundTransparency = 1
229sliderButton.Position = UDim2.new(0.5, 0, 0.5, 0)
230sliderButton.Size = UDim2.new(0, 3, 0, 12)
231sliderButton.Image = "rbxassetid://3570695787"
232sliderButton.ImageColor3 = Color3.new(1, 0.235294, 0.247059)
233sliderButton.ScaleType = Enum.ScaleType.Slice
234sliderButton.SliceCenter = Rect.new(100, 100, 100, 100)
235sliderButton.SliceScale = 0.05;
236
237sliderValue.Name = "sliderValue"
238sliderValue.Parent = sliderLine
239sliderValue.BackgroundColor3 = Color3.new(1, 1, 1)
240sliderValue.BackgroundTransparency = 1
241sliderValue.Position = UDim2.new(0, 0, 1, 8)
242sliderValue.Size = UDim2.new(1, 0, 0, 6)
243sliderValue.Font = Enum.Font.SourceSans
244sliderValue.Text = '';
245sliderValue.TextColor3 = Color3.new(1, 1, 1)
246sliderValue.TextSize = 13
247
248sliderName.Parent = Slider
249sliderName.BackgroundColor3 = Color3.new(1, 1, 1)
250sliderName.BackgroundTransparency = 1
251sliderName.Size = UDim2.new(0, 168, 0, 24)
252sliderName.Font = Enum.Font.SourceSans
253sliderName.Text = "ullum everti"
254sliderName.TextColor3 = Color3.new(1, 1, 1)
255sliderName.TextSize = 14
256sliderName.TextXAlignment = Enum.TextXAlignment.Left
257sliderName.Name = 'sliderName';
258
259local UI = {};
260UI.roundToNthDecimal = function(num, n)
261 n = n or 1;
262 return math.floor(num * n + 0.5) / n;
263end;
264UI.playerMouse = game:GetService'Players'.LocalPlayer:GetMouse();
265local Values = {};
266
267UI.createToggle = function(self, objectName, Callback)
268 local newToggle = Toggle:Clone();
269 newToggle.objectName.Text = objectName;
270 newToggle.Parent = Holder;
271
272 local isToggled = false;
273 newToggle.Hitbox.InputBegan:Connect(function(input)
274 if input.UserInputType ~= Enum.UserInputType.MouseButton1 then return; end;
275 isToggled = not isToggled;
276 Values[objectName:lower():gsub('%W+', '')] = isToggled;
277 if Callback then Callback(isToggled) end;
278 newToggle.Toggle:TweenSize(UDim2.new(0, isToggled and 10 or 0, 0, isToggled and 10 or 0), nil, nil, 0.1, true);
279 end);
280
281 return newToggle;
282end;
283UI.createSlider = function(self, objectName, minimumValue, maximumValue, isDecimal, decimalPosition)
284 local newSlider = Slider:Clone();
285 newSlider.sliderName.Text = objectName;
286 newSlider.Parent = Holder;
287
288 local isActive = false;
289 newSlider.sliderLine.InputBegan:Connect(function(input)
290 if input.UserInputType ~= Enum.UserInputType.MouseButton1 then return; end;
291 isActive = true;
292 while isActive do
293 local relativeX = math.clamp(UI.playerMouse.X - newSlider.sliderLine.AbsolutePosition.X, 0, newSlider.sliderLine.AbsoluteSize.X);
294 local scaleX = relativeX / newSlider.sliderLine.AbsoluteSize.X;
295
296 newSlider.sliderLine.sliderButton:TweenPosition(UDim2.new(scaleX, 0, 0.5, 0), nil, nil, 0.05, true);
297
298 -- Magic
299 local currentAmount = minimumValue + ((maximumValue - minimumValue) * scaleX);
300 -- Too messy to have it all in 1 line...
301 currentAmount = isDecimal and UI.roundToNthDecimal(currentAmount, decimalPosition) or math.floor(currentAmount + 0.5);
302
303 newSlider.sliderLine.sliderValue.Text = currentAmount;
304 Values[objectName:lower():gsub('%W+', '')] = currentAmount;
305 game:GetService'RunService'.RenderStepped:Wait();
306 end;
307 end);
308 newSlider.sliderLine.InputEnded:Connect(function(input)
309 if input.UserInputType ~= Enum.UserInputType.MouseButton1 then return; end;
310 isActive = false;
311 end);
312
313 return newSlider;
314end;
315UI.createKeybind = function(self, objectName)
316 local newKeybind = Keybind:Clone();
317 newKeybind.Text = objectName;
318 newKeybind.Parent = Holder;
319
320 local awaitingInput = false;
321 newKeybind.Keybind.InputBegan:Connect(function(input)
322 if input.UserInputType ~= Enum.UserInputType.MouseButton1 then return; end;
323 awaitingInput = true;
324 newKeybind.Keybind.Text = '...';
325 end);
326 game:GetService'UserInputService'.InputBegan:Connect(function(input, gameProcessed)
327 wait();
328 if not awaitingInput or gameProcessed or #input.KeyCode.Name > 8 then return; end;
329
330 Values[objectName:lower():gsub('%W+', '')] = input.KeyCode.Name;
331 newKeybind.Keybind.Text = input.KeyCode.Name;
332 awaitingInput = false;
333 end);
334
335 return newKeybind;
336end;
337-- So that I won't have to resize it manually each time I add a button
338Holder.ChildAdded:Connect(function()
339 Main.Size = UDim2.new(0, 180, 0, 60 + UIListLayout.AbsoluteContentSize.Y)
340end);
341
342-- Make life easier
343local Toggles = {
344 'ESP Toggle',
345 'Display Same Team',
346 'Color Based On Team',
347 'Rainbow ESP',
348 'Rainbow Tracers',
349 'Display Player Name',
350 'Display Player Distance',
351 'Display Player Health',
352 'Filled Box',
353 'Tracers Toggle',
354 'Lock To Mouse',
355 'Visibility Check',
356 'Crosshair',
357 'Rainbow Crosshair'
358};
359for i,v in next, Toggles do
360 UI:createToggle(v);
361end;
362
363local Middle = Vector2.new(workspace.CurrentCamera.ViewportSize.X / 2, workspace.CurrentCamera.ViewportSize.Y / 2 - (game:GetService'GuiService':GetGuiInset().Y / 2))
364
365local Top, Left, Down, Right = Drawing.new'Line', Drawing.new'Line', Drawing.new'Line', Drawing.new'Line';
366Top.From = Middle + Vector2.new(0, 3);
367Left.From = Middle + Vector2.new(-3, 0);
368Down.From = Middle + Vector2.new(0, -3);
369Right.From = Middle + Vector2.new(3, 0);
370
371Top.To = Top.From + Vector2.new(0, 5);
372Down.To =Down.From + Vector2.new(0, -5);
373Left.To = Left.From + Vector2.new(-5, 0);
374Right.To = Right.From + Vector2.new(5, 0);
375
376Top.Thickness = 1;
377Left.Thickness = 1;
378Down.Thickness = 1;
379Right.Thickness = 1;
380
381UI:createSlider('ESP Text Size', 10, 30);
382UI:createSlider('Max Distance', 100, 10000);
383UI:createSlider('ESP Thickness', 1, 20)
384UI:createSlider('ESP Transp.', 0, 0.9, true, 10);
385UI:createSlider('Text Transp.', 0, 0.9, true, 10);
386UI:createSlider('Cross Size', 3, 20);
387UI:createSlider('Cross Thickn.', 1, 10);
388UI:createSlider('Cross Transp.', 0, 0.9, true, 10);
389
390local Players = game:GetService'Players';
391-- Make life easier
392local ffc, ffcwia = game.FindFirstChild, game.FindFirstChildWhichIsA;
393local lp = Players.LocalPlayer;
394
395local getChildren = game.GetChildren;
396local isA = game.IsA;
397local Insert, Remove = table.insert, table.remove;
398
399-- Here comes the shit code...
400local bbPlayers;
401if game.GameId == 1168263273 then
402 local modulesFolder = ffcwia(game:GetService'ReplicatedStorage', 'Folder');
403 if modulesFolder then
404 if ffcwia(modulesFolder, 'ModuleScript') then
405 local playersModule = getChildren(modulesFolder)[9];
406 if playersModule then
407 if isA(playersModule, 'ModuleScript') then
408 local Require = require(playersModule);
409 if type(Require) == 'table' then
410 local playersModuleMT = getrawmetatable(Require);
411 local oldMT = {};
412 if playersModuleMT then
413 for i,v in next, playersModuleMT do
414 rawset(oldMT, i, v);
415 rawset(playersModule, i, nil);
416 end;
417 end;
418
419 local foundFunc = rawget(Require, 'GetPlayerFromCharacter');
420
421 if playersModuleMT then
422 for i,v in next, oldMT do
423 rawset(playersModuleMT, i, v);
424 end;
425 end;
426
427 if foundFunc and type(foundFunc) == 'function' then
428 local foundUpvalues = debug.getupvalues(foundFunc);
429 if #foundUpvalues > 0 then
430 local playersTable = foundUpvalues[1];
431
432 if playersTable and type(playersTable) == 'table' then
433 bbPlayers = setmetatable({}, {
434 __index = function(s, key)
435 return rawget(foundUpvalues[1], key);
436 end;
437 });
438 else
439 lp:Kick('An error has occured, please contact Pyseph: BBa1 ' .. typeof(playersTable));
440 end;
441 else
442 lp:Kick('An error has occured, please contact Pyseph: BBh');
443 end;
444 else
445 lp:Kick('An error has occured, please contact Pyseph: BBg ' .. typeof(foundFunc));
446 end;
447
448 else
449 lp:Kick('An error has occured, please contact Pyseph: BBf ' .. typeof(Require));
450 end;
451 else
452 lp:Kick('An error has occured, please contact Pyseph: BBd');
453 end;
454 else
455 lp:Kick('An error has occured, please contact Pyseph: BBc');
456 end;
457 else
458 lp:Kick('An error has occured, please contact Pyseph: BBb');
459 end;
460 else
461 lp:Kick('An error has occured, please contact Pyseph: BBa');
462 end;
463end;
464
465-- Some games like Bad Business have custom characters, so I made a custom player grabber.
466local function getPlayers()
467 local foundPlayers = {};
468 if game.GameId == 1168263273 then
469 for i,v in next, Players:GetPlayers() do
470 if v ~= lp and bbPlayers[v] then--and ffc(bbPlayers[v], 'Body') then
471 Insert(foundPlayers, {Name = v.Name, Character = bbPlayers[v].Body});
472 end;
473 end;
474 else
475 for i,v in next, Players:GetPlayers() do
476 if v ~= lp then--v.Character and ffc(v.Character, 'Head') then
477 Insert(foundPlayers, v);
478 end;
479 end;
480 end;
481 return foundPlayers;
482end;
483
484local playerESP = {};
485for i,v in next, Players:GetPlayers() do
486 if v ~= lp then
487 playerESP[v] = {
488 [1] = Drawing.new'Square'; -- ESP
489 [2] = Drawing.new'Text'; -- NAME
490 [3] = Drawing.new'Line'; -- TRACERS
491 };
492 playerESP[v][1].Visible = true;
493 playerESP[v][2].Center = true;
494 end;
495end;
496
497Players.PlayerAdded:Connect(function(Player)
498 playerESP[Player] = {
499 [1] = Drawing.new'Square'; -- ESP
500 [2] = Drawing.new'Text'; -- NAME
501 [3] = Drawing.new'Line'; -- TRACERS
502 };
503 playerESP[Player][1].Visible = true;
504 playerESP[Player][2].Center = true;
505end);
506
507Players.PlayerRemoving:Connect(function(Player)
508 if Player == lp then return; end; -- This can cause an error otherwise, which the game can detect and ban with...
509 local plrESP = playerESP[Player];
510 plrESP[1]:Remove();
511 plrESP[2]:Remove();
512 plrESP[3]:Remove();
513 playerESP[Player] = nil;
514end);
515
516-- Localizing for more frames, not like it serves much of a difference lul
517local NewCF = CFrame.new;
518local NewVector = Vector3.new;
519local NewVector2 = Vector2.new;
520local Floor = math.floor;
521local emptyColor = Color3.new(1, 0, 0);
522local otherEmptyColor = Color3.new(1, 1, 1) -- We wouldn't want the text to also be red, now would we?
523local FromHSV = Color3.fromHSV;
524
525local rainbowColor = FromHSV(1, 1, 1);
526
527spawn(function()
528 while 1 do
529 for i = 0,1, 0.01 do
530 rainbowColor = FromHSV(i, 1, 1);
531 wait();
532 end;
533 end;
534end);
535
536-- From my API ;)
537local findTable = function(...)
538 for i,v in next, getreg() do
539 if type(v) == 'function' and not issentinelclosure(v) then
540 for g,b in next, debug.getupvalues(v) do
541 if type(b) == 'table' then
542 local HasAll = true;
543 for _, Val in next, {...} do
544 if not rawget(b, Val) then
545 HasAll = false;
546 end;
547 end;
548 if HasAll then return b; end;
549 end;
550 end;
551 end;
552 end;
553 -- If getreg fails to find the table, try your luck in getgc
554 for i,v in next, getgc(true) do
555 if type(v) == 'function' and not issentinelclosure(v) then
556 for g,b in next, debug.getupvalues(v) do
557 if type(b) == 'table' then
558 local HasAll = true;
559 for _, Val in next, {...} do
560 if not rawget(b, Val) then
561 HasAll = false;
562 end;
563 end;
564 if HasAll then return b; end;
565 end;
566 end;
567 -- getgc also has tables! You have to specify the ``true`` argument, though. Else it won't return any tables for lag causes.
568 elseif type(v) == 'table' then
569 local HasAll = true;
570 for _, Val in next, {...} do
571 if not rawget(v, Val) then
572 HasAll = false;
573 end;
574 end;
575 if HasAll then return v; end;
576 end;
577 end;
578end;
579
580-- for Bad Business
581local teamsTable = findTable'GetPlayerTeam';
582-- Phantom Forces destroys the Humanoid of every other player to try and fuck with ESP, but too bad they store it somewhere lul
583local hud = findTable'getplayerhealth';
584local getHP;
585if hud then
586 -- Phantom Forces
587 getHP = function(plr)
588 return hud:getplayerhealth(plr)
589 end;
590end;
591-- Make life easier
592local function convertVector(Position)
593 return NewVector2(Position.X, Position.Y);
594end;
595local function toScreen(Vector)
596 return workspace.CurrentCamera:WorldToViewportPoint(Vector);
597end;
598
599-- Island Royale's mouse has a weird offset
600local mOffset = NewVector2(961.5, 545.5 - 36);
601local cOffset = NewVector2(1009, 471);
602
603-- For Island Royale
604local function calculateOffset(Vector)
605 if game.PlaceId == 1320186298 or game.PlaceId == 1320174999 then
606 local pGui = lp.PlayerGui;
607 if pGui and ffc(pGui, 'Core_UI') and ffc(pGui.Core_UI, 'Crosshairs') and ffc(pGui.Core_UI, 'Center_Dot') then
608 local Mid = workspace.CurrentCamera.ViewportSize / 2;
609 if ffc(pGui.Core_UI, 'Center_Dot').Visible then
610 local Distance = Mid - mOffset;
611 return Vector + Distance;
612 else
613 local Distance = Mid - cOffset;
614 return Vector + Distance;
615 end;
616 end;
617 end;
618 return Vector;
619end;
620
621-- Main rendering function
622local function renderESP()
623 if not workspace.CurrentCamera then return; end;
624
625 if Values.crosshair then
626 Top.Visible = true;
627 Left.Visible = true;
628 Down.Visible = true;
629 Right.Visible = true;
630 if Values.rainbowcrosshair then
631 Top.Color = rainbowColor;
632 Left.Color = rainbowColor;
633 Down.Color = rainbowColor;
634 Right.Color = rainbowColor;
635 else
636 Top.Color = otherEmptyColor;
637 Left.Color = otherEmptyColor;
638 Down.Color = otherEmptyColor;
639 Right.Color = otherEmptyColor;
640 end;
641 if Values.crosssize then
642 Top.To = Top.From + Vector2.new(0, Values.crosssize);
643 Down.To = Down.From + Vector2.new(0, -Values.crosssize);
644 Left.To = Left.From + Vector2.new(-Values.crosssize, 0);
645 Right.To = Right.From + Vector2.new(Values.crosssize, 0);
646 else
647 Top.To = Top.From + Vector2.new(0, 5);
648 Down.To =Down.From + Vector2.new(0, -5);
649 Left.To = Left.From + Vector2.new(-5, 0);
650 Right.To = Right.From + Vector2.new(5, 0);
651 end;
652 if Values.crosstransp then
653 Top.Transparency = 1 - Values.crosstransp;
654 Left.Transparency = 1 - Values.crosstransp;
655 Down.Transparency = 1 - Values.crosstransp;
656 Right.Transparency = 1 - Values.crosstransp;
657 else
658 Top.Transparency = 1;
659 Left.Transparency = 1;
660 Down.Transparency = 1;
661 Right.Transparency = 1;
662 end;
663 if Values.crossthickn then
664 Top.Thickness = Values.crossthickn;
665 Left.Thickness = Values.crossthickn;
666 Down.Thickness = Values.crossthickn;
667 Right.Thickness = Values.crossthickn;
668 else
669 Top.Thickness = 1;
670 Left.Thickness = 1;
671 Down.Thickness = 1;
672 Right.Thickness = 1;
673 end;
674 else
675 Top.Visible = false;
676 Left.Visible = false;
677 Down.Visible = false;
678 Right.Visible = false;
679 end;
680
681 for i,v in next, playerESP do
682 local sameTeam = false;
683 if game.GameId == 1168263273 then
684 sameTeam = teamsTable:GetPlayerTeam(lp) ~= teamsTable:GetPlayerTeam(i)
685 else
686 sameTeam = lp.TeamColor ~= i.TeamColor;
687 end;
688 local plrChar = game.GameId == 1168263273 and bbPlayers[i] or i.Character;
689 local Box, Name, Tracer = unpack(v);
690 if plrChar and lp.Character then
691 plrChar = game.GameId == 1168263273 and (ffc(plrChar, 'Body') and plrChar.Body) or plrChar;
692 local charCF = plrChar:GetModelCFrame()
693 local Hum = ffcwia(plrChar, 'Humanoid');
694 local HP = 1;
695 if Hum then
696 HP = Hum.Health;
697 end;
698 if HP > 0 and (charCF.p - lp.Character:GetModelCFrame().p).Magnitude <= (Values.maxdistance or 9e9) then
699 local centerScreen, isVis = toScreen(charCF.p);
700 local Field = workspace.CurrentCamera.FieldOfView;
701 local zPos = (centerScreen.Z / 10);
702
703 Box.Size = NewVector2((21500 / zPos) / Field, (30000 / zPos) / Field);
704 Box.Position = NewVector2(centerScreen.X - (Box.Size.X / 2), centerScreen.Y - (Box.Size.Y / 2));
705 Box.Filled = not not Values.filledbox;
706
707 if Values.esptoggle and isVis then
708 if not Values.displaysameteam then
709 Box.Visible = sameTeam;
710 Name.Visible = sameTeam;
711 else
712 Box.Visible = true;
713 Name.Visible = true;
714 end;
715 else
716 Name.Visible = false;
717 Box.Visible = false;
718 end;
719
720 if Values.tracerstoggle and isVis then
721 if not Values.displaysameteam then
722 Tracer.Visible = sameTeam;
723 else
724 Tracer.Visible = true;
725 end;
726 Tracer.Transparency = Values.tracerstransparency and 1 - Values.tracerstransparency or 1;
727 Tracer.Thickness = Values.tracersthickness and Values.tracersthickness or 1;
728 Tracer.From = Values.locktomouse and calculateOffset(NewVector2(UI.playerMouse.X, UI.playerMouse.Y + 36)) or NewVector2(workspace.CurrentCamera and workspace.CurrentCamera.ViewportSize.X / 2 or UI.playerMouse.ViewSizeX / 2, workspace.CurrentCamera and workspace.CurrentCamera.ViewportSize.Y or UI.playerMouse.ViewSizeY + 36);
729 Tracer.To = NewVector2(centerScreen.X, centerScreen.Y);
730 if Values.colorbasedonteam then
731 Tracer.Color = i.TeamColor;
732 else
733 Tracer.Color = Values.rainbowtracers and rainbowColor or emptyColor;
734 end;
735 else
736 Tracer.Visible = false;
737 end;
738
739 local isRainbow = Values.rainbowesp;
740
741 if Box.Visible then
742 -- UGLY CODE WARNING
743 local displayText = '';
744 if Values.displayplayername then
745 displayText = i.Name;
746 end;
747 if Values.displayplayerhealth then
748 if game.GameId == 113491250 then
749 local currentHP, maxHP = getHP(i);
750 maxHP = maxHP or 100;
751 if currentHP then
752 currentHP = Floor(currentHP + 0.5);
753 displayText = displayText .. (displayText == '' and '[' or ' [') .. currentHP .. ' / ' .. maxHP .. ']';
754 end;
755 else
756 if ffcwia(plrChar, 'Humanoid') then
757 displayText = displayText .. (displayText == '' and '[' or ' [') .. ffcwia(plrChar, 'Humanoid').Health .. ' / ' .. ffcwia(plrChar, 'Humanoid').MaxHealth .. ']';
758 end;
759 end;
760 end;
761 if Values.displayplayerdistance and lp.Character and lp.Character.PrimaryPart then
762 local localRoot = lp.Character.PrimaryPart;
763 if localRoot then
764 if displayText == '' then
765 displayText = tostring(Floor((charCF.p - localRoot.Position).Magnitude + 0.5));
766 else
767 displayText = displayText .. ' ' .. Floor((charCF.p - localRoot.Position).Magnitude + 0.5);
768 end;
769 end;
770 end;
771 Box.Filled = not not Values.filledbox;
772 Box.Thickness = Values.espthickness or 1;
773 Box.Transparency = Values.esptransparency and 1 - Values.esptransparency or 1;
774 if Values.colorbasedonteam then
775 Box.Color = i.TeamColor;
776 Name.Color = i.TeamColor;
777 else
778 Box.Color = Values.rainbowesp and rainbowColor or emptyColor;
779 Name.Color = isRainbow and rainbowColor or otherEmptyColor;
780 end;
781 Name.Text = displayText;
782 Name.Position = NewVector2(Box.Position.X + (Box.Size.X / 2), Box.Position.Y);
783 Name.Transparency = Values.esptexttransparency and 1 - Values.esptexttransparency or 1;
784 Name.Size = Values.esptextsize or 16;
785 Name.Outline = not not Values.textoutline;
786 end;
787 else
788 Box.Visible = false;
789 Name.Visible = false;
790 Tracer.Visible = false;
791 end;
792 else
793 if Box and Name and Tracer then
794 Box.Visible = false;
795 Name.Visible = false;
796 Tracer.Visible = false;
797 end;
798 end;
799 end;
800end;
801
802game:GetService'UserInputService'.InputBegan:Connect(function(input, rs)
803 if rs or input.KeyCode ~= Enum.KeyCode.F4 then return; end;
804 SentinelESP.Enabled = not SentinelESP.Enabled;
805end);
806
807game:GetService'RunService'.RenderStepped:Connect(renderESP);