-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path286090429.lua
384 lines (316 loc) · 11.9 KB
/
286090429.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
loadstring(game:HttpGet("https://raw.githubusercontent.com/Averiias/purple-haze-pf/main/ui/lib.lua"))()
local Window = library:CreateWindow({
WindowName = "ScarHack",
Color = Color3.fromRGB(11, 88, 11)
}, game:GetService("CoreGui"))
local AimbotTab = Window:CreateTab("Aimbot")
local VisualTab = Window:CreateTab("Visual")
local AimbotGeneral = AimbotTab:CreateSection("General")
local AimbotSettings = AimbotTab:CreateSection("Settings")
local PLAYER = game.Players.LocalPlayer
local MOUSE = PLAYER:GetMouse()
local CAMERA = game.Workspace.CurrentCamera
local ENABLED = false
local FREE_FOR_ALL = false
local AIM_TARGET = "Head"
local MAX_DISTANCE = 1000
local FOV_RADIUS = 360
local SMOOTHNESS = 1
local TEAM_CHECK = true
local VISIBLE_CHECK = true
local FOVCircle = Drawing.new("Circle")
FOVCircle.Thickness = 2
FOVCircle.NumSides = 60
FOVCircle.Radius = FOV_RADIUS
FOVCircle.Filled = false
FOVCircle.Visible = false
FOVCircle.ZIndex = 999
FOVCircle.Transparency = 1
FOVCircle.Color = Color3.fromRGB(255, 255, 255)
local ESP = loadstring(game:HttpGet("https://raw.githubusercontent.com/scar17off/scarhack/refs/heads/main/libraries/esp.lua"))()
local ESP_ENABLED = false
local ESP_BOXES = false
local ESP_NAMES = false
local ESP_TRACERS = false
local ESP_TEAM_CHECK = true
local ESP_TEAM_COLOR = false
local ESP_GLOW = false
local ESP_GLOW_COLOR = Color3.fromRGB(255, 0, 0)
local ESP_GLOW_TRANSPARENCY = 0.5
local ESP_GLOW_TEAM_COLOR = false
local ESPSection = VisualTab:CreateSection("ESP")
local ESPToggle = ESPSection:CreateToggle("Enable ESP", false, function(Value)
ESP_ENABLED = Value
ESP:Toggle(Value)
end)
local BoxesToggle = ESPSection:CreateToggle("Boxes", false, function(Value)
ESP_BOXES = Value
ESP.Boxes = Value
end)
local NamesToggle = ESPSection:CreateToggle("Names", false, function(Value)
ESP_NAMES = Value
ESP.Names = Value
end)
local TracersToggle = ESPSection:CreateToggle("Tracers", false, function(Value)
ESP_TRACERS = Value
ESP.Tracers = Value
end)
local TeamCheckToggle = ESPSection:CreateToggle("Team Check", true, function(Value)
ESP_TEAM_CHECK = Value
ESP.TeamMates = not Value
end)
local TeamColorToggle = ESPSection:CreateToggle("Team Color", false, function(Value)
ESP_TEAM_COLOR = Value
ESP.TeamColor = Value
end)
local GlowToggle = ESPSection:CreateToggle("Glow", false, function(Value)
ESP_GLOW = Value
ESP.Glow = Value
end)
local GlowColorPicker = ESPSection:CreateColorpicker("Glow Color", Color3.fromRGB(255, 0, 0), function(Value)
ESP_GLOW_COLOR = Value
ESP.GlowColor = Value
end)
local GlowTransparencySlider = ESPSection:CreateSlider("Glow Transparency", 0, 1, 0.5, false, function(Value)
ESP_GLOW_TRANSPARENCY = Value
ESP.GlowTransparency = Value
end)
local GlowTeamColorToggle = ESPSection:CreateToggle("Team Color Glow", false, function(Value)
ESP_GLOW_TEAM_COLOR = Value
-- Override GetColor for glow if team colors are enabled
if Value then
ESP.Overrides.GetGlowColor = function(obj)
local player = ESP:GetPlrFromChar(obj)
if player and player.Team then
return player.Team.TeamColor.Color
end
return ESP.GlowColor
end
else
ESP.Overrides.GetGlowColor = nil
end
end)
ESP.FaceCamera = true
ESP:Toggle(false)
ESP.Players = true
local DistanceToggle = ESPSection:CreateToggle("Show Distance", false, function(Value)
ESP.Distance = Value
end)
local DistanceSlider = ESPSection:CreateSlider("Max Distance", 100, 2000, 1000, true, function(Value)
ESP.MaxDistance = Value
end)
local HitscanSection = AimbotTab:CreateSection("Hitscan")
HitscanSection:CreateDropdown("Target Hitbox", {"Any", "Head", "HumanoidRootPart", "Torso"}, function(Option)
AIM_TARGET = Option
end)
local PreferredHitboxDropdown = HitscanSection:CreateDropdown("Preferred Hitbox", {
"Head",
"HumanoidRootPart",
"Torso",
"Left Arm",
"Right Arm",
"Left Leg",
"Right Leg"
}, function(Option)
PREFERRED_HITBOX = Option
end, "Head")
local AimMethodDropdown = HitscanSection:CreateDropdown("Aim Method", {
"Plain",
"Smooth",
"Flick"
}, function(Option)
AIM_METHOD = Option
end, "Smooth")
local RandomHitboxToggle = HitscanSection:CreateToggle("Random Hitbox Per Player", false, function(Value)
RANDOM_HITBOX = Value
end)
local PlayerHitboxes = {}
local function IsPartVisible(part)
local camera = game.Workspace.CurrentCamera
if not camera then return false end
local origin = camera.CFrame.Position
local target = part.Position
local vector = (target - origin)
local ray = Ray.new(origin, vector)
local ignoreList = {game.Players.LocalPlayer.Character}
local hit, position = workspace:FindPartOnRayWithIgnoreList(ray, ignoreList)
if hit then
if hit == part or hit:IsDescendantOf(part.Parent) then
return true
end
return false
end
return true
end
local function GetClosestVisiblePart(character)
local validParts = {
"Head",
"HumanoidRootPart",
"Torso",
"Left Arm",
"Right Arm",
"Left Leg",
"Right Leg"
}
local closestPart = nil
local closestDistance = math.huge
for _, partName in ipairs(validParts) do
local part = character:FindFirstChild(partName)
if part then
if IsPartVisible(part) then
local screenPoint = CAMERA:WorldToScreenPoint(part.Position)
local distance = (Vector2.new(screenPoint.X, screenPoint.Y) - Vector2.new(MOUSE.X, MOUSE.Y)).Magnitude
if distance < closestDistance then
closestDistance = distance
closestPart = part
end
end
end
end
return closestPart
end
local function GetClosestPlayerToMouse()
local PLAYERS = {}
local CLOSEST_PLAYER = nil
local CLOSEST_DISTANCE = math.huge
local CLOSEST_PART = nil
for _, player in pairs(game.Players:GetPlayers()) do
if player ~= PLAYER then
if not TEAM_CHECK or player.Team ~= PLAYER.Team then
local character = player.Character
if character then
local targetPart = nil
if AIM_TARGET == "Any" then
if RANDOM_HITBOX then
-- Check if player needs a new random hitbox
if not PlayerHitboxes[player] then
local validParts = {"Head", "HumanoidRootPart", "Torso", "Left Arm", "Right Arm", "Left Leg", "Right Leg"}
PlayerHitboxes[player] = validParts[math.random(1, #validParts)]
end
targetPart = character:FindFirstChild(PlayerHitboxes[player])
else
-- Use preferred hitbox if visible, otherwise find closest visible part
local preferredPart = character:FindFirstChild(PREFERRED_HITBOX)
if preferredPart and IsPartVisible(preferredPart) then
targetPart = preferredPart
else
targetPart = GetClosestVisiblePart(character)
end
end
else
targetPart = character:FindFirstChild(AIM_TARGET)
end
if targetPart then
if not VISIBLE_CHECK or IsPartVisible(targetPart) then
local screenPoint = CAMERA:WorldToScreenPoint(targetPart.Position)
local mouseDistance = (Vector2.new(screenPoint.X, screenPoint.Y) - Vector2.new(MOUSE.X, MOUSE.Y)).Magnitude
if mouseDistance <= FOV_RADIUS then
if mouseDistance < CLOSEST_DISTANCE then
CLOSEST_DISTANCE = mouseDistance
CLOSEST_PLAYER = player
CLOSEST_PART = targetPart
end
end
end
end
end
end
end
end
return CLOSEST_PLAYER, CLOSEST_PART
end
local AimbotToggle = AimbotGeneral:CreateToggle("Enable Aimbot", false, function(Value)
ENABLED = Value
end)
local TeamCheckToggle = AimbotGeneral:CreateToggle("Team Check", true, function(Value)
TEAM_CHECK = Value
end)
local VisibleCheckToggle = AimbotGeneral:CreateToggle("Visible Check", true, function(Value)
VISIBLE_CHECK = Value
end)
local ShowFOVToggle = AimbotGeneral:CreateToggle("Show FOV", false, function(Value)
FOVCircle.Visible = Value
end)
local FOVSlider = AimbotSettings:CreateSlider("FOV Radius", 0, 800, 360, true, function(Value)
FOV_RADIUS = Value
if FOVCircle then
FOVCircle.Radius = Value
end
end)
local SmoothnessSlider = AimbotSettings:CreateSlider("Smoothness", 1, 10, 1, true, function(Value)
SMOOTHNESS = Value
end)
AimbotToggle:CreateKeybind("F")
game:GetService("RunService").RenderStepped:Connect(function()
if FOVCircle then
FOVCircle.Position = Vector2.new(MOUSE.X, MOUSE.Y + 36)
end
if ENABLED then
local Target, TargetPart = GetClosestPlayerToMouse()
if Target and TargetPart then
local targetPos = CAMERA:WorldToScreenPoint(TargetPart.Position)
local mousePos = Vector2.new(MOUSE.X, MOUSE.Y)
local moveVector = Vector2.new(
(targetPos.X - mousePos.X),
(targetPos.Y - mousePos.Y)
)
if AIM_METHOD == "Plain" then
mousemoverel(moveVector.X, moveVector.Y)
elseif AIM_METHOD == "Smooth" then
mousemoverel(moveVector.X / SMOOTHNESS, moveVector.Y / SMOOTHNESS)
elseif AIM_METHOD == "Flick" then
-- Wait small random delay then flick
if math.random() < 0.1 then -- 10% chance each frame
mousemoverel(moveVector.X * 0.8, moveVector.Y * 0.8)
end
end
end
end
end)
local UserInputService = game:GetService("UserInputService")
UserInputService.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
FOVCircle.Position = UserInputService:GetMouseLocation()
end
end)
-- Cleanup when script is unloaded
game:GetService("CoreGui").ChildRemoved:Connect(function(child)
if child.Name == "ScarHack" then
ESP:Toggle(false)
-- Clean up FOV circle
if FOVCircle then
FOVCircle:Remove()
end
end
end)
local GUI_KEYBIND = "RightShift" -- Default keybind
local SettingsTab = Window:CreateTab("Settings")
local GeneralSection = SettingsTab:CreateSection("General")
-- Create a toggle first, then add keybind to it
local GuiToggle = GeneralSection:CreateToggle("Toggle GUI", true, function(Value)
Window:Toggle(Value)
end)
-- Add keybind to the toggle
GuiToggle:CreateKeybind("RightShift", function()
local guiWindow = game:GetService("CoreGui"):FindFirstChild("ScarHack")
if guiWindow then
local newState = not guiWindow.Main.Visible
GuiToggle:SetState(newState)
Window:Toggle(newState)
end
end)
-- Player death handler for random hitbox
game.Players.PlayerRemoving:Connect(function(player)
PlayerHitboxes[player] = nil
end)
-- Character removal handler
game.Workspace.ChildRemoved:Connect(function(child)
local player = game.Players:GetPlayerFromCharacter(child)
if player then
-- Assign new random hitbox when player dies
if RANDOM_HITBOX then
local validParts = {"Head", "HumanoidRootPart", "Torso", "Left Arm", "Right Arm", "Left Leg", "Right Leg"}
PlayerHitboxes[player] = validParts[math.random(1, #validParts)]
end
end
end)