· 6 years ago · Sep 01, 2019, 03:36 PM
1local plrs = game:GetService("Players")
2local TeamBased = true ; local teambasedswitch = "o"
3local presskeytoaim = true; local aimkey = "e"
4local raycast = false
5
6local espupdatetime = 5; autoesp = false
7
8
9
10local lockaim = true; local lockangle = 5
11
12
13
14--function findwat(folder, what)
15-- for i, smth in pairs(folder:GetChildren()) do
16-- if string.find(string.lower(tostring(smth)), string.lower(what)) then
17-- return smth
18-- end
19-- end
20--end
21--
22--local plrs = findwat(game, "Players")
23
24
25
26
27local Gui = Instance.new("ScreenGui")
28local Move = Instance.new("Frame")
29local Main = Instance.new("Frame")
30local EspStatus = Instance.new("TextLabel")
31local st1 = Instance.new("TextLabel")
32local st1_2 = Instance.new("TextLabel")
33local st1_3 = Instance.new("TextLabel")
34local Name = Instance.new("TextLabel")
35--Properties:
36Gui.Name = "Gui"
37Gui.Parent = plrs.LocalPlayer:WaitForChild("PlayerGui")
38
39Move.Name = "Move"
40Move.Parent = Gui
41Move.BackgroundColor3 = Color3.new(0, 170, 255)
42Move.BackgroundTransparency = 0.40000000596046
43Move.BorderSizePixel = 4
44Move.Position = UDim2.new(0.005, 0,0.018, 0)
45Move.Size = UDim2.new(0.28141585, 0, 0.0320388414, 0)
46
47Main.Name = "Main"
48Main.Parent = Move
49Main.BackgroundColor3 = Color3.new(0, 78, 117)
50Main.BackgroundTransparency = 0.69999998807907
51Main.Position = UDim2.new(0, 0, 0.995670795, 0)
52Main.Size = UDim2.new(1.0000006, 0, 9.79697132, 0)
53
54EspStatus.Name = "EspStatus"
55EspStatus.Parent = Main
56EspStatus.BackgroundColor3 = Color3.new(1, 1, 1)
57EspStatus.BackgroundTransparency = 1
58EspStatus.Size = UDim2.new(0.272955924, 0, 0.161862016, 0)
59EspStatus.Font = Enum.Font.GothamBold
60EspStatus.Text = "T = ESP"
61EspStatus.TextColor3 = Color3.new(255, 255, 255)
62EspStatus.TextScaled = true
63EspStatus.TextSize = 14
64EspStatus.TextWrapped = true
65
66st1.Name = "st1"
67st1.Parent = Main
68st1.BackgroundColor3 = Color3.new(1, 1, 1)
69st1.BackgroundTransparency = 1
70st1.Position = UDim2.new(0.271787882, 0, 0, 0)
71st1.Size = UDim2.new(0.728211343, 0, 0.161862016, 0)
72st1.Font = Enum.Font.GothamBold
73st1.Text = ""..aimkey.." = Lock Person"
74st1.TextColor3 = Color3.new(255, 255, 255)
75st1.TextScaled = true
76st1.TextSize = 14
77st1.TextWrapped = true
78
79st1_2.Name = "st1"
80st1_2.Parent = Main
81st1_2.BackgroundColor3 = Color3.new(1, 1, 1)
82st1_2.BackgroundTransparency = 1
83st1_2.Position = UDim2.new(0, 0, 0.375590861, 0)
84st1_2.Size = UDim2.new(0.999999881, 0, 0.161862016, 0)
85st1_2.Font = Enum.Font.GothamBold
86st1_2.Text = ""
87st1_2.TextColor3 = Color3.new(255, 255, 255)
88st1_2.TextScaled = true
89st1_2.TextSize = 14
90st1_2.TextWrapped = true
91
92st1_3.Name = "st1"
93st1_3.Parent = Main
94st1_3.BackgroundColor3 = Color3.new(1, 1, 1)
95st1_3.BackgroundTransparency = 1
96st1_3.Position = UDim2.new(0, 0, 0.18558608, 0)
97st1_3.Size = UDim2.new(0.999999881, 0, 0.161862016, 0)
98st1_3.Font = Enum.Font.GothamBold
99st1_3.Text = "O = Team Based"
100st1_3.TextColor3 = Color3.new(255, 255, 255)
101st1_3.TextScaled = true
102st1_3.TextSize = 14
103st1_3.TextWrapped = true
104local teambasedstatus = st1_3:Clone()
105teambasedstatus.Parent = st1_3
106teambasedstatus.TextScaled = true
107teambasedstatus.Position = UDim2.new(0, 0,0.694, 0)
108teambasedstatus.Text = tostring(TeamBased)
109
110Name.Name = "Name"
111Name.Parent = Move
112Name.BackgroundColor3 = Color3.new(1, 1, 1)
113Name.BackgroundTransparency = 1
114Name.Size = UDim2.new(0.838, 0, 0.980000019, 0)
115Name.Font = Enum.Font.GothamBold
116Name.Text = "LoudestPeeStream's FPS UI V3.2"
117Name.TextColor3 = Color3.new(0, 0, 0)
118Name.TextScaled = true
119Name.TextSize = 14
120Name.TextWrapped = true
121Name.TextXAlignment = Enum.TextXAlignment.Left
122-- Scripts:
123
124
125local plrsforaim = {}
126
127local lplr = game:GetService("Players").LocalPlayer
128Move.Draggable = true
129Gui.ResetOnSpawn = false
130Gui.Name = "Chat"
131Gui.DisplayOrder = 999
132
133 Gui.Parent = plrs.LocalPlayer.PlayerGui
134
135
136f = {}
137local espforlder
138
139f.addesp = function()
140 --print("ESP ran")
141 if espforlder then
142 else
143 espforlder = Instance.new("Folder")
144 espforlder.Parent = game.Workspace.CurrentCamera
145 end
146 for i, v in pairs(espforlder:GetChildren()) do
147 v:Destroy()
148 end
149 for _, plr in pairs(plrs:GetChildren()) do
150 if plr.Character and plr.Character.Humanoid.Health > 0 and plr.Name ~= lplr.Name then
151 if TeamBased == true then
152 if plr.Team.Name ~= plrs.LocalPlayer.Team.Name then
153 local e = espforlder:FindFirstChild(plr.Name)
154 if not e then
155 --print("Added esp for team based")
156 local bill = Instance.new("BillboardGui", espforlder)
157 bill.Name = plr.Name
158 bill.AlwaysOnTop = true
159 bill.Size = UDim2.new(1,0,1,0)
160 bill.Adornee = plr.Character.Head
161 local Frame = Instance.new('Frame',bill)
162 Frame.Active = true
163 Frame.BackgroundColor3 = Color3.new(0/255,255/255,0/255)
164 Frame.BackgroundTransparency = 0
165 Frame.BorderSizePixel = 0
166 Frame.AnchorPoint = Vector2.new(.5, .5)
167 Frame.Position = UDim2.new (0.5,0,0.5,0)
168 Frame.Size = UDim2.new (1,0,1,0)
169 Frame.Rotation = 0
170 plr.Character.Humanoid.Died:Connect(function()
171 bill:Destroy()
172 end)
173 end
174 end
175 else
176 local e = espforlder:FindFirstChild(plr.Name)
177 if not e then
178 --print("Added esp")
179 local bill = Instance.new("BillboardGui", espforlder)
180 bill.Name = plr.Name
181 bill.AlwaysOnTop = true
182 bill.Size = UDim2.new(1,0,1,0)
183 bill.Adornee = plr.Character.Head
184 local Frame = Instance.new('Frame',bill)
185 Frame.Active = true
186 Frame.BackgroundColor3 = Color3.new(0/255,255/255,0/255)
187 Frame.BackgroundTransparency = 0
188 Frame.BorderSizePixel = 2
189 Frame.AnchorPoint = Vector2.new(.5, .5)
190 Frame.Position = UDim2.new (0.5,0,0.5,0)
191 Frame.Size = UDim2.new (1,0,1,0)
192 Frame.Rotation = 0
193 plr.Character.Humanoid.Died:Connect(function()
194 bill:Destroy()
195 end)
196 end
197 end
198
199
200 end
201 end
202end
203local cam = game.Workspace.CurrentCamera
204
205local mouse = lplr:GetMouse()
206local switch = false
207local key = "k"
208local aimatpart = nil
209mouse.KeyDown:Connect(function(a)
210 if a == "t" then
211 print("worked1")
212 f.addesp()
213 elseif a == "u" then
214 if raycast == true then
215 raycast = false
216 else
217 raycast = true
218 end
219 elseif a == "l" then
220 if autoesp == false then
221 autoesp = true
222 else
223 autoesp = false
224 end
225 end
226 if a == "j" then
227 if mouse.Target then
228 mouse.Target:Destroy()
229 end
230 end
231 if a == key then
232 if switch == false then
233 switch = true
234 else
235 switch = false
236 if aimatpart ~= nil then
237 aimatpart = nil
238 end
239 end
240 elseif a == teambasedswitch then
241 if TeamBased == true then
242 TeamBased = false
243 teambasedstatus.Text = tostring(TeamBased)
244 else
245 TeamBased = true
246 teambasedstatus.Text = tostring(TeamBased)
247 end
248 elseif a == aimkey then
249 if not aimatpart then
250 local maxangle = math.rad(20)
251 for i, plr in pairs(plrs:GetChildren()) do
252 if plr.Name ~= lplr.Name and plr.Character and plr.Character.Head and plr.Character.Humanoid and plr.Character.Humanoid.Health > 1 then
253 if TeamBased == true then
254 if plr.Team.Name ~= lplr.Team.Name then
255 local an = checkfov(plr.Character.Head)
256 if an < maxangle then
257 maxangle = an
258 aimatpart = plr.Character.Head
259 end
260 end
261 else
262 local an = checkfov(plr.Character.Head)
263 if an < maxangle then
264 maxangle = an
265 aimatpart = plr.Character.Head
266 end
267 print(plr)
268 end
269 plr.Character.Humanoid.Died:Connect(function()
270 if aimatpart.Parent == plr.Character or aimatpart == nil then
271 aimatpart = nil
272 end
273 end)
274 end
275 end
276 else
277 aimatpart = nil
278 end
279 end
280end)
281
282function getfovxyz (p0, p1, deg)
283 local x1, y1, z1 = p0:ToOrientation()
284 local cf = CFrame.new(p0.p, p1.p)
285 local x2, y2, z2 = cf:ToOrientation()
286 --local d = math.deg
287 if deg then
288 --return Vector3.new(d(x1-x2), d(y1-y2), d(z1-z2))
289 else
290 return Vector3.new((x1-x2), (y1-y2), (z1-z2))
291 end
292end
293
294function getaimbotplrs()
295 plrsforaim = {}
296 for i, plr in pairs(plrs:GetChildren()) do
297 if plr.Character and plr.Character.Humanoid and plr.Character.Humanoid.Health > 0 and plr.Name ~= lplr.Name and plr.Character.Head then
298
299 if TeamBased == true then
300 if plr.Team.Name ~= lplr.Team.Name then
301 local cf = CFrame.new(game.Workspace.CurrentCamera.CFrame.p, plr.Character.Head.CFrame.p)
302 local r = Ray.new(cf, cf.LookVector * 10000)
303 local ign = {}
304 for i, v in pairs(plrs.LocalPlayer.Character:GetChildren()) do
305 if v:IsA("BasePart") then
306 table.insert(ign , v)
307 end
308 end
309 local obj = game.Workspace:FindPartOnRayWithIgnoreList(r, ign)
310 if obj.Parent == plr.Character and obj.Parent ~= lplr.Character then
311 table.insert(plrsforaim, obj)
312 end
313 end
314 else
315 local cf = CFrame.new(game.Workspace.CurrentCamera.CFrame.p, plr.Character.Head.CFrame.p)
316 local r = Ray.new(cf, cf.LookVector * 10000)
317 local ign = {}
318 for i, v in pairs(plrs.LocalPlayer.Character:GetChildren()) do
319 if v:IsA("BasePart") then
320 table.insert(ign , v)
321 end
322 end
323 local obj = game.Workspace:FindPartOnRayWithIgnoreList(r, ign)
324 if obj.Parent == plr.Character and obj.Parent ~= lplr.Character then
325 table.insert(plrsforaim, obj)
326 end
327 end
328
329
330 end
331 end
332end
333
334function aimat(part)
335 cam.CFrame = CFrame.new(cam.CFrame.p, part.CFrame.p)
336end
337function checkfov (part)
338 local fov = getfovxyz(game.Workspace.CurrentCamera.CFrame, part.CFrame)
339 local angle = math.abs(fov.X) + math.abs(fov.Y)
340 return angle
341end
342
343game:GetService("RunService").RenderStepped:Connect(function()
344 if aimatpart then
345 aimat(aimatpart)
346 if aimatpart.Parent == plrs.LocalPlayer.Character then
347 aimatpart = nil
348 end
349 end
350
351
352-- if switch == true then
353-- local maxangle = 99999
354--
355-- --print("Loop")
356-- if true and raycast == false then
357-- for i, plr in pairs(plrs:GetChildren()) do
358-- if plr.Name ~= lplr.Name and plr.Character and plr.Character.Head and plr.Character.Humanoid and plr.Character.Humanoid.Health > 1 then
359-- if TeamBased then
360-- if plr.Team.Name ~= lplr.Team.Name or plr.Team.TeamColor ~= lplr.Team.TeamColor then
361-- local an = checkfov(plr.Character.Head)
362-- if an < maxangle then
363-- maxangle = an
364-- aimatpart = plr.Character.Head
365-- if an < lockangle then
366-- break
367-- end
368-- end
369-- end
370-- else
371-- local an = checkfov(plr.Character.Head)
372-- if an < maxangle then
373-- maxangle = an
374-- aimatpart = plr.Character.Head
375-- if an < lockangle then
376-- break
377-- end
378-- end
379-- end
380--
381--
382--
383--
384-- end
385-- end
386-- elseif raycast == true then
387--
388-- end
389
390 if raycast == true and switch == false and not aimatpart then
391 getaimbotplrs()
392 aimatpart = nil
393 local maxangle = 999
394 for i, v in ipairs(plrsforaim) do
395 if v.Parent ~= lplr.Character then
396 local an = checkfov(v)
397 if an < maxangle and v ~= lplr.Character.Head then
398 maxangle = an
399 aimatpart = v
400 print(v:GetFullName())
401 v.Parent.Humanoid.Died:connect(function()
402 aimatpart = nil
403 end)
404 end
405 end
406 end
407
408 end
409end)
410delay(0, function()
411 while wait(espupdatetime) do
412 if autoesp == true then
413 pcall(function()
414 f.addesp()
415 end)
416 end
417 end
418end)
419warn("loaded")
420assert(Drawing, 'exploit not supported')
421
422local UserInputService = game:GetService'UserInputService';
423local HttpService = game:GetService'HttpService';
424local GUIService = game:GetService'GuiService';
425local RunService = game:GetService'RunService';
426local Players = game:GetService'Players';
427local LocalPlayer = Players.LocalPlayer;
428local Camera = workspace.CurrentCamera
429local Mouse = LocalPlayer:GetMouse();
430local Menu = {};
431local MouseHeld = false;
432local LastRefresh = 0;
433local OptionsFile = 'IC3_ESP_SETTINGS.dat';
434local Binding = false;
435local BindedKey = nil;
436local OIndex = 0;
437local LineBox = {};
438local UIButtons = {};
439local Sliders = {};
440local Dragging = false;
441local DraggingUI = false;
442local DragOffset = Vector2.new();
443local DraggingWhat = nil;
444local OldData = {};
445local IgnoreList = {};
446local Red = Color3.new(1, 0, 0);
447local Green = Color3.new(0, 1, 0);
448local MenuLoaded = false;
449local ErrorLogging = false;
450
451-- local _pc = pcall;
452-- local pcall = ErrorLogging and function(f, ...)
453-- local ret, err = _pc(f, ...);
454
455-- if not ret then
456-- warn(ret, err);
457-- warn(debug.traceback());
458-- end
459
460-- return ret, err;
461-- end or _pc;
462
463shared.MenuDrawingData = shared.MenuDrawingData or { Instances = {} };
464shared.InstanceData = shared.InstanceData or {};
465shared.RSName = shared.RSName or ('UnnamedESP_by_ic3-' .. HttpService:GenerateGUID(false));
466
467local GetDataName = shared.RSName .. '-GetData';
468local UpdateName = shared.RSName .. '-Update';
469
470local Debounce = setmetatable({}, {
471 __index = function(t, i)
472 return rawget(t, i) or false
473 end;
474});
475
476if shared.UESP_InputBeganCon then pcall(function() shared.UESP_InputBeganCon:disconnect() end); end
477if shared.UESP_InputEndedCon then pcall(function() shared.UESP_InputEndedCon:disconnect() end); end
478
479local RealPrint, LastPrintTick = print, 0;
480local LatestPrints = setmetatable({}, {
481 __index = function(t, i)
482 return rawget(t, i) or 0;
483 end
484});
485
486local function print(...)
487 local Content = unpack{...};
488 local print = RealPrint;
489
490 if tick() - LatestPrints[Content] > 5 then
491 LatestPrints[Content] = tick();
492 print(Content);
493 end
494end
495
496local function Set(t, i, v)
497 t[i] = v;
498end
499
500local Teams = {};
501local CustomTeams = { -- Games that don't use roblox's team system
502 [2563455047] = {
503 Initialize = function()
504 Teams.Sheriffs = {}; -- prevent big error
505 Teams.Bandits = {}; -- prevent big error
506 local Func = game:GetService'ReplicatedStorage':WaitForChild('RogueFunc', 1);
507 local Event = game:GetService'ReplicatedStorage':WaitForChild('RogueEvent', 1);
508 local S, B = Func:InvokeServer'AllTeamData';
509
510 Teams.Sheriffs = S;
511 Teams.Bandits = B;
512
513 Event.OnClientEvent:connect(function(id, PlayerName, Team, Remove) -- stolen straight from decompiled src lul
514 if id == 'UpdateTeam' then
515 local TeamTable, NotTeamTable
516 if Team == 'Bandits' then
517 TeamTable = TDM.Bandits
518 NotTeamTable = TDM.Sheriffs
519 else
520 TeamTable = TDM.Sheriffs
521 NotTeamTable = TDM.Bandits
522 end
523 if Remove then
524 TeamTable[PlayerName] = nil
525 else
526 TeamTable[PlayerName] = true
527 NotTeamTable[PlayerName] = nil
528 end
529 if PlayerName == LocalPlayer.Name then
530 TDM.Friendlys = TeamTable
531 TDM.Enemies = NotTeamTable
532 end
533 end
534 end)
535 end;
536 CheckTeam = function(Player)
537 local LocalTeam = Teams.Sheriffs[LocalPlayer.Name] and Teams.Sheriffs or Teams.Bandits;
538
539 return LocalTeam[Player.Name] and true or false;
540 end;
541 };
542}
543
544local RenderList = {Instances = {}};
545function RenderList:AddOrUpdateInstance(Instance, Obj2Draw, Text, Color)
546 -- print(Instance, Obj2Draw, Text, Color);
547 RenderList.Instances[Instance] = { ParentInstance = Instance; Instance = Obj2Draw; Text = Text; Color = Color };
548 return RenderList.Instances[Instance];
549end
550
551if bind then
552 -- bind('f2', function()
553 -- print(RenderList:AddOrUpdateInstance(LocalPlayer.Character, LocalPlayer.Character.Head, 'nigger', Color3.fromRGB(255, 255, 0)));
554 -- end)
555 -- bind('f3', function()
556 -- if tableToString then print(tableToString(RenderList)); end
557 -- end)
558end
559
560local CustomPlayerTag;
561local CustomESP;
562
563local Modules = {
564 [2262441883] = {
565 CustomPlayerTag = function(Player)
566 return Player:FindFirstChild'Job' and (' [' .. Player.Job.Value .. ']') or '';
567 end;
568 CustomESP = function()
569 if workspace:FindFirstChild'MoneyPrinters' then
570 for i, v in pairs(workspace.MoneyPrinters:GetChildren()) do
571 local Main = v:FindFirstChild'Main';
572 local Owner = v:FindFirstChild'TrueOwner';
573 local Money = v:FindFirstChild'Int' and v.Int:FindFirstChild'Money' or nil;
574 if Main and Owner and Money then
575 local O = tostring(Owner.Value);
576 local M = tostring(Money.Value);
577
578 pcall(RenderList.AddOrUpdateInstance, RenderList, v, Main, string.format('Money Printer\nOwned by %s\n[%s]', O, M), Color3.fromRGB(13, 255, 227));
579 end
580 end
581 end
582 end;
583 };
584 [3016661674] = {
585 CustomPlayerTag = function(Player)
586 local Name = '';
587
588 if Player:FindFirstChild'leaderstats' then
589 local Rank = '';
590 if Player.leaderstats:FindFirstChild'HouseRank' and Player.leaderstats:FindFirstChild'Gender' and Player.leaderstats.HouseRank.ClassName == 'StringValue' and not IsStringEmpty(Player.leaderstats.HouseRank.Value) then
591 Rank = Player.leaderstats.HouseRank.Value == 'Owner' and (Player.leaderstats.Gender.Value == 'Female' and 'Lady ' or 'Lord ') or '';
592 end
593 if Player.leaderstats:FindFirstChild'FirstName' and Player.leaderstats.FirstName.ClassName == 'StringValue' and not IsStringEmpty(Player.leaderstats.FirstName.Value) then
594 Name = Name .. '\n[' .. Rank .. Player.leaderstats.FirstName.Value;
595 end
596 if Player.leaderstats:FindFirstChild'LastName' and Player.leaderstats.LastName.ClassName == 'StringValue' and not IsStringEmpty(Player.leaderstats.LastName.Value) then
597 Name = Name .. ' ' .. Player.leaderstats.LastName.Value;
598 end
599 if not IsStringEmpty(Name) then Name = Name .. ']'; end
600 -- if Player.leaderstats:FindFirstChild'Gender' and Player.leaderstats.Gender.ClassName == 'StringValue' and not IsStringEmpty(Player.leaderstats.Gender.Value) then
601 -- Name = Name .. string.format(' [%s]', Player.leaderstats.Gender.Value:sub(1, 1));
602 -- end
603 end
604
605 return Name;
606 end;
607 };
608}
609
610if Modules[game.PlaceId] ~= nil then
611 local Module = Modules[game.PlaceId];
612 CustomPlayerTag = Module.CustomPlayerTag or nil;
613 CustomESP = Module.CustomESP or nil;
614end
615
616function GetMouseLocation()
617 return UserInputService:GetMouseLocation();
618end
619
620function MouseHoveringOver(Values)
621 local X1, Y1, X2, Y2 = Values[1], Values[2], Values[3], Values[4]
622 local MLocation = GetMouseLocation();
623 return (MLocation.x >= X1 and MLocation.x <= (X1 + (X2 - X1))) and (MLocation.y >= Y1 and MLocation.y <= (Y1 + (Y2 - Y1)));
624end
625
626function GetTableData(t) -- basically table.foreach i dont even know why i made this
627 if typeof(t) ~= 'table' then return end
628 return setmetatable(t, {
629 __call = function(t, func)
630 if typeof(func) ~= 'function' then return end;
631 for i, v in pairs(t) do
632 pcall(func, i, v);
633 end
634 end;
635 });
636end
637local function Format(format, ...)
638 return string.format(format, ...);
639end
640function CalculateValue(Min, Max, Percent)
641 return Min + math.floor(((Max - Min) * Percent) + .5);
642end
643
644function NewDrawing(InstanceName)
645 local Instance = Drawing.new(InstanceName);
646 return (function(Properties)
647 for i, v in pairs(Properties) do
648 pcall(Set, Instance, i, v);
649 end
650 return Instance;
651 end)
652end
653
654function Menu:AddMenuInstance(Name, DrawingType, Properties)
655 -- if shared.MenuDrawingData.Instances[Name] ~= nil then
656 -- shared.MenuDrawingData.Instances[Name]:Remove();
657 -- end
658 local Instance;
659
660 if shared.MenuDrawingData.Instances[Name] ~= nil then
661 Instance = shared.MenuDrawingData.Instances[Name];
662 for i, v in pairs(Properties) do
663 pcall(Set, Instance, i, v);
664 end
665 else
666 Instance = NewDrawing(DrawingType)(Properties);
667 end
668
669 shared.MenuDrawingData.Instances[Name] = Instance;
670
671 return Instance;
672end
673function Menu:UpdateMenuInstance(Name)
674 local Instance = shared.MenuDrawingData.Instances[Name];
675 if Instance ~= nil then
676 return (function(Properties)
677 for i, v in pairs(Properties) do
678 -- print(Format('%s %s -> %s', Name, tostring(i), tostring(v)));
679 pcall(Set, Instance, i, v);
680 end
681 return Instance;
682 end)
683 end
684end
685function Menu:GetInstance(Name)
686 return shared.MenuDrawingData.Instances[Name];
687end
688
689local Options = setmetatable({}, {
690 __call = function(t, ...)
691 local Arguments = {...};
692 local Name = Arguments[1];
693 OIndex = OIndex + 1; -- (typeof(Arguments[3]) == 'boolean' and 1 or 0);
694 rawset(t, Name, setmetatable({
695 Name = Arguments[1];
696 Text = Arguments[2];
697 Value = Arguments[3];
698 DefaultValue = Arguments[3];
699 AllArgs = Arguments;
700 Index = OIndex;
701 }, {
702 __call = function(t, v)
703 local self = t;
704
705 if typeof(t.Value) == 'function' then
706 t.Value();
707 elseif typeof(t.Value) == 'EnumItem' then
708 local BT = Menu:GetInstance(Format('%s_BindText', t.Name));
709 Binding = true;
710 local Val = 0
711 while Binding do
712 wait();
713 Val = (Val + 1) % 17;
714 BT.Text = Val <= 8 and '|' or '';
715 end
716 t.Value = BindedKey;
717 BT.Text = tostring(t.Value):match'%w+%.%w+%.(.+)';
718 BT.Position = t.BasePosition + Vector2.new(t.BaseSize.X - BT.TextBounds.X - 20, -10);
719 else
720 local NewValue = v;
721 if NewValue == nil then NewValue = not t.Value; end
722 rawset(t, 'Value', NewValue);
723
724 if Arguments[2] ~= nil and Menu:GetInstance'TopBar'.Visible then
725 if typeof(Arguments[3]) == 'number' then
726 local AMT = Menu:GetInstance(Format('%s_AmountText', t.Name));
727 if AMT then
728 AMT.Text = tostring(t.Value);
729 AMT.Position = t.BasePosition + Vector2.new(t.BaseSize.X - AMT.TextBounds.X - 10, -10);
730 end
731 else
732 local Inner = Menu:GetInstance(Format('%s_InnerCircle', t.Name));
733 if Inner then Inner.Visible = t.Value; end
734 end
735 end
736 end
737 end;
738 }));
739 end;
740})
741
742function Load()
743 local _, Result = pcall(readfile, OptionsFile);
744 if _ then -- extremely ugly code yea i know but i dont care p.s. i hate pcall
745 local _, Table = pcall(HttpService.JSONDecode, HttpService, Result);
746 if _ then
747 for i, v in pairs(Table) do
748 if Options[i] ~= nil and Options[i].Value ~= nil and (typeof(Options[i].Value) == 'boolean' or typeof(Options[i].Value) == 'number') then
749 Options[i].Value = v.Value;
750 pcall(Options[i], v.Value);
751 end
752 end
753 end
754 end
755end
756
757Options('Enabled', 'ESP Enabled', true);
758Options('ShowTeam', 'Show Team', false);
759Options('ShowTeamColor', 'Show Team Color', false);
760Options('ShowName', 'Show Names', true);
761Options('ShowDistance', 'Show Distance', true);
762Options('ShowHealth', 'Show Health', true);
763Options('ShowBoxes', 'Show Boxes', true);
764Options('ShowTracers', 'Show Tracers', true);
765Options('ShowDot', 'Show Head Dot', false);
766Options('VisCheck', 'Visibility Check', false);
767Options('Crosshair', 'Crosshair', false);
768Options('TextOutline', 'Text Outline', true);
769Options('Rainbow', 'Rainbow Mode', false);
770Options('TextSize', 'Text Size', syn and 18 or 14, 10, 24); -- cuz synapse fonts look weird???
771Options('MaxDistance', 'Max Distance', 2500, 100, 25000);
772Options('RefreshRate', 'Refresh Rate (ms)', 5, 1, 200);
773Options('MenuKey', 'Menu Key', Enum.KeyCode.F4, 1);
774Options('ToggleKey', 'Toggle Key', Enum.KeyCode.F3, 1);
775Options('ResetSettings', 'Reset Settings', function()
776 for i, v in pairs(Options) do
777 if Options[i] ~= nil and Options[i].Value ~= nil and Options[i].Text ~= nil and (typeof(Options[i].Value) == 'boolean' or typeof(Options[i].Value) == 'number') then
778 Options[i](Options[i].DefaultValue);
779 end
780 end
781end, 4);
782Options('LoadSettings', 'Load Settings', Load, 3);
783Options('SaveSettings', 'Save Settings', function()
784 writefile(OptionsFile, HttpService:JSONEncode(Options));
785end, 2)
786-- Options.SaveSettings.Value();
787
788Load();
789
790Options('MenuOpen', nil, true);
791
792local function Combine(...)
793 local Output = {};
794 for i, v in pairs{...} do
795 if typeof(v) == 'table' then
796 table.foreach(v, function(i, v)
797 Output[i] = v;
798 end)
799 end
800 end
801 return Output
802end
803function IsStringEmpty(String)
804 if type(String) == 'string' then
805 return String:match'^%s+$' ~= nil or #String == 0 or String == '' or false;
806 end
807 return false
808end
809
810function LineBox:Create(Properties)
811 local Box = { Visible = true }; -- prevent errors not really though dont worry bout the Visible = true thing
812
813 local Properties = Combine({
814 Transparency = 1;
815 Thickness = 1;
816 Visible = true;
817 }, Properties);
818
819 Box['TopLeft'] = NewDrawing'Line'(Properties);
820 Box['TopRight'] = NewDrawing'Line'(Properties);
821 Box['BottomLeft'] = NewDrawing'Line'(Properties);
822 Box['BottomRight'] = NewDrawing'Line'(Properties);
823
824 function Box:Update(CF, Size, Color, Properties)
825 if not CF or not Size then return end
826
827 local TLPos, Visible1 = Camera:WorldToViewportPoint((CF * CFrame.new( Size.X, Size.Y, 0)).p);
828 local TRPos, Visible2 = Camera:WorldToViewportPoint((CF * CFrame.new(-Size.X, Size.Y, 0)).p);
829 local BLPos, Visible3 = Camera:WorldToViewportPoint((CF * CFrame.new( Size.X, -Size.Y, 0)).p);
830 local BRPos, Visible4 = Camera:WorldToViewportPoint((CF * CFrame.new(-Size.X, -Size.Y, 0)).p);
831
832 Visible1 = TLPos.Z > 0 -- (commented | reason: random flashes);
833 Visible2 = TRPos.Z > 0 -- (commented | reason: random flashes);
834 Visible3 = BLPos.Z > 0 -- (commented | reason: random flashes);
835 Visible4 = BRPos.Z > 0 -- (commented | reason: random flashes);
836
837 -- ## BEGIN UGLY CODE
838 if Visible1 then
839 Box['TopLeft'].Visible = true;
840 Box['TopLeft'].Color = Color;
841 Box['TopLeft'].From = Vector2.new(TLPos.X, TLPos.Y);
842 Box['TopLeft'].To = Vector2.new(TRPos.X, TRPos.Y);
843 else
844 Box['TopLeft'].Visible = false;
845 end
846 if Visible2 then
847 Box['TopRight'].Visible = true;
848 Box['TopRight'].Color = Color;
849 Box['TopRight'].From = Vector2.new(TRPos.X, TRPos.Y);
850 Box['TopRight'].To = Vector2.new(BRPos.X, BRPos.Y);
851 else
852 Box['TopRight'].Visible = false;
853 end
854 if Visible3 then
855 Box['BottomLeft'].Visible = true;
856 Box['BottomLeft'].Color = Color;
857 Box['BottomLeft'].From = Vector2.new(BLPos.X, BLPos.Y);
858 Box['BottomLeft'].To = Vector2.new(TLPos.X, TLPos.Y);
859 else
860 Box['BottomLeft'].Visible = false;
861 end
862 if Visible4 then
863 Box['BottomRight'].Visible = true;
864 Box['BottomRight'].Color = Color;
865 Box['BottomRight'].From = Vector2.new(BRPos.X, BRPos.Y);
866 Box['BottomRight'].To = Vector2.new(BLPos.X, BLPos.Y);
867 else
868 Box['BottomRight'].Visible = false;
869 end
870 -- ## END UGLY CODE
871 if Properties then
872 GetTableData(Properties)(function(i, v)
873 pcall(Set, Box['TopLeft'], i, v);
874 pcall(Set, Box['TopRight'], i, v);
875 pcall(Set, Box['BottomLeft'], i, v);
876 pcall(Set, Box['BottomRight'], i, v);
877 end)
878 end
879 end
880 function Box:SetVisible(bool)
881 pcall(Set, Box['TopLeft'], 'Visible', bool);
882 pcall(Set, Box['TopRight'], 'Visible', bool);
883 pcall(Set, Box['BottomLeft'], 'Visible', bool);
884 pcall(Set, Box['BottomRight'], 'Visible', bool);
885 end
886 function Box:Remove()
887 self:SetVisible(false);
888 Box['TopLeft']:Remove();
889 Box['TopRight']:Remove();
890 Box['BottomLeft']:Remove();
891 Box['BottomRight']:Remove();
892 end
893
894 return Box;
895end
896
897function CreateMenu(NewPosition) -- Create Menu
898 local function FromHex(HEX)
899 HEX = HEX:gsub('#', '');
900 return Color3.fromRGB(tonumber('0x' .. HEX:sub(1, 2)), tonumber('0x' .. HEX:sub(3, 4)), tonumber('0x' .. HEX:sub(5, 6)));
901 end
902
903 local Colors = {
904 Primary = {
905 Main = FromHex'424242';
906 Light = FromHex'6d6d6d';
907 Dark = FromHex'1b1b1b';
908 };
909 Secondary = {
910 Main = FromHex'e0e0e0';
911 Light = FromHex'ffffff';
912 Dark = FromHex'aeaeae';
913 };
914 };
915
916 MenuLoaded = false;
917
918 -- GetTableData(UIButtons)(function(i, v)
919 -- v.Instance.Visible = false;
920 -- v.Instance:Remove();
921 -- end)
922 -- GetTableData(Sliders)(function(i, v)
923 -- v.Instance.Visible = false;
924 -- v.Instance:Remove();
925 -- end)
926
927 UIButtons = {};
928 Sliders = {};
929
930 local BaseSize = Vector2.new(300, 630);
931 local BasePosition = NewPosition or Vector2.new(Camera.ViewportSize.X / 8 - (BaseSize.X / 2), Camera.ViewportSize.Y / 2 - (BaseSize.Y / 2));
932
933 Menu:AddMenuInstance('CrosshairX', 'Line', {
934 Visible = false;
935 Color = Color3.new(0, 1, 0);
936 Transparency = 1;
937 Thickness = 1;
938 });
939 Menu:AddMenuInstance('CrosshairY', 'Line', {
940 Visible = false;
941 Color = Color3.new(0, 1, 0);
942 Transparency = 1;
943 Thickness = 1;
944 });
945
946 delay(.025, function() -- since zindex doesnt exist
947 Menu:AddMenuInstance('Main', 'Square', {
948 Size = BaseSize;
949 Position = BasePosition;
950 Filled = false;
951 Color = Colors.Primary.Main;
952 Thickness = 3;
953 Visible = true;
954 });
955 end);
956 Menu:AddMenuInstance('TopBar', 'Square', {
957 Position = BasePosition;
958 Size = Vector2.new(BaseSize.X, 15);
959 Color = Colors.Primary.Dark;
960 Filled = true;
961 Visible = true;
962 });
963 Menu:AddMenuInstance('TopBarTwo', 'Square', {
964 Position = BasePosition + Vector2.new(0, 15);
965 Size = Vector2.new(BaseSize.X, 45);
966 Color = Colors.Primary.Main;
967 Filled = true;
968 Visible = true;
969 });
970 Menu:AddMenuInstance('TopBarText', 'Text', {
971 Size = 25;
972 Position = shared.MenuDrawingData.Instances.TopBarTwo.Position + Vector2.new(25, 10);
973 Text = 'Unnamed ESP';
974 Color = Colors.Secondary.Light;
975 Visible = true;
976 });
977 Menu:AddMenuInstance('TopBarTextBR', 'Text', {
978 Size = 15;
979 Position = shared.MenuDrawingData.Instances.TopBarTwo.Position + Vector2.new(BaseSize.X - 65, 25);
980 Text = 'by ic3w0lf';
981 Color = Colors.Secondary.Dark;
982 Visible = true;
983 });
984 Menu:AddMenuInstance('Filling', 'Square', {
985 Size = BaseSize - Vector2.new(0, 60);
986 Position = BasePosition + Vector2.new(0, 60);
987 Filled = true;
988 Color = Colors.Secondary.Main;
989 Transparency= .5;
990 Visible = true;
991 });
992
993 local CPos = 0;
994
995 GetTableData(Options)(function(i, v)
996 if typeof(v.Value) == 'boolean' and not IsStringEmpty(v.Text) and v.Text ~= nil then
997 CPos = CPos + 25;
998 local BaseSize = Vector2.new(BaseSize.X, 30);
999 local BasePosition = shared.MenuDrawingData.Instances.Filling.Position + Vector2.new(30, v.Index * 25 - 10);
1000 UIButtons[#UIButtons + 1] = {
1001 Option = v;
1002 Instance = Menu:AddMenuInstance(Format('%s_Hitbox', v.Name), 'Square', {
1003 Position = BasePosition - Vector2.new(30, 15);
1004 Size = BaseSize;
1005 Visible = false;
1006 });
1007 };
1008 Menu:AddMenuInstance(Format('%s_OuterCircle', v.Name), 'Circle', {
1009 Radius = 10;
1010 Position = BasePosition;
1011 Color = Colors.Secondary.Light;
1012 Filled = true;
1013 Visible = true;
1014 });
1015 Menu:AddMenuInstance(Format('%s_InnerCircle', v.Name), 'Circle', {
1016 Radius = 7;
1017 Position = BasePosition;
1018 Color = Colors.Secondary.Dark;
1019 Filled = true;
1020 Visible = v.Value;
1021 });
1022 Menu:AddMenuInstance(Format('%s_Text', v.Name), 'Text', {
1023 Text = v.Text;
1024 Size = 20;
1025 Position = BasePosition + Vector2.new(20, -10);
1026 Visible = true;
1027 Color = Colors.Primary.Dark;
1028 });
1029 end
1030 end)
1031 GetTableData(Options)(function(i, v) -- just to make sure certain things are drawn before or after others, too lazy to actually sort table
1032 if typeof(v.Value) == 'number' then
1033 CPos = CPos + 25;
1034
1035 local BaseSize = Vector2.new(BaseSize.X, 30);
1036 local BasePosition = shared.MenuDrawingData.Instances.Filling.Position + Vector2.new(0, CPos - 10);
1037
1038 local Text = Menu:AddMenuInstance(Format('%s_Text', v.Name), 'Text', {
1039 Text = v.Text;
1040 Size = 20;
1041 Position = BasePosition + Vector2.new(20, -10);
1042 Visible = true;
1043 Color = Colors.Primary.Dark;
1044 });
1045 local AMT = Menu:AddMenuInstance(Format('%s_AmountText', v.Name), 'Text', {
1046 Text = tostring(v.Value);
1047 Size = 20;
1048 Position = BasePosition;
1049 Visible = true;
1050 Color = Colors.Primary.Dark;
1051 });
1052 local Line = Menu:AddMenuInstance(Format('%s_SliderLine', v.Name), 'Line', {
1053 Transparency = 1;
1054 Color = Colors.Primary.Dark;
1055 Thickness = 3;
1056 Visible = true;
1057 From = BasePosition + Vector2.new(20, 20);
1058 To = BasePosition + Vector2.new(BaseSize.X - 10, 20);
1059 });
1060 CPos = CPos + 10;
1061 local Slider = Menu:AddMenuInstance(Format('%s_Slider', v.Name), 'Circle', {
1062 Visible = true;
1063 Filled = true;
1064 Radius = 6;
1065 Color = Colors.Secondary.Dark;
1066 Position = BasePosition + Vector2.new(35, 20);
1067 })
1068
1069 local CSlider = {Slider = Slider; Line = Line; Min = v.AllArgs[4]; Max = v.AllArgs[5]; Option = v};
1070 Sliders[#Sliders + 1] = CSlider;
1071
1072 -- local Percent = (v.Value / CSlider.Max) * 100;
1073 -- local Size = math.abs(Line.From.X - Line.To.X);
1074 -- local Value = Size * (Percent / 100); -- this shit's inaccurate but fuck it i'm not even gonna bother fixing it
1075
1076 Slider.Position = BasePosition + Vector2.new(40, 20);
1077
1078 v.BaseSize = BaseSize;
1079 v.BasePosition = BasePosition;
1080 AMT.Position = BasePosition + Vector2.new(BaseSize.X - AMT.TextBounds.X - 10, -10)
1081 end
1082 end)
1083 local FirstItem = false;
1084 GetTableData(Options)(function(i, v) -- just to make sure certain things are drawn before or after others, too lazy to actually sort table
1085 if typeof(v.Value) == 'EnumItem' then
1086 CPos = CPos + (not FirstItem and 30 or 25);
1087 FirstItem = true;
1088
1089 local BaseSize = Vector2.new(BaseSize.X, FirstItem and 30 or 25);
1090 local BasePosition = shared.MenuDrawingData.Instances.Filling.Position + Vector2.new(0, CPos - 10);
1091
1092 UIButtons[#UIButtons + 1] = {
1093 Option = v;
1094 Instance = Menu:AddMenuInstance(Format('%s_Hitbox', v.Name), 'Square', {
1095 Size = Vector2.new(BaseSize.X, 20) - Vector2.new(30, 0);
1096 Visible = true;
1097 Transparency= .5;
1098 Position = BasePosition + Vector2.new(15, -10);
1099 Color = Colors.Secondary.Light;
1100 Filled = true;
1101 });
1102 };
1103 local Text = Menu:AddMenuInstance(Format('%s_Text', v.Name), 'Text', {
1104 Text = v.Text;
1105 Size = 20;
1106 Position = BasePosition + Vector2.new(20, -10);
1107 Visible = true;
1108 Color = Colors.Primary.Dark;
1109 });
1110 local BindText = Menu:AddMenuInstance(Format('%s_BindText', v.Name), 'Text', {
1111 Text = tostring(v.Value):match'%w+%.%w+%.(.+)';
1112 Size = 20;
1113 Position = BasePosition;
1114 Visible = true;
1115 Color = Colors.Primary.Dark;
1116 });
1117
1118 Options[i].BaseSize = BaseSize;
1119 Options[i].BasePosition = BasePosition;
1120 BindText.Position = BasePosition + Vector2.new(BaseSize.X - BindText.TextBounds.X - 20, -10);
1121 end
1122 end)
1123 GetTableData(Options)(function(i, v) -- just to make sure certain things are drawn before or after others, too lazy to actually sort table
1124 if typeof(v.Value) == 'function' then
1125 local BaseSize = Vector2.new(BaseSize.X, 30);
1126 local BasePosition = shared.MenuDrawingData.Instances.Filling.Position + Vector2.new(0, CPos + (25 * v.AllArgs[4]) - 35);
1127
1128 UIButtons[#UIButtons + 1] = {
1129 Option = v;
1130 Instance = Menu:AddMenuInstance(Format('%s_Hitbox', v.Name), 'Square', {
1131 Size = Vector2.new(BaseSize.X, 20) - Vector2.new(30, 0);
1132 Visible = true;
1133 Transparency= .5;
1134 Position = BasePosition + Vector2.new(15, -10);
1135 Color = Colors.Secondary.Light;
1136 Filled = true;
1137 });
1138 };
1139 local Text = Menu:AddMenuInstance(Format('%s_Text', v.Name), 'Text', {
1140 Text = v.Text;
1141 Size = 20;
1142 Position = BasePosition + Vector2.new(20, -10);
1143 Visible = true;
1144 Color = Colors.Primary.Dark;
1145 });
1146
1147 -- BindText.Position = BasePosition + Vector2.new(BaseSize.X - BindText.TextBounds.X - 10, -10);
1148 end
1149 end)
1150
1151 delay(.1, function()
1152 MenuLoaded = true;
1153 end);
1154
1155 -- this has to be at the bottom cuz proto drawing api doesnt have zindex :triumph:
1156 Menu:AddMenuInstance('Cursor1', 'Line', {
1157 Visible = false;
1158 Color = Color3.new(1, 0, 0);
1159 Transparency = 1;
1160 Thickness = 2;
1161 });
1162 Menu:AddMenuInstance('Cursor2', 'Line', {
1163 Visible = false;
1164 Color = Color3.new(1, 0, 0);
1165 Transparency = 1;
1166 Thickness = 2;
1167 });
1168 Menu:AddMenuInstance('Cursor3', 'Line', {
1169 Visible = false;
1170 Color = Color3.new(1, 0, 0);
1171 Transparency = 1;
1172 Thickness = 2;
1173 });
1174end
1175
1176CreateMenu();
1177
1178shared.UESP_InputBeganCon = UserInputService.InputBegan:connect(function(input)
1179 if input.UserInputType.Name == 'MouseButton1' and Options.MenuOpen.Value then
1180 MouseHeld = true;
1181 local Bar = Menu:GetInstance'TopBar';
1182 local Values = {
1183 Bar.Position.X;
1184 Bar.Position.Y;
1185 Bar.Position.X + Bar.Size.X;
1186 Bar.Position.Y + Bar.Size.Y;
1187 }
1188 if MouseHoveringOver(Values) then -- and not syn then -- disable dragging for synapse cuz idk why it breaks
1189 DraggingUI = true;
1190 DragOffset = Menu:GetInstance'Main'.Position - GetMouseLocation();
1191 else
1192 for i, v in pairs(Sliders) do
1193 local Values = {
1194 v.Line.From.X - (v.Slider.Radius);
1195 v.Line.From.Y - (v.Slider.Radius);
1196 v.Line.To.X + (v.Slider.Radius);
1197 v.Line.To.Y + (v.Slider.Radius);
1198 };
1199 if MouseHoveringOver(Values) then
1200 DraggingWhat = v;
1201 Dragging = true;
1202 break
1203 end
1204 end
1205 end
1206 end
1207end)
1208shared.UESP_InputEndedCon = UserInputService.InputEnded:connect(function(input)
1209 if input.UserInputType.Name == 'MouseButton1' and Options.MenuOpen.Value then
1210 MouseHeld = false;
1211 for i, v in pairs(UIButtons) do
1212 local Values = {
1213 v.Instance.Position.X;
1214 v.Instance.Position.Y;
1215 v.Instance.Position.X + v.Instance.Size.X;
1216 v.Instance.Position.Y + v.Instance.Size.Y;
1217 };
1218 if MouseHoveringOver(Values) then
1219 v.Option();
1220 break -- prevent clicking 2 options
1221 end
1222 end
1223 elseif input.UserInputType.Name == 'Keyboard' then
1224 if Binding then
1225 BindedKey = input.KeyCode;
1226 Binding = false;
1227 elseif input.KeyCode == Options.MenuKey.Value or (input.KeyCode == Enum.KeyCode.Home and UserInputService:IsKeyDown(Enum.KeyCode.LeftControl)) then
1228 Options.MenuOpen();
1229 elseif input.KeyCode == Options.ToggleKey.Value then
1230 Options.Enabled();
1231 end
1232 end
1233end)
1234
1235function ToggleMenu()
1236 if Options.MenuOpen.Value then
1237 GetTableData(shared.MenuDrawingData.Instances)(function(i, v)
1238 if OldData[v] then
1239 pcall(Set, v, 'Visible', true);
1240 end
1241 end)
1242 else
1243 -- GUIService:SetMenuIsOpen(false);
1244 GetTableData(shared.MenuDrawingData.Instances)(function(i, v)
1245 OldData[v] = v.Visible;
1246 if v.Visible then
1247 pcall(Set, v, 'Visible', false);
1248 end
1249 end)
1250 end
1251end
1252
1253function CheckRay(Instance, Distance, Position, Unit)
1254 local Pass = true;
1255 local Model = Instance;
1256
1257 if Distance > 999 then return false; end
1258
1259 if Instance:IsA'Player' and not Instance.Character then
1260 return false;
1261 elseif Instance:IsA'Player' and Instance.Character then
1262 Model = Instance.Character
1263 else
1264 Model = Instance.Parent;
1265 if Model.Parent == workspace then
1266 Model = Instance;
1267 end
1268 end
1269
1270 local _Ray = Ray.new(Position, Unit * Distance);
1271
1272 local List = {LocalPlayer.Character, Camera, Mouse.TargetFilter};
1273
1274 for i,v in pairs(IgnoreList) do table.insert(List, v); end;
1275
1276 local Hit = workspace:FindPartOnRayWithIgnoreList(_Ray, List);
1277
1278 if Hit and not Hit:IsDescendantOf(Model) then
1279 Pass = false;
1280 if Hit.Transparency >= .3 or not Hit.CanCollide and Hit.ClassName ~= Terrain then -- Detect invisible walls
1281 IgnoreList[#IgnoreList + 1] = Hit;
1282 end
1283 end
1284
1285 return Pass;
1286end
1287
1288function CheckTeam(Player)
1289 if Player.Neutral and LocalPlayer.Neutral then return true; end
1290 return Player.TeamColor == LocalPlayer.TeamColor;
1291end
1292
1293local CustomTeam = CustomTeams[game.PlaceId];
1294
1295if CustomTeam ~= nil then
1296 ypcall(CustomTeam.Initialize);
1297 CheckTeam = CustomTeam.CheckTeam;
1298end
1299
1300function CheckPlayer(Player)
1301 if not Options.Enabled.Value then return false end
1302
1303 local Pass = true;
1304 local Distance = 0;
1305
1306 if Player ~= LocalPlayer and Player.Character then
1307 if not Options.ShowTeam.Value and CheckTeam(Player) then
1308 Pass = false;
1309 end
1310
1311 local Head = Player.Character:FindFirstChild'Head';
1312
1313 if Pass and Player.Character and Head then
1314 Distance = (Camera.CFrame.p - Head.Position).magnitude;
1315 if Options.VisCheck.Value then
1316 Pass = CheckRay(Player, Distance, Camera.CFrame.p, (Head.Position - Camera.CFrame.p).unit);
1317 end
1318 if Distance > Options.MaxDistance.Value then
1319 Pass = false;
1320 end
1321 end
1322 else
1323 Pass = false;
1324 end
1325
1326 return Pass, Distance;
1327end
1328
1329function CheckDistance(Instance)
1330 if not Options.Enabled.Value then return false end
1331
1332 local Pass = true;
1333 local Distance = 0;
1334
1335 if Instance ~= nil then
1336 Distance = (Camera.CFrame.p - Instance.Position).magnitude;
1337 if Options.VisCheck.Value then
1338 Pass = CheckRay(Instance, Distance, Camera.CFrame.p, (Instance.Position - Camera.CFrame.p).unit);
1339 end
1340 if Distance > Options.MaxDistance.Value then
1341 Pass = false;
1342 end
1343 else
1344 Pass = false;
1345 end
1346
1347 return Pass, Distance;
1348end
1349
1350function UpdatePlayerData()
1351 if (tick() - LastRefresh) > (Options.RefreshRate.Value / 1000) then
1352 LastRefresh = tick();
1353 if CustomESP and Options.Enabled.Value then
1354 pcall(CustomESP);
1355 end
1356 for i, v in pairs(RenderList.Instances) do
1357 if v.Instance ~= nil and v.Instance.Parent ~= nil and v.Instance:IsA'BasePart' then
1358 local Data = shared.InstanceData[v.Instance:GetDebugId()] or { Instances = {}; DontDelete = true };
1359
1360 Data.Instance = v.Instance;
1361
1362 Data.Instances['Tracer'] = Data.Instances['Tracer'] or NewDrawing'Line'{
1363 Transparency = 1;
1364 Thickness = 2;
1365 }
1366 Data.Instances['NameTag'] = Data.Instances['NameTag'] or NewDrawing'Text'{
1367 Size = Options.TextSize.Value;
1368 Center = true;
1369 Outline = Options.TextOutline.Value;
1370 Visible = true;
1371 };
1372 Data.Instances['DistanceTag'] = Data.Instances['DistanceTag'] or NewDrawing'Text'{
1373 Size = Options.TextSize.Value - 1;
1374 Center = true;
1375 Outline = Options.TextOutline.Value;
1376 Visible = true;
1377 };
1378
1379 local NameTag = Data.Instances['NameTag'];
1380 local DistanceTag = Data.Instances['DistanceTag'];
1381 local Tracer = Data.Instances['Tracer'];
1382
1383 local Pass, Distance = CheckDistance(v.Instance);
1384
1385 if Pass then
1386 local ScreenPosition, Vis = Camera:WorldToViewportPoint(v.Instance.Position);
1387
1388 if ScreenPosition.Z > 0 then
1389 local Color = v.Color;
1390
1391 local ScreenPositionUpper = ScreenPosition
1392 -- Camera:WorldToViewportPoint((v.Instance.CFrame * CFrame.new(0, v.Instance.Size.Y, 0)).p);
1393
1394 if Options.ShowName.Value then
1395 LocalPlayer.NameDisplayDistance = 0;
1396 NameTag.Visible = true;
1397 NameTag.Text = v.Text;
1398 NameTag.Size = Options.TextSize.Value;
1399 NameTag.Outline = Options.TextOutline.Value;
1400 NameTag.Position = Vector2.new(ScreenPositionUpper.X, ScreenPositionUpper.Y);
1401 NameTag.Color = Color;
1402 if Drawing.Fonts then -- CURRENTLY SYNAPSE ONLY :MEGAHOLY:
1403 NameTag.Font = Drawing.Fonts.UI;
1404 end
1405 else
1406 LocalPlayer.NameDisplayDistance = 100;
1407 NameTag.Visible = false;
1408 end
1409 if Options.ShowDistance.Value or Options.ShowHealth.Value then
1410 DistanceTag.Visible = true;
1411 DistanceTag.Size = Options.TextSize.Value - 1;
1412 DistanceTag.Outline = Options.TextOutline.Value;
1413 DistanceTag.Color = Color3.new(1, 1, 1);
1414 if Drawing.Fonts then -- CURRENTLY SYNAPSE ONLY :MEGAHOLY:
1415 NameTag.Font = Drawing.Fonts.UI;
1416 end
1417
1418 local Str = '';
1419
1420 if Options.ShowDistance.Value then
1421 Str = Str .. Format('[%d] ', Distance);
1422 end
1423
1424 DistanceTag.Text = Str;
1425 DistanceTag.Position = Vector2.new(ScreenPositionUpper.X, ScreenPositionUpper.Y) + Vector2.new(0, NameTag.TextBounds.Y);
1426 else
1427 DistanceTag.Visible = false;
1428 end
1429 if Options.ShowTracers.Value then
1430 Tracer.Visible = true;
1431 Tracer.From = Vector2.new(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y);
1432 Tracer.To = Vector2.new(ScreenPosition.X, ScreenPosition.Y);
1433 Tracer.Color = Color;
1434 else
1435 Tracer.Visible = false;
1436 end
1437 else
1438 NameTag.Visible = false;
1439 DistanceTag.Visible = false;
1440 Tracer.Visible = false;
1441 end
1442 else
1443 NameTag.Visible = false;
1444 DistanceTag.Visible = false;
1445 Tracer.Visible = false;
1446 end
1447
1448 Data.Instances['NameTag'] = NameTag;
1449 Data.Instances['DistanceTag'] = DistanceTag;
1450 Data.Instances['Tracer'] = Tracer;
1451
1452 shared.InstanceData[v.Instance:GetDebugId()] = Data;
1453 end
1454 end
1455 for i, v in pairs(Players:GetPlayers()) do
1456 local Data = shared.InstanceData[v.Name] or { Instances = {}; };
1457
1458 Data.Instances['Box'] = Data.Instances['Box'] or LineBox:Create{Thickness = 3};
1459 Data.Instances['Tracer'] = Data.Instances['Tracer'] or NewDrawing'Line'{
1460 Transparency = 1;
1461 Thickness = 2;
1462 }
1463 Data.Instances['HeadDot'] = Data.Instances['HeadDot'] or NewDrawing'Circle'{
1464 Filled = true;
1465 NumSides = 30;
1466 }
1467 Data.Instances['NameTag'] = Data.Instances['NameTag'] or NewDrawing'Text'{
1468 Size = Options.TextSize.Value;
1469 Center = true;
1470 Outline = Options.TextOutline.Value;
1471 Visible = true;
1472 };
1473 Data.Instances['DistanceHealthTag'] = Data.Instances['DistanceHealthTag'] or NewDrawing'Text'{
1474 Size = Options.TextSize.Value - 1;
1475 Center = true;
1476 Outline = Options.TextOutline.Value;
1477 Visible = true;
1478 };
1479
1480 local NameTag = Data.Instances['NameTag'];
1481 local DistanceTag = Data.Instances['DistanceHealthTag'];
1482 local Tracer = Data.Instances['Tracer'];
1483 local HeadDot = Data.Instances['HeadDot'];
1484 local Box = Data.Instances['Box'];
1485
1486 local Pass, Distance = CheckPlayer(v);
1487
1488 if Pass and v.Character then
1489 local Humanoid = v.Character:FindFirstChildOfClass'Humanoid';
1490 local Head = v.Character:FindFirstChild'Head';
1491 local HumanoidRootPart = v.Character:FindFirstChild'HumanoidRootPart';
1492 if v.Character ~= nil and Head and HumanoidRootPart then
1493 local ScreenPosition, Vis = Camera:WorldToViewportPoint(Head.Position);
1494
1495 if ScreenPosition.Z > 0 then
1496 local Color = Options.Rainbow.Value and Color3.fromHSV(tick() * 128 % 255/255, 1, 1) or (CheckTeam(v) and Green or Red);
1497
1498 if (Options.ShowTeamColor.Value) then Color = v.TeamColor.Color; end
1499
1500 local ScreenPositionUpper = Camera:WorldToViewportPoint((HumanoidRootPart:GetRenderCFrame() * CFrame.new(0, Head.Size.Y + HumanoidRootPart.Size.Y, 0)).p);
1501 local Scale = Head.Size.Y / 2;
1502
1503 if Options.ShowName.Value then
1504 NameTag.Visible = true;
1505 NameTag.Text = v.Name .. (CustomPlayerTag and CustomPlayerTag(v) or '');
1506 NameTag.Size = Options.TextSize.Value;
1507 NameTag.Outline = Options.TextOutline.Value;
1508 NameTag.Position = Vector2.new(ScreenPositionUpper.X, ScreenPositionUpper.Y) - Vector2.new(0, NameTag.TextBounds.Y);
1509 NameTag.Color = Color;
1510 if Drawing.Fonts then -- CURRENTLY SYNAPSE ONLY :MEGAHOLY:
1511 NameTag.Font = Drawing.Fonts.UI;
1512 end
1513 else
1514 NameTag.Visible = false;
1515 end
1516 if Options.ShowDistance.Value or Options.ShowHealth.Value then
1517 DistanceTag.Visible = true;
1518 DistanceTag.Size = Options.TextSize.Value - 1;
1519 DistanceTag.Outline = Options.TextOutline.Value;
1520 DistanceTag.Color = Color3.new(1, 1, 1);
1521 if Drawing.Fonts then -- CURRENTLY SYNAPSE ONLY :MEGAHOLY:
1522 NameTag.Font = Drawing.Fonts.UI;
1523 end
1524
1525 local Str = '';
1526
1527 if Options.ShowDistance.Value then
1528 Str = Str .. Format('[%d] ', Distance);
1529 end
1530 if Options.ShowHealth.Value and Humanoid then
1531 Str = Str .. Format('[%d/100]', Humanoid.Health / Humanoid.MaxHealth * 100);
1532 end
1533
1534 DistanceTag.Text = Str;
1535 DistanceTag.Position = (NameTag.Visible and NameTag.Position + Vector2.new(0, NameTag.TextBounds.Y) or Vector2.new(ScreenPositionUpper.X, ScreenPositionUpper.Y));
1536 else
1537 DistanceTag.Visible = false;
1538 end
1539 if Options.ShowDot.Value and Vis then
1540 local Top = Camera:WorldToViewportPoint((Head.CFrame * CFrame.new(0, Scale, 0)).p);
1541 local Bottom = Camera:WorldToViewportPoint((Head.CFrame * CFrame.new(0, -Scale, 0)).p);
1542 local Radius = (Top - Bottom).y;
1543
1544 HeadDot.Visible = true;
1545 HeadDot.Color = Color;
1546 HeadDot.Position = Vector2.new(ScreenPosition.X, ScreenPosition.Y);
1547 HeadDot.Radius = Radius;
1548 else
1549 HeadDot.Visible = false;
1550 end
1551 if Options.ShowTracers.Value then
1552 Tracer.Visible = true;
1553 Tracer.From = Vector2.new(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y);
1554 Tracer.To = Vector2.new(ScreenPosition.X, ScreenPosition.Y);
1555 Tracer.Color = Color;
1556 else
1557 Tracer.Visible = false;
1558 end
1559 if Options.ShowBoxes.Value and Vis and HumanoidRootPart then
1560 Box:Update(HumanoidRootPart.CFrame, Vector3.new(2, 3, 0) * (Scale * 2), Color);
1561 else
1562 Box:SetVisible(false);
1563 end
1564 else
1565 NameTag.Visible = false;
1566 DistanceTag.Visible = false;
1567 Tracer.Visible = false;
1568 HeadDot.Visible = false;
1569
1570 Box:SetVisible(false);
1571 end
1572 end
1573 else
1574 NameTag.Visible = false;
1575 DistanceTag.Visible = false;
1576 Tracer.Visible = false;
1577 HeadDot.Visible = false;
1578
1579 Box:SetVisible(false);
1580 end
1581
1582 shared.InstanceData[v.Name] = Data;
1583 end
1584 end
1585end
1586
1587local LastInvalidCheck = 0;
1588
1589function Update()
1590 if tick() - LastInvalidCheck > 1 then
1591 LastInvalidCheck = tick();
1592
1593 if Camera.Parent ~= workspace then
1594 Camera = workspace.CurrentCamera;
1595 end
1596
1597 for i, v in pairs(shared.InstanceData) do
1598 if not Players:FindFirstChild(tostring(i)) then
1599 if not shared.InstanceData[i].DontDelete then
1600 GetTableData(v.Instances)(function(i, obj)
1601 obj.Visible = false;
1602 obj:Remove();
1603 v.Instances[i] = nil;
1604 end)
1605 shared.InstanceData[i] = nil;
1606 else
1607 if shared.InstanceData[i].Instance == nil or shared.InstanceData[i].Instance.Parent == nil then
1608 GetTableData(v.Instances)(function(i, obj)
1609 obj.Visible = false;
1610 obj:Remove();
1611 v.Instances[i] = nil;
1612 end)
1613 shared.InstanceData[i] = nil;
1614 end
1615 end
1616 end
1617 end
1618 end
1619
1620 local CX = Menu:GetInstance'CrosshairX';
1621 local CY = Menu:GetInstance'CrosshairY';
1622
1623 if Options.Crosshair.Value then
1624 CX.Visible = true;
1625 CY.Visible = true;
1626
1627 CX.To = Vector2.new((Camera.ViewportSize.X / 2) - 8, (Camera.ViewportSize.Y / 2));
1628 CX.From = Vector2.new((Camera.ViewportSize.X / 2) + 8, (Camera.ViewportSize.Y / 2));
1629 CY.To = Vector2.new((Camera.ViewportSize.X / 2), (Camera.ViewportSize.Y / 2) - 8);
1630 CY.From = Vector2.new((Camera.ViewportSize.X / 2), (Camera.ViewportSize.Y / 2) + 8);
1631 else
1632 CX.Visible = false;
1633 CY.Visible = false;
1634 end
1635
1636 if Options.MenuOpen.Value and MenuLoaded then
1637 local MLocation = GetMouseLocation();
1638 shared.MenuDrawingData.Instances.Main.Color = Color3.fromHSV(tick() * 24 % 255/255, 1, 1);
1639 local MainInstance = Menu:GetInstance'Main';
1640
1641 local Values = {
1642 MainInstance.Position.X;
1643 MainInstance.Position.Y;
1644 MainInstance.Position.X + MainInstance.Size.X;
1645 MainInstance.Position.Y + MainInstance.Size.Y;
1646 };
1647
1648 if MainInstance and MouseHoveringOver(Values) then
1649 Debounce.CursorVis = true;
1650 -- GUIService:SetMenuIsOpen(true);
1651 Menu:UpdateMenuInstance'Cursor1'{
1652 Visible = true;
1653 From = Vector2.new(MLocation.x, MLocation.y);
1654 To = Vector2.new(MLocation.x + 5, MLocation.y + 6);
1655 }
1656 Menu:UpdateMenuInstance'Cursor2'{
1657 Visible = true;
1658 From = Vector2.new(MLocation.x, MLocation.y);
1659 To = Vector2.new(MLocation.x, MLocation.y + 8);
1660 }
1661 Menu:UpdateMenuInstance'Cursor3'{
1662 Visible = true;
1663 From = Vector2.new(MLocation.x, MLocation.y + 6);
1664 To = Vector2.new(MLocation.x + 5, MLocation.y + 5);
1665 }
1666 else
1667 if Debounce.CursorVis then
1668 Debounce.CursorVis = false;
1669 -- GUIService:SetMenuIsOpen(false);
1670 Menu:UpdateMenuInstance'Cursor1'{Visible = false};
1671 Menu:UpdateMenuInstance'Cursor2'{Visible = false};
1672 Menu:UpdateMenuInstance'Cursor3'{Visible = false};
1673 end
1674 end
1675 if MouseHeld then
1676 if Dragging then
1677 DraggingWhat.Slider.Position = Vector2.new(math.clamp(MLocation.X, DraggingWhat.Line.From.X, DraggingWhat.Line.To.X), DraggingWhat.Slider.Position.Y);
1678 local Percent = (DraggingWhat.Slider.Position.X - DraggingWhat.Line.From.X) / ((DraggingWhat.Line.To.X - DraggingWhat.Line.From.X));
1679 local Value = CalculateValue(DraggingWhat.Min, DraggingWhat.Max, Percent);
1680 DraggingWhat.Option(Value);
1681 elseif DraggingUI then
1682 Debounce.UIDrag = true;
1683 local Main = Menu:GetInstance'Main';
1684 local MousePos = GetMouseLocation();
1685 Main.Position = MousePos + DragOffset;
1686 end
1687 else
1688 Dragging = false;
1689 if DraggingUI and Debounce.UIDrag then
1690 Debounce.UIDrag = false;
1691 DraggingUI = false;
1692 CreateMenu(Menu:GetInstance'Main'.Position);
1693 end
1694 end
1695 if not Debounce.Menu then
1696 Debounce.Menu = true;
1697 ToggleMenu();
1698 end
1699 elseif Debounce.Menu and not Options.MenuOpen.Value then
1700 Debounce.Menu = false;
1701 ToggleMenu();
1702 end
1703end
1704
1705RunService:UnbindFromRenderStep(GetDataName);
1706RunService:UnbindFromRenderStep(UpdateName);
1707
1708RunService:BindToRenderStep(GetDataName, 1, UpdatePlayerData);
1709RunService:BindToRenderStep(UpdateName, 1, Update);