-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path6788434697.lua
542 lines (449 loc) · 16.1 KB
/
6788434697.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
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
loadstring(game:HttpGet("https://raw.githubusercontent.com/Averiias/purple-haze-pf/main/ui/lib.lua"))()
local Window = library:CreateWindow({
WindowName = "Zombie Farm",
Color = Color3.fromRGB(255, 128, 128)
}, game:GetService("CoreGui"))
local MainTab = Window:CreateTab("Main")
local ESPTab = Window:CreateTab("ESP")
local AutoFarm1Section = MainTab:CreateSection("Auto Farm 1")
local AutoFarm2Section = MainTab:CreateSection("Auto Farm 2")
local FreezeSection = MainTab:CreateSection("Freeze Control")
local AimbotSection = MainTab:CreateSection("Aimbot")
-- Global variables for toggles
local AUTO_FARM = false
local AUTO_FARM_2 = false
local RANGE_FREEZE = false
local AUTO_FARM_DISTANCE = 50
local AUTO_FARM_BEHIND = true
local AUTO_FARM_2_DISTANCE = 5
local FREEZE_RANGE = 30
local DEFAULT_WALKSPEED = 16
local AIMBOT_ENABLED = false
local AIMBOT_INCLUDE_BOSSES = false
local FOV_RADIUS = 360
local AUTO_FARM_INCLUDE_BOSSES = false
local AUTO_FARM_2_INCLUDE_BOSSES = false
local frozenZombies = {}
-- Create FOV circle for aimbot
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)
LocalPlayer.CharacterAdded:Connect(function(newCharacter)
Character = newCharacter
HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
end)
function getCloseZombies(maxDistance, includeBosses)
local zombies = workspace.OtherWaifus:GetChildren()
local closeZombies = {}
-- Add boss zombies if enabled
if includeBosses then
for _, boss in pairs(workspace.Waifus:GetChildren()) do
table.insert(zombies, boss)
end
end
for _, zombie in pairs(zombies) do
if zombie:FindFirstChild("HumanoidRootPart") and
zombie:FindFirstChild("Zombie") and
zombie.Zombie.Health > 0 then
local distance = (HumanoidRootPart.Position - zombie.HumanoidRootPart.Position).Magnitude
table.insert(closeZombies, {zombie = zombie, distance = distance})
end
end
-- Put closest zombies first
table.sort(closeZombies, function(a, b)
return a.distance < b.distance
end)
-- Only return zombies within range
local result = {}
for _, data in ipairs(closeZombies) do
if data.distance <= maxDistance then
table.insert(result, data.zombie)
end
end
return result
end
function findSafePosition(zombie)
if not zombie:FindFirstChild("HumanoidRootPart") then return nil end
local zombieHRP = zombie.HumanoidRootPart
local zombieCFrame = zombieHRP.CFrame
-- Use the custom distance setting
local behindPosition = zombieCFrame * CFrame.new(0, 0, AUTO_FARM_DISTANCE)
-- Make sure we're not too close to other zombies
local nearbyZombies = getCloseZombies(10, AUTO_FARM_INCLUDE_BOSSES)
for _, nearbyZombie in pairs(nearbyZombies) do
if nearbyZombie ~= zombie then
local distanceToNewPos = (behindPosition.Position - nearbyZombie.HumanoidRootPart.Position).Magnitude
if distanceToNewPos < 5 then
-- Move away from this zombie too
local awayVector = (behindPosition.Position - nearbyZombie.HumanoidRootPart.Position).Unit
behindPosition = CFrame.new(nearbyZombie.HumanoidRootPart.Position + awayVector * AUTO_FARM_DISTANCE)
end
end
end
return behindPosition
end
function teleportBehindZombies()
if not AUTO_FARM then return end
local closestZombies = getCloseZombies(AUTO_FARM_DISTANCE, AUTO_FARM_INCLUDE_BOSSES)
if #closestZombies == 0 then return end
local closestZombie = closestZombies[1]
if closestZombie then
local safePosition
if AUTO_FARM_BEHIND then
safePosition = findSafePosition(closestZombie)
else
safePosition = closestZombie.HumanoidRootPart.CFrame * CFrame.new(0, 0, -AUTO_FARM_DISTANCE)
end
if safePosition then
HumanoidRootPart.CFrame = safePosition
end
end
end
function freezeZombiesInFront()
if not AUTO_FARM_2 then
-- Reset all zombies back to normal when turning off
for zombie, _ in pairs(frozenZombies) do
if zombie:FindFirstChild("Zombie") then
zombie.Zombie.WalkSpeed = DEFAULT_WALKSPEED
end
end
frozenZombies = {}
return
end
local zombies = workspace.OtherWaifus:GetChildren()
if AUTO_FARM_2_INCLUDE_BOSSES then
for _, boss in pairs(workspace.Waifus:GetChildren()) do
table.insert(zombies, boss)
end
end
for _, zombie in pairs(zombies) do
if zombie:FindFirstChild("HumanoidRootPart") and zombie:FindFirstChild("Zombie") then
-- Let dead zombies go back to normal
if zombie.Zombie.Health <= 0 then
if frozenZombies[zombie] then
zombie.Zombie.WalkSpeed = DEFAULT_WALKSPEED
end
continue
end
-- Bring zombie to player
local frontPosition = HumanoidRootPart.CFrame * CFrame.new(0, 0, -AUTO_FARM_2_DISTANCE)
zombie.HumanoidRootPart.CFrame = frontPosition
-- Freeze it in place
zombie.Zombie.WalkSpeed = 0
frozenZombies[zombie] = true
end
end
-- Clean up the tracking list
for zombie, _ in pairs(frozenZombies) do
if not zombie:IsDescendantOf(workspace) or
not zombie:FindFirstChild("Zombie") or
zombie.Zombie.Health <= 0 then
if zombie:FindFirstChild("Zombie") then
zombie.Zombie.WalkSpeed = DEFAULT_WALKSPEED
end
frozenZombies[zombie] = nil
end
end
end
function freezeZombiesInRange()
if not RANGE_FREEZE then
-- Unfreeze all zombies when toggle is off
for zombie, _ in pairs(frozenZombies) do
if zombie:FindFirstChild("Zombie") then
zombie.Zombie.WalkSpeed = DEFAULT_WALKSPEED
end
end
frozenZombies = {}
return
end
local zombies = workspace.OtherWaifus:GetChildren()
for _, zombie in pairs(zombies) do
if zombie:FindFirstChild("HumanoidRootPart") and zombie:FindFirstChild("Zombie") then
local distance = (HumanoidRootPart.Position - zombie.HumanoidRootPart.Position).Magnitude
-- Freeze zombies within range
if distance <= FREEZE_RANGE and zombie.Zombie.Health > 0 then
zombie.Zombie.WalkSpeed = 0
frozenZombies[zombie] = true
-- Unfreeze zombies outside range
elseif frozenZombies[zombie] then
zombie.Zombie.WalkSpeed = DEFAULT_WALKSPEED
frozenZombies[zombie] = nil
end
end
end
end
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 = workspace:FindPartOnRayWithIgnoreList(ray, ignoreList)
return hit == nil or hit:IsDescendantOf(part.Parent)
end
function GetClosestZombieToMouse()
local CLOSEST_ZOMBIE = nil
local CLOSEST_DISTANCE = math.huge
local CLOSEST_HEAD = nil
local MOUSE = game.Players.LocalPlayer:GetMouse()
local CAMERA = game.Workspace.CurrentCamera
-- Get all zombies
local zombies = workspace.OtherWaifus:GetChildren()
if AIMBOT_INCLUDE_BOSSES then
for _, boss in pairs(workspace.Waifus:GetChildren()) do
table.insert(zombies, boss)
end
end
for _, zombie in pairs(zombies) do
if zombie:FindFirstChild("Head") and zombie:FindFirstChild("Zombie") and zombie.Zombie.Health > 0 then
local head = zombie.Head
-- Always check visibility (removed the if VISIBLE_CHECK condition)
if not IsPartVisible(head) then
continue
end
local screenPoint = CAMERA:WorldToScreenPoint(head.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_ZOMBIE = zombie
CLOSEST_HEAD = head
end
end
end
end
return CLOSEST_ZOMBIE, CLOSEST_HEAD
end
-- Auto Farm 1
AutoFarm1Section:CreateToggle("Enabled", false, function(Value)
AUTO_FARM = Value
end)
AutoFarm1Section:CreateToggle("Behind", true, function(Value)
AUTO_FARM_BEHIND = Value
end)
AutoFarm1Section:CreateSlider("Distance", 5, 200, 50, true, function(Value)
AUTO_FARM_DISTANCE = Value
end)
AutoFarm1Section:CreateToggle("Target Bosses", false, function(Value)
AUTO_FARM_INCLUDE_BOSSES = Value
end)
-- Auto Farm 2
AutoFarm2Section:CreateToggle("Enabled", false, function(Value)
AUTO_FARM_2 = Value
end)
AutoFarm2Section:CreateSlider("Distance", 1, 50, 5, true, function(Value)
AUTO_FARM_2_DISTANCE = Value
end)
AutoFarm2Section:CreateToggle("Target Bosses", false, function(Value)
AUTO_FARM_2_INCLUDE_BOSSES = Value
end)
-- Add the new section controls
FreezeSection:CreateToggle("Range Freeze", false, function(Value)
RANGE_FREEZE = Value
end)
FreezeSection:CreateSlider("Freeze Range", 5, 100, 30, true, function(Value)
FREEZE_RANGE = Value
end)
-- Add Aimbot controls
local AimbotToggle = AimbotSection:CreateToggle("Enable Aimbot", false, function(Value)
AIMBOT_ENABLED = Value
end)
AimbotToggle:CreateKeybind("F")
local BossesToggle = AimbotSection:CreateToggle("Target Bosses", false, function(Value)
AIMBOT_INCLUDE_BOSSES = Value
end)
local ShowFOVToggle = AimbotSection:CreateToggle("Show FOV", false, function(Value)
FOVCircle.Visible = Value
end)
local FOVSlider = AimbotSection:CreateSlider("FOV Radius", 0, 800, 360, true, function(Value)
FOV_RADIUS = Value
FOVCircle.Radius = Value
end)
-- Load ESP Library
local ESP = loadstring(game:HttpGet("https://raw.githubusercontent.com/scar17off/scarhack/refs/heads/main/libraries/esp.lua"))()
-- Create ESP Sections
local PlayerSection = ESPTab:CreateSection("Player")
local ZombieSection = ESPTab:CreateSection("Zombie")
local AmmoSection = ESPTab:CreateSection("Ammo Boxes")
local VehicleSection = ESPTab:CreateSection("Cars")
-- Player ESP
PlayerSection:CreateToggle("Enable", false, function(Value)
ESP.Players = Value
ESP:Toggle(Value)
end)
PlayerSection:CreateToggle("Boxes", false, function(Value)
ESP.Boxes = Value
end)
PlayerSection:CreateToggle("Names", false, function(Value)
ESP.Names = Value
end)
PlayerSection:CreateToggle("Tracers", false, function(Value)
ESP.Tracers = Value
end)
-- Zombie ESP
ZombieSection:CreateToggle("Enable", false, function(Value)
ESP.Zombie = Value
end)
ESP:AddObjectListener(workspace.OtherWaifus, {
Type = "Model",
CustomName = function(obj) return obj.Name end,
Color = Color3.fromRGB(255, 0, 0),
IsEnabled = "Zombie"
})
-- Ammo Boxes ESP
AmmoSection:CreateToggle("Pistol Ammo", false, function(Value)
ESP.PistolAmmo = Value
end)
AmmoSection:CreateToggle("Shotgun Ammo", false, function(Value)
ESP.ShotgunAmmo = Value
end)
AmmoSection:CreateToggle("Rifle Ammo", false, function(Value)
ESP.RifleAmmo = Value
end)
ESP:AddObjectListener(workspace.AmmoBoxes, {
Name = "PistolAmmo",
CustomName = "Pistol Ammo",
Color = Color3.fromRGB(255, 255, 0),
IsEnabled = "PistolAmmo"
})
ESP:AddObjectListener(workspace.AmmoBoxes, {
Name = "ShotgunAmmo",
CustomName = "Shotgun Ammo",
Color = Color3.fromRGB(255, 128, 0),
IsEnabled = "ShotgunAmmo"
})
ESP:AddObjectListener(workspace.AmmoBoxes, {
Name = "RifleAmmo",
CustomName = "Rifle Ammo",
Color = Color3.fromRGB(255, 0, 0),
IsEnabled = "RifleAmmo"
})
-- Vehicle ESP
VehicleSection:CreateToggle("Black Convertible", false, function(Value)
ESP.BlackConvertible = Value
end)
VehicleSection:CreateToggle("Red Convertible", false, function(Value)
ESP.RedConvertible = Value
end)
VehicleSection:CreateToggle("White Convertible", false, function(Value)
ESP.WhiteConvertible = Value
end)
VehicleSection:CreateToggle("Helicopter", false, function(Value)
ESP.Helicopter = Value
end)
VehicleSection:CreateToggle("White Sedan", false, function(Value)
ESP.WhiteSedan = Value
end)
VehicleSection:CreateToggle("Humvee", false, function(Value)
ESP.Humvee = Value
end)
ESP:AddObjectListener(workspace.Cars, {
Name = "Convertable (Black)",
CustomName = "Black Convertible",
Color = Color3.fromRGB(0, 0, 0),
IsEnabled = "BlackConvertible"
})
ESP:AddObjectListener(workspace.Cars, {
Name = "Convertable (Red)",
CustomName = "Red Convertible",
Color = Color3.fromRGB(255, 0, 0),
IsEnabled = "RedConvertible"
})
ESP:AddObjectListener(workspace.Cars, {
Name = "Convertable (White)",
CustomName = "White Convertible",
Color = Color3.fromRGB(255, 255, 255),
IsEnabled = "WhiteConvertible"
})
ESP:AddObjectListener(workspace.Cars, {
Name = "Helicopter",
CustomName = "Helicopter",
Color = Color3.fromRGB(0, 255, 0),
IsEnabled = "Helicopter"
})
ESP:AddObjectListener(workspace.Cars, {
Name = "Sedan(White)",
CustomName = "White Sedan",
Color = Color3.fromRGB(200, 200, 200),
IsEnabled = "WhiteSedan"
})
ESP:AddObjectListener(workspace.Cars, {
Name = "Humvee",
CustomName = "Humvee",
Color = Color3.fromRGB(50, 50, 50),
IsEnabled = "Humvee"
})
-- Initialize ESP
ESP:Toggle(false)
ESP.Players = false
ESP.Zombie = false
ESP.PistolAmmo = false
ESP.ShotgunAmmo = false
ESP.RifleAmmo = false
ESP.BlackConvertible = false
ESP.RedConvertible = false
ESP.WhiteConvertible = false
ESP.Helicopter = false
ESP.WhiteSedan = false
ESP.Humvee = false
-- Run the functions
RunService.RenderStepped:Connect(function()
teleportBehindZombies()
freezeZombiesInFront()
freezeZombiesInRange()
-- Update FOV circle position
if FOVCircle then
FOVCircle.Position = game:GetService("UserInputService"):GetMouseLocation()
end
-- Handle aimbot
if AIMBOT_ENABLED then
local _, TargetHead = GetClosestZombieToMouse()
if TargetHead then
local MOUSE = game.Players.LocalPlayer:GetMouse()
local CAMERA = game.Workspace.CurrentCamera
local targetPos = CAMERA:WorldToScreenPoint(TargetHead.Position)
local mousePos = Vector2.new(MOUSE.X, MOUSE.Y)
local moveVector = Vector2.new(
targetPos.X - mousePos.X,
targetPos.Y - mousePos.Y
)
mousemoverel(moveVector.X, moveVector.Y)
end
end
end)
-- Clean up FOV circle when GUI is closed
game:GetService("CoreGui").ChildRemoved:Connect(function(child)
if child.Name == "Zombie Farm" then
if FOVCircle then
FOVCircle:Remove()
end
end
end)
-- Settings
local SettingsTab = Window:CreateTab("Settings")
local GeneralSection = SettingsTab:CreateSection("General")
local GuiToggle = GeneralSection:CreateToggle("Toggle GUI", true, function(Value)
Window:Toggle(Value)
end)
GuiToggle:CreateKeybind("RightShift", function()
local guiWindow = game:GetService("CoreGui"):FindFirstChild("Zombie Farm")
if guiWindow then
local newState = not guiWindow.Main.Visible
GuiToggle:SetState(newState)
Window:Toggle(newState)
end
end)