@@ -55,13 +55,15 @@ local Menu = {
55
55
56
56
Aimbot = {
57
57
Aimbot = true ,
58
+ ChargeBot = true ,
58
59
AimbotFOV = 360 ,
59
60
Silent = true ,
60
61
},
61
62
Visuals = {
62
63
EnableVisuals = false ,
63
64
RangeCircle = true ,
64
65
Visualization = true ,
66
+ Sphere = false ,
65
67
},
66
68
Misc = {
67
69
ChargeControl = true ,
@@ -896,6 +898,76 @@ local toggleCooldown = 0.2 -- 200 milliseconds
896
898
local bindTimer = 0
897
899
local bindDelay = 0.15 -- Delay of 0.2 seconds
898
900
901
+ local sphere_cache = { vertices = {}, segments = 16 , radius = 90 , center = Vector3 (0 , 0 , 0 ) } -- Cache for the sphere's vertices
902
+
903
+ -- Function to setup the sphere's vertices
904
+ local function setup_sphere (center , radius , segments )
905
+ sphere_cache .center = center
906
+ sphere_cache .radius = radius
907
+ sphere_cache .segments = segments
908
+ sphere_cache .vertices = {} -- Clear the old vertices
909
+
910
+ for i = 0 , segments - 1 do
911
+ local theta1 = math.pi * (i / segments )
912
+ local theta2 = math.pi * ((i + 1 ) / segments )
913
+
914
+ for j = 0 , segments - 1 do
915
+ local phi1 = 2 * math.pi * (j / segments )
916
+ local phi2 = 2 * math.pi * ((j + 1 ) / segments )
917
+
918
+ -- Generate two triangles for each square segment
919
+ table.insert (sphere_cache .vertices , {
920
+ Vector3 (math.sin (theta1 ) * math.cos (phi1 ), math.sin (theta1 ) * math.sin (phi1 ), math.cos (theta1 )),
921
+ Vector3 (math.sin (theta1 ) * math.cos (phi2 ), math.sin (theta1 ) * math.sin (phi2 ), math.cos (theta1 )),
922
+ Vector3 (math.sin (theta2 ) * math.cos (phi1 ), math.sin (theta2 ) * math.sin (phi1 ), math.cos (theta2 )),
923
+ })
924
+ table.insert (sphere_cache .vertices , {
925
+ Vector3 (math.sin (theta2 ) * math.cos (phi1 ), math.sin (theta2 ) * math.sin (phi1 ), math.cos (theta2 )),
926
+ Vector3 (math.sin (theta1 ) * math.cos (phi2 ), math.sin (theta1 ) * math.sin (phi2 ), math.cos (theta1 )),
927
+ Vector3 (math.sin (theta2 ) * math.cos (phi2 ), math.sin (theta2 ) * math.sin (phi2 ), math.cos (theta2 )),
928
+ })
929
+ end
930
+ end
931
+ end
932
+
933
+ -- Call setup_sphere once at the start of your program
934
+ setup_sphere (Vector3 (0 , 0 , 0 ), 90 , 16 )
935
+
936
+ local white_texture = draw .CreateTextureRGBA (string.char (
937
+ 0xff , 0xff , 0xff , 25 ,
938
+ 0xff , 0xff , 0xff , 25 ,
939
+ 0xff , 0xff , 0xff , 25 ,
940
+ 0xff , 0xff , 0xff , 25
941
+ ), 2 , 2 );
942
+
943
+ local drawPolygon = (function ()
944
+ local v1x , v1y = 0 , 0 ;
945
+ local function cross (a , b )
946
+ return (b [1 ] - a [1 ]) * (v1y - a [2 ]) - (b [2 ] - a [2 ]) * (v1x - a [1 ])
947
+ end
948
+
949
+ local TexturedPolygon = draw .TexturedPolygon ;
950
+
951
+ return function (vertices )
952
+ local cords , reverse_cords = {}, {};
953
+ local sizeof = # vertices ;
954
+ local sum = 0 ;
955
+
956
+ v1x , v1y = vertices [1 ][1 ], vertices [1 ][2 ];
957
+ for i , pos in pairs (vertices ) do
958
+ local convertedTbl = {pos [1 ], pos [2 ], 0 , 0 };
959
+
960
+ cords [i ], reverse_cords [sizeof - i + 1 ] = convertedTbl , convertedTbl ;
961
+
962
+ sum = sum + cross (pos , vertices [(i % sizeof ) + 1 ]);
963
+ end
964
+
965
+
966
+ TexturedPolygon (white_texture , (sum < 0 ) and reverse_cords or cords , true )
967
+ end
968
+ end )();
969
+
970
+
899
971
local function toggleMenu ()
900
972
local currentTime = globals .RealTime ()
901
973
if currentTime - lastToggleTime >= toggleCooldown then
@@ -965,23 +1037,57 @@ if not (engine.Con_IsVisible() or engine.IsGameUIVisible()) then
965
1037
draw .Line (vertices [i ][1 ], vertices [i ][2 ], vertices [j ][1 ], vertices [j ][2 ])
966
1038
end
967
1039
end
968
- end
969
-
970
- --[[ Draw crosses at the positions stored in playerTicks for all players
971
- if playerTicks then
972
- for playerIndex, positions in pairs(playerTicks) do
973
- for i = 1, #positions do
974
- local pos = positions[i]
975
-
976
- local screenPos = client.WorldToScreen(pos)
977
-
978
- if screenPos ~= nil then
979
- draw.Line(screenPos[1] + 10, screenPos[2], screenPos[1] - 10, screenPos[2])
980
- draw.Line(screenPos[1], screenPos[2] - 10, screenPos[1], screenPos[2] + 10)
1040
+ ---- -----------------------------------------------------sphere
1041
+ if Menu .Visuals .Sphere then
1042
+ -- Function to draw the sphere
1043
+ local function draw_sphere ()
1044
+ for _ , vertex in ipairs (sphere_cache .vertices ) do
1045
+ local worldPos1 = sphere_cache .center + vertex [1 ] * sphere_cache .radius
1046
+ local worldPos2 = sphere_cache .center + vertex [2 ] * sphere_cache .radius
1047
+ local worldPos3 = sphere_cache .center + vertex [3 ] * sphere_cache .radius
1048
+
1049
+ -- Trace from the center to the vertices
1050
+ local trace1 = engine .TraceHull (sphere_cache .center , worldPos1 , Vector3 (- 18 , - 18 , - 18 ), Vector3 (18 , 18 , 18 ), MASK_SHOT_HULL )
1051
+ local trace2 = engine .TraceHull (sphere_cache .center , worldPos2 , Vector3 (- 18 , - 18 , - 18 ), Vector3 (18 , 18 , 18 ), MASK_SHOT_HULL )
1052
+ local trace3 = engine .TraceHull (sphere_cache .center , worldPos3 , Vector3 (- 18 , - 18 , - 18 ), Vector3 (18 , 18 , 18 ), MASK_SHOT_HULL )
1053
+
1054
+ -- Adjust the end position of the vertices based on the trace results
1055
+ local endPos1 = trace1 .fraction < 1.0 and trace1 .endpos or worldPos1
1056
+ local endPos2 = trace2 .fraction < 1.0 and trace2 .endpos or worldPos2
1057
+ local endPos3 = trace3 .fraction < 1.0 and trace3 .endpos or worldPos3
1058
+
1059
+ local screenPos1 = client .WorldToScreen (endPos1 )
1060
+ local screenPos2 = client .WorldToScreen (endPos2 )
1061
+ local screenPos3 = client .WorldToScreen (endPos3 )
1062
+
1063
+ if screenPos1 and screenPos2 and screenPos3 then
1064
+ -- Convert the screen positions to the format expected by drawPolygon
1065
+ local polygonVertices = {
1066
+ {screenPos1 [1 ], screenPos1 [2 ]},
1067
+ {screenPos2 [1 ], screenPos2 [2 ]},
1068
+ {screenPos3 [1 ], screenPos3 [2 ]}
1069
+ }
1070
+
1071
+ -- Call drawPolygon to draw the triangle
1072
+ drawPolygon (polygonVertices )
1073
+
1074
+ -- Set the color and alpha for the lines
1075
+ draw .Color (255 , 255 , 255 , 25 )
1076
+
1077
+ -- Draw the lines
1078
+ draw .Line (screenPos1 [1 ], screenPos1 [2 ], screenPos2 [1 ], screenPos2 [2 ])
1079
+ draw .Line (screenPos2 [1 ], screenPos2 [2 ], screenPos3 [1 ], screenPos3 [2 ])
1080
+ draw .Line (screenPos3 [1 ], screenPos3 [2 ], screenPos1 [1 ], screenPos1 [2 ])
1081
+ end
1082
+ end
981
1083
end
1084
+ -- Example draw call, to be done every tick to draw the sphere at the current position and radius
1085
+ --- setup_sphere(Vector3(0, 0, 0), 90, 16)
1086
+ sphere_cache .center = pLocalOrigin
1087
+ sphere_cache .radius = swingrange
1088
+ draw_sphere ()
982
1089
end
983
1090
end
984
- end]]
985
1091
986
1092
-- enemy
987
1093
if vPlayerFuture then
@@ -1076,6 +1182,7 @@ if not (engine.Con_IsVisible() or engine.IsGameUIVisible()) then
1076
1182
1077
1183
ImMenu .BeginFrame (1 )
1078
1184
Menu .Aimbot .Silent = ImMenu .Checkbox (" Silent Aim" , Menu .Aimbot .Silent )
1185
+ Menu .Aimbot .ChargeBot = ImMenu .Checkbox (" Charge Bot" , Menu .Aimbot .ChargeBot )
1079
1186
ImMenu .EndFrame ()
1080
1187
1081
1188
ImMenu .BeginFrame (1 )
@@ -1146,6 +1253,11 @@ if not (engine.Con_IsVisible() or engine.IsGameUIVisible()) then
1146
1253
Menu .Visuals .Visualization = ImMenu .Checkbox (" Visualization" , Menu .Visuals .Visualization )
1147
1254
Menu .Visuals .RangeCircle = ImMenu .Checkbox (" Range Circle" , Menu .Visuals .RangeCircle )
1148
1255
ImMenu .EndFrame ()
1256
+
1257
+ ImMenu .BeginFrame (1 )
1258
+ ImMenu .Text (" Experimental" )
1259
+ Menu .Visuals .Sphere = ImMenu .Checkbox (" Range Sphere" , Menu .Visuals .Sphere )
1260
+ ImMenu .EndFrame ()
1149
1261
end
1150
1262
ImMenu .End ()
1151
1263
end
0 commit comments