-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.lua
More file actions
892 lines (788 loc) · 32.3 KB
/
Copy pathMain.lua
File metadata and controls
892 lines (788 loc) · 32.3 KB
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
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
_G.walkspeed = 25
_G.jumppower = 15
_G.autofarm_toggle = true
_G.autofarm_speed = 23
_G.autofarm_xp = true
_G.autofarm_safeplate = true
_G.switch_when_kicked = true
_G.autofarm_mode = 'move'
--SkiVillage_6v6
local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()
local HttpService = game:GetService("HttpService")
local TpService = game:GetService("TeleportService")
local mm2PlaceId = 142823291
local themes = {"Default","AmberGlow","Amethyst","Bloom","DarkBlue","Green","Light","Ocean","Serenity"}
local RS = game.ReplicatedStorage
local remotes = RS:WaitForChild("Remotes")
local gameplayRemotes = remotes:WaitForChild("Gameplay")
local plr = game.Players.LocalPlayer
local plrDataChangedRemote = gameplayRemotes:WaitForChild("PlayerDataChanged")
local coinsCollectedRemote = gameplayRemotes:WaitForChild("CoinCollected")
local roundStartedRemote = gameplayRemotes:WaitForChild("RoundStart")
local roleSelectRemote = gameplayRemotes:WaitForChild("RoleSelect")
if not _G.DefaultTheme then _G.DefaultTheme = "Default" end
--toggles and variables
if not _G.autofarm_toggle then _G.autofarm_toggle = false end
if not _G.autofarm_speed then _G.autofarm_speed = 22 end
if not _G.autofarm_xp then _G.autofarm_xp = false end
if not _G.walkspeed then _G.walkspeed = 16 end
if not _G.jumppower then _G.jumppower = 50 end
if not _G.esp then _G.esp = false end
if not _G.autofarm_safeplate then _G.autofarm_safeplate = false end
if not _G.autoswitch then _G.autoswitch = false end
if not _G.autoswitch_cooldown then _G.autoswitch_cooldown = 15 end
if not _G.switch_when_kicked then _G.switch_when_kicked = false end
if not _G.autofarm_mode then _G.autofarm_mode = 'move' end
_G.autofarm_cooldown = 0.05
_G.autofarm_done = false
_G.autograb_gun = false
_G.jump_counter = tick()
_G.autofarm_progresslock = false
_G.is_autofarming = false
local plate = nil
local supportPlate = Instance.new("Part",workspace)
supportPlate.Anchored = true
supportPlate.Transparency = 1
supportPlate.Size = Vector3.new(5,1,5)
local roundProfiles = {}
local role = "Innocent"
local ourCoins = 0
local collectedCoins = 0
local currentHauntTrack = false
local lastTouchedCoin = {}
local lastSwitchTrackTask = nil
local onRunTime = tick()
--configs
local function getCurrentMap()
for _,value in pairs(workspace:GetChildren()) do
if value:IsA("Model") and value:GetAttribute("MapID") and value:FindFirstChild("CoinContainer") then
return value
end
end
end
local function getFreshMap()
for _,value in pairs(workspace:GetChildren()) do
if value:IsA("Model") and value:GetAttribute("MapID") then
return value
end
end
end
local function getPlayerCharacter()
if plr.Character then
local char = plr.Character
if char:FindFirstChildWhichIsA("Humanoid") and char.PrimaryPart then
return char
else return nil end
else return nil end
end
local function getMurderer()
for _,player in game.Players:GetPlayers() do
if player then
if player.Character and roundProfiles[player.Name] and roundProfiles[player.Name].Dead == false and roundProfiles[player.Name].Role=="Murderer" then
return {player.Character,player}
end
end
end
return nil
end
local function getSheriff()
for _,player in game.Players:GetPlayers() do
if player then
if player.Character and roundProfiles[player.Name] and roundProfiles[player.Name].Dead == false and roundProfiles[player.Name].Role=="Sheriff" then
return {player.Character,player}
end
end
end
return nil
end
local function getCoin()
local map = getCurrentMap()
local char = getPlayerCharacter()
local coin = nil
local mur = getMurderer()
--remove
for i,coinee in pairs(lastTouchedCoin) do
if coinee and (not coinee:IsDescendantOf(workspace) or not coinee:FindFirstChild("CoinVisual")) then
table.remove(lastTouchedCoin,i)
end
end
if map and char then
local distance = math.huge
for _,e in map.CoinContainer:GetChildren() do
if e and e:FindFirstChild("CoinVisual") and e.CoinVisual.Transparency==0 and ((mur and (plr == mur[2] or (mur[1].PrimaryPart and (mur[1].PrimaryPart.Position-e.Position).Magnitude>30))) or not mur) and not table.find(lastTouchedCoin,e) then
--now sheriff check for mur
local sher = getSheriff()
if (sher and mur and mur[1] == plr and mur[1].PrimaryPart and (sher[1].PrimaryPart.Position-e.Position).Magnitude>30) or (not mur) or mur[1] ~= plr then
if (char.PrimaryPart.Position-e.Position).Magnitude < distance then
distance = (char.PrimaryPart.Position-e.Position).Magnitude
coin = e
end
end
end
end
end
if coin then
table.insert(lastTouchedCoin,coin)
end
return coin
end
local function teleportToLobby()
local char = getPlayerCharacter()
if char then
--time to make a safe plata
--local OldPos = map.Spawns:GetChildren()[math.random(1,#map.Spawns:GetChildren())].CFrame
--local Pos = OldPos * CFrame.new(0,50,0)
--plate = Instance.new("Part",map)
--plate.Size = Vector3.new(15,10,15)
--plate.Anchored = true
--plate.CanCollide = true
--plate.Position = Pos.Position-Vector3.new(0,6.5,0)
--char.PrimaryPart.CFrame = Pos
local lobby = workspace.Lobby
if lobby and char then
char.PrimaryPart.CFrame = lobby.Spawns:GetChildren()[math.random(1,#lobby.Spawns:GetChildren())].CFrame * CFrame.new(0,5,0)
char.PrimaryPart.AssemblyLinearVelocity = Vector3.new(0, 0, 0)
char.PrimaryPart.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
end
end
end
local function SkidFling(TargetPlayer)
local Character = getPlayerCharacter()
local Humanoid = Character and Character:FindFirstChildOfClass("Humanoid")
local RootPart = Humanoid and Humanoid.RootPart
local TCharacter = TargetPlayer.Character
local THumanoid = TCharacter and TCharacter:FindFirstChildOfClass("Humanoid")
local TRootPart = THumanoid and THumanoid.RootPart
local THead = TCharacter and TCharacter:FindFirstChild("Head")
local Accessory = TCharacter and TCharacter:FindFirstChildOfClass("Accessory")
local Handle = Accessory and Accessory:FindFirstChild("Handle")
if Character and Humanoid and RootPart then
if RootPart.Velocity.Magnitude < 50 then
getgenv().OldPos = RootPart.CFrame
end
if THumanoid and THumanoid.Sit then
return
end
if THead then
workspace.CurrentCamera.CameraSubject = THead
elseif Handle then
workspace.CurrentCamera.CameraSubject = Handle
else
workspace.CurrentCamera.CameraSubject = THumanoid
end
if not TCharacter:FindFirstChildWhichIsA("BasePart") then
return
end
local function FPos(BasePart, Pos, Ang)
RootPart.CFrame = CFrame.new(BasePart.Position) * Pos * Ang
Character:SetPrimaryPartCFrame(CFrame.new(BasePart.Position) * Pos * Ang)
RootPart.Velocity = Vector3.new(9e7, 9e7 * 10, 9e7)
RootPart.RotVelocity = Vector3.new(9e8, 9e8, 9e8)
end
local function SFBasePart(BasePart)
local TimeToWait = 2
local Time = tick()
local Angle = 0
repeat
if RootPart and THumanoid then
if BasePart.Velocity.Magnitude < 50 then
Angle = Angle + 100
FPos(BasePart, CFrame.new(0, 1.5, 0) + THumanoid.MoveDirection * BasePart.Velocity.Magnitude / 1.25, CFrame.Angles(math.rad(Angle),0 ,0))
task.wait()
FPos(BasePart, CFrame.new(0, -1.5, 0) + THumanoid.MoveDirection * BasePart.Velocity.Magnitude / 1.25, CFrame.Angles(math.rad(Angle), 0, 0))
task.wait()
FPos(BasePart, CFrame.new(2.25, 1.5, -2.25) + THumanoid.MoveDirection * BasePart.Velocity.Magnitude / 1.25, CFrame.Angles(math.rad(Angle), 0, 0))
task.wait()
FPos(BasePart, CFrame.new(-2.25, -1.5, 2.25) + THumanoid.MoveDirection * BasePart.Velocity.Magnitude / 1.25, CFrame.Angles(math.rad(Angle), 0, 0))
task.wait()
FPos(BasePart, CFrame.new(0, 1.5, 0) + THumanoid.MoveDirection,CFrame.Angles(math.rad(Angle), 0, 0))
task.wait()
FPos(BasePart, CFrame.new(0, -1.5, 0) + THumanoid.MoveDirection,CFrame.Angles(math.rad(Angle), 0, 0))
task.wait()
else
FPos(BasePart, CFrame.new(0, 1.5, THumanoid.WalkSpeed), CFrame.Angles(math.rad(90), 0, 0))
task.wait()
FPos(BasePart, CFrame.new(0, -1.5, -THumanoid.WalkSpeed), CFrame.Angles(0, 0, 0))
task.wait()
FPos(BasePart, CFrame.new(0, 1.5, THumanoid.WalkSpeed), CFrame.Angles(math.rad(90), 0, 0))
task.wait()
FPos(BasePart, CFrame.new(0, 1.5, TRootPart.Velocity.Magnitude / 1.25), CFrame.Angles(math.rad(90), 0, 0))
task.wait()
FPos(BasePart, CFrame.new(0, -1.5, -TRootPart.Velocity.Magnitude / 1.25), CFrame.Angles(0, 0, 0))
task.wait()
FPos(BasePart, CFrame.new(0, 1.5, TRootPart.Velocity.Magnitude / 1.25), CFrame.Angles(math.rad(90), 0, 0))
task.wait()
FPos(BasePart, CFrame.new(0, -1.5, 0), CFrame.Angles(math.rad(90), 0, 0))
task.wait()
FPos(BasePart, CFrame.new(0, -1.5, 0), CFrame.Angles(0, 0, 0))
task.wait()
FPos(BasePart, CFrame.new(0, -1.5 ,0), CFrame.Angles(math.rad(-90), 0, 0))
task.wait()
FPos(BasePart, CFrame.new(0, -1.5, 0), CFrame.Angles(0, 0, 0))
task.wait()
end
else
break
end
until BasePart.Velocity.Magnitude > 500 or BasePart.Parent ~= TargetPlayer.Character or TargetPlayer.Parent ~= Players or not TargetPlayer.Character == TCharacter or THumanoid.Sit or Humanoid.Health <= 0 or tick() > Time + TimeToWait
end
workspace.FallenPartsDestroyHeight = 0/0
local BV = Instance.new("BodyVelocity")
BV.Name = "EpixVel"
BV.Parent = RootPart
BV.Velocity = Vector3.new(9e8, 9e8, 9e8)
BV.MaxForce = Vector3.new(1/0, 1/0, 1/0)
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated, false)
if TRootPart and THead then
if (TRootPart.CFrame.p - THead.CFrame.p).Magnitude > 5 then
SFBasePart(THead)
else
SFBasePart(TRootPart)
end
elseif TRootPart and not THead then
SFBasePart(TRootPart)
elseif not TRootPart and THead then
SFBasePart(THead)
elseif not TRootPart and not THead and Accessory and Handle then
SFBasePart(Handle)
else
return Message("Error Occurred", "Target is missing everything", 5)
end
BV:Destroy()
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated, true)
workspace.CurrentCamera.CameraSubject = Humanoid
repeat
RootPart.CFrame = getgenv().OldPos * CFrame.new(0, .5, 0)
Character:SetPrimaryPartCFrame(getgenv().OldPos * CFrame.new(0, .5, 0))
Humanoid:ChangeState("GettingUp")
table.foreach(Character:GetChildren(), function(_, x)
if x:IsA("BasePart") then
x.Velocity, x.RotVelocity = Vector3.new(), Vector3.new()
end
end)
task.wait()
until (RootPart.Position - getgenv().OldPos.p).Magnitude < 25
workspace.FallenPartsDestroyHeight = getgenv().FPDH
else
return
end
end
local function switchServer(cursor,time)
if not cursor then
--first try
local decoded = HttpService:JSONDecode(game:HttpGet("https://games.roblox.com/v1/games/"..tostring(mm2PlaceId).."/servers/0?sortOrder=1&excludeFullGames=true&limit=100"))
local nextPageCursor = decoded.nextPageCursor
print(nextPageCursor)
if nextPageCursor then
print("aaa...1")
switchServer(nextPageCursor,0)
return
end
elseif time <= 0 then
--second try
local decoded = HttpService:JSONDecode(game:HttpGet("https://games.roblox.com/v1/games/"..tostring(mm2PlaceId).."/servers/0?sortOrder=1&excludeFullGames=true&limit=100&cursor="..cursor))
local nextPageCursor = decoded.nextPageCursor
if nextPageCursor then
print("aaa...2")
switchServer(nextPageCursor,time+1)
return
end
else
---actually teleport
local decoded = HttpService:JSONDecode(game:HttpGet("https://games.roblox.com/v1/games/"..tostring(mm2PlaceId).."/servers/0?sortOrder=1&excludeFullGames=true&limit=100&cursor="..cursor))
local data = decoded.data
if data then
for _,serverInfo in pairs(data) do
if serverInfo.playing >= 2 and serverInfo.ping <= 250 then
--perfect
local serverId = serverInfo.id
TpService:TeleportToPlaceInstance(mm2PlaceId,serverId)
return
end
end
end
--if not success
switchServer()
end
TpService:Teleport(mm2PlaceId,plr)
end
local function startASwitchTrack()
if lastSwitchTrackTask then
coroutine.close(lastSwitchTrackTask)
end
lastSwitchTrackTask = coroutine.create(function()
Rayfield:Notify({
Title = "NotInfected Hub",
Content = "Starting to rejoin in ".._G.autoswitch_cooldown.." minutes!",
Duration = 4,
Image = 'syringe',
})
task.wait(_G.autoswitch_cooldown*60)
Rayfield:Notify({
Title = "NotInfected Hub",
Content = "Switching Server...",
Duration = 3,
Image = 'syringe',
})
switchServer()
end)
coroutine.resume(lastSwitchTrackTask)
end
local function toggleAutoSwitch(val)
_G.autoswitch = val
if val then
startASwitchTrack()
else
if lastSwitchTrackTask then
coroutine.close(lastSwitchTrackTask)
end
end
end
local function setAutoSwitchCooldown(val)
_G.autoswitch_cooldown = val
if _G.autoswitch then
startASwitchTrack()
end
end
local Window = Rayfield:CreateWindow({
Name = "NotInfected Hub (MM2 v2.0)",
Icon = "syringe",
LoadingTitle = "Disinfecting...",
LoadingSubtitle = "by ImNotInfected",
ShowText = "Hello :D",
Theme = _G.DefaultTheme,
ToggleUIKeybind = Enum.KeyCode.LeftAlt,
DisableRayfieldPrompts = false,
DisableBuildWarnings = false,
ConfigurationSaving = {
Enabled = true,
FolderName = "NotInfected",
FileName = "MM2"
},
Discord = {
Enabled = true,
Invite = "cQmpfdMnDf",
RememberJoins = true
},
KeySystem = false,
})
-----------------------------UI TIMEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
local HomeTab = Window:CreateTab("Home","lamp") --HHHHHHHHHHOOOOOOOOOOOOOOOMMMMMMMMMMMMMMMMMMMMMMEEEEEEEEEEEEEEEEEEEEEEEE
HomeTab:CreateSection("v2.0 Changelog (UI OVERHAUL) : ")
HomeTab:CreateLabel("* UI redesign (nah I just changed from kavo to rayfield)", "eye", Color3.fromRGB(248, 255, 0), false)
local PlayerTab = Window:CreateTab("Player", "user") --PPPPPPPPPPPPPPLLLLLLLLLAAAAAAAAAAAAAYYYYYYYYYYYYYYYYYYEEEEEEEEERRRRRR
PlayerTab:CreateSection("Universal")
PlayerTab:CreateToggle({
Name = "Auto Grab Gun",
CurrentValue = _G.autograb_gun,
Flag = "AGGun",
Callback = function(Value)
_G.autograb_gun = Value
end,
})
PlayerTab:CreateSlider({
Name = "Set WalkSpeed",
Range = {0, 25},
Increment = 1,
Suffix = "Speedz",
CurrentValue = _G.walkspeed,
Flag = "WalkSpeed",
Callback = function(Value)
_G.walkspeed = Value
end,
})
PlayerTab:CreateSlider({
Name = "Set JumpPower",
Range = {0, 100},
Increment = 1,
Suffix = "JPower",
CurrentValue = _G.jumppower,
Flag = "JPower",
Callback = function(Value)
_G.jumppower = Value
end,
})
PlayerTab:CreateSection("Teleport")
PlayerTab:CreateButton({
Name = "Teleport To Lobby",
Callback = teleportToLobby,
})
PlayerTab:CreateButton({
Name = "Teleport To Map",
Callback = function()
local map = getCurrentMap()
local char = getPlayerCharacter()
if map and char then
char.PrimaryPart.CFrame = map.Spawns:GetChildren()[math.random(1,#map.Spawns:GetChildren())].CFrame * CFrame.new(0,1,0)
char.PrimaryPart.AssemblyLinearVelocity = Vector3.new(0, 0, 0)
char.PrimaryPart.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
end
end,
})
local AutofarmTab = Window:CreateTab("Autofarm", "tractor") --AAAAAAAAAAUUUUUUUUTTTTTTTTTOOOOOOOOFAAAAAAAAAAAAAARRRRRRRRRRMMMMMMMMMMMMMMMMM
AutofarmTab:CreateSection("Autofarm")
AutofarmTab:CreateToggle({
Name = "Autofarm",
CurrentValue = _G.autofarm_toggle,
Flag = "AFarm",
Callback = function(Value)
_G.autofarm_toggle = Value
end,
})
AutofarmTab:CreateToggle({
Name = "Autofarm XP (Tries to end round quickly)",
CurrentValue = _G.autofarm_xp,
Flag = "AFarmXP",
Callback = function(Value)
_G.autofarm_xp = Value
end,
})
AutofarmTab:CreateToggle({
Name = "Autofarm Safe Plate",
CurrentValue = _G.autofarm_safeplate,
Flag = "AFarmSPlate",
Callback = function(Value)
_G.autofarm_safeplate = Value
end,
})
AutofarmTab:CreateSlider({
Name = "Set Autofarm Speed (recommended below 25)",
Range = {20, 28},
Increment = 1,
Suffix = "S/P",
CurrentValue = _G.autofarm_speed,
Flag = "AFarmSpeed",
Callback = function(Value)
_G.autofarm_speed = Value
end,
})
AutofarmTab:CreateDropdown({
Name = "Choose Autofarm mode",
Options = {"move","teleport"},
CurrentOption = {_G.autofarm_mode},
MultipleOptions = false,
Flag = "AMode",
Callback = function(Options)
_G.autofarm_mode = Options[1]
end,
})
AutofarmTab:CreateSection("Config")
AutofarmTab:CreateToggle({
Name = "Auto Switch Server",
CurrentValue = _G.autoswitch,
Flag = "ASwitch",
Callback = function(Value)
toggleAutoSwitch(Value)
end,
})
AutofarmTab:CreateSlider({
Name = "Set Autoswitch Duration",
Range = {1,20},
Increment = 1,
Suffix = "Minutes",
CurrentValue = _G.autoswitch_cooldown,
Flag = "ASwitchCooldown",
Callback = function(Value)
setAutoSwitchCooldown(Value)
end,
})
AutofarmTab:CreateToggle({
Name = "Switch Server when Kicked",
CurrentValue = _G.switch_when_kicked,
Flag = "ASwitchWhenKicked",
Callback = function(Value)
_G.switch_when_kicked = Value
end,
})
local statLabel = AutofarmTab:CreateLabel("Statistics : ","pill")
local MiscTab = Window:CreateTab("Misc","git-pull-request") --MISCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
MiscTab:CreateLabel("Script made by imnotinfected on discord","pill")
MiscTab:CreateButton(
{
Name = "Copy discord server link (thx🙏🍤)",
Callback = function()
setclipboard("https://discord.gg/xqRBN8a79Y")
end,
}
)
MiscTab:CreateDropdown({
Name = "Choose Theme",
Options = themes,
CurrentOption = {_G.DefaultTheme},
MultipleOptions = false,
Flag = "CTheme",
Callback = function(Options)
Window.ModifyTheme(Options[1])
end,
})
-- ITSSSSSSSSSSSSSSSS LLLLLLLLLLLOOOOOOOOOOOOOOOOOOOOOGGGGGGGGGGGGGGGGGIIIIIIIIIIIIICCCCCCCCCC time
local Stats = game:GetService("Stats")
local pingItem = Stats:WaitForChild("Network"):WaitForChild("ServerStatsItem"):WaitForChild("Data Ping")
pingItem.Destroying:Connect(function()
print("⚠️ Network stats destroyed — possible kick or disconnect.")
print(pingItem)
--kicked! Now try to rejoin
print("FUCK No")
if _G.switch_when_kicked then
switchServer()
end
end)
game.Players.PlayerRemoving:Connect(function()
if #game.Players:GetPlayers() <= 1 and _G.switch_when_kicked then
switchServer() ---HOP!
end
end)
local tsConnection
tsConnection = game:GetService("RunService").Heartbeat:Connect(function()
if (not pingItem:IsDescendantOf(game)) then
tsConnection:Disconnect()
print("FUCK No")
if _G.switch_when_kicked then
switchServer()
end
end
--time get set statistics
local capturedTime = tick()-onRunTime
local seconds
local hours
local minutes
seconds = capturedTime%3600
hours = (capturedTime-seconds)/3600
minutes = (seconds-(seconds%60))/60
seconds = seconds-(minutes*60)
seconds = math.ceil(seconds)
if #string.split(tostring(seconds),"") ==1 then
seconds = "0"..seconds
end
if #string.split(tostring(minutes),"") ==1 then
minutes = "0"..minutes
end
statLabel:Set("Statistics : "..collectedCoins.." Tokens in "..hours.."h "..minutes.."m "..seconds.."s")
local char = getPlayerCharacter()
if char then
char.Humanoid.WalkSpeed = _G.walkspeed
char.Humanoid.JumpPower = _G.jumppower
for _,v in pairs(char:GetDescendants()) do
if v:IsA("BasePart") then v.CanCollide = false end
end
--move the support plate
if _G.is_autofarming then
supportPlate.Position = char.PrimaryPart.Position-Vector3.new(0,supportPlate.Size.Y+1.25+char.Humanoid.HipHeight,0)
end
--autofarm xp time
if _G.autofarm_done and _G.autofarm_xp then
--either game ended or player collected full coins, so we need to check if game ended by checking murderer's existance
local murderer = getMurderer()
if murderer then
--get the amount of alive people first
local alives = 0
for _,v in pairs(roundProfiles) do
if v and not v.Dead then
alives= alives+1
end
end
if plr == murderer[2] then
--player IS THE MURDERER
--we try to simulate?
for _,player in pairs(game.Players:GetPlayers()) do
if player.Character and plr.Character.PrimaryPart and player~=plr then
local prim = player.Character.PrimaryPart
prim.CFrame = char.PrimaryPart.CFrame*CFrame.new(0,0,-0.95)
end
end
if plr.Backpack:FindFirstChild("Knife") then
char.Humanoid:EquipTool(plr.Backpack.Knife)
end
local knifeTool = char:FindFirstChild("Knife")
if knifeTool then
knifeTool:Activate()
end
elseif (alives==2 and roundProfiles[plr.Name] and roundProfiles[plr.Name].Dead == false) then
char.Humanoid.Health = 0
else
--murderer didnt die
SkidFling(murderer[2])
end
end
if getCurrentMap() and getCurrentMap().Name == "SkiVillage_6v6" then
--special case, this fucking shit wastes our time
for _,player in pairs(game.Players:GetPlayers()) do
if player.Character and plr.Character.PrimaryPart and player~=plr then
local prim = player.Character.PrimaryPart
prim.CFrame = char.PrimaryPart.CFrame*CFrame.new(0,0,-0.95)
end
end
if plr.Backpack:FindFirstChild("Knife") then
char.Humanoid:EquipTool(plr.Backpack.Knife)
end
local knifeTool = char:FindFirstChild("Knife")
if knifeTool then
knifeTool:Activate()
end
end
end
--autograb gun
local map = getCurrentMap()
if map then
if _G.autograb_gun and map:FindFirstChild("GunDrop") then
char.PrimaryPart.CFrame = map.GunDrop.CFrame
char.PrimaryPart.AssemblyLinearVelocity = Vector3.new(0, 0, 0)
char.PrimaryPart.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
end
end
end
end)
plr.CharacterAdded:Connect(function()
local murder = getMurderer()
if roundProfiles[plr.Name] and roundProfiles[plr.Name].Dead and murder and murder[2] ~= plr then
--died during playmatch, being killed by murd
if not currentHauntTrack then
currentHauntTrack = true
_G.autofarm_done = true
_G.autofarm_progresslock = true
repeat
task.wait()
until not getMurderer()
_G.autofarm_progresslock = false
currentHauntTrack = false
end
end
end)
coinsCollectedRemote.OnClientEvent:Connect(function(e,currentAmountOfCOins)
ourCoins = currentAmountOfCOins
collectedCoins=collectedCoins+1
end)
roundStartedRemote.OnClientEvent:Connect(function(e,newProf)
ourCoins = 0
roundProfiles = newProf
end)
plrDataChangedRemote.OnClientEvent:Connect(function(newProf)
roundProfiles = newProf;
print(getMurderer())
end)
roleSelectRemote.OnClientEvent:Connect(function(rrole)
ourCoins = 0
role = rrole
print(role)
--teleport if needed
if not _G.autofarm_safeplate then
return
end
teleportToLobby()
end)
if _G.autoswitch then
startASwitchTrack()
end
while task.wait(_G.autofarm_cooldown) do
if _G.autofarm_progresslock or (roundProfiles[plr.Name] and roundProfiles[plr.Name].Dead) then
_G.is_autofarming = false
continue
end
local succ,err = pcall(function ()
--autofarm
local char = getPlayerCharacter()
if char and _G.autofarm_toggle then
local vectorForce = char.PrimaryPart:FindFirstChild("AntiGravity")
if not vectorForce then
vectorForce = Instance.new("VectorForce")
vectorForce.Force = Vector3.new(0,workspace.Gravity * char.PrimaryPart.Mass,0)
vectorForce.RelativeTo = Enum.ActuatorRelativeTo.World
vectorForce.Name = "AntiGravity"
vectorForce.Parent = char.PrimaryPart
vectorForce.Enabled = false
end
local map = getCurrentMap()
if map then
if map.Name == "SkiVillage_6v6" then
_G.autofarm_done = true
else
local thisCoin = getCoin()
if ourCoins~=50 then
if thisCoin then
if _G.autofarm_mode == 'teleport' then
_G.autofarm_done = false
_G.is_autofarming = true
--teleport whoosh
char.PrimaryPart.CFrame = CFrame.new(thisCoin.Position-Vector3.new(0,-2.5,0))
char.PrimaryPart.AssemblyLinearVelocity = Vector3.new(0, 0, 0)
char.PrimaryPart.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
char.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
local setttt = tick()
repeat
task.wait()
until tick()-setttt>1 or ((not thisCoin:IsDescendantOf(game)) or tweenCompleted or thisCoin.CoinVisual.Transparency~=0) or (not map)
-- while getCoin() and (getCoin().Position-char.PrimaryPart.Position).Magnitude < 18 do
-- local thatCoin = getCoin()
-- local lolno = tick()
-- local tweenCompleted = false
-- local thisTween = game:GetService("TweenService"):Create(char.PrimaryPart,TweenInfo.new((thatCoin.Position-char.PrimaryPart.Position).Magnitude/_G.autofarm_speed,Enum.EasingStyle.Linear),{CFrame = thatCoin.CFrame*CFrame.new(0,-1.25,0)})
-- thisTween:Play()
-- local funConnect
-- funConnect = thisTween.Completed:Connect(function()
-- funConnect:Disconnect()
-- tweenCompleted = true
-- end)
-- repeat
-- task.wait()
-- until tick()-lolno>5 or ((not thatCoin:IsDescendantOf(game)) or tweenCompleted or thatCoin.CoinVisual.Transparency~=0) or (not map)
-- funConnect:Disconnect()
-- task.wait(_G.autofarm_cooldown)
-- end
task.wait(_G.autofarm_speed/40)
local lobby = workspace.Lobby
char.PrimaryPart.CFrame = lobby.Spawns:GetChildren()[math.random(1,#lobby.Spawns:GetChildren())].CFrame * CFrame.new(0,1,0)
char.PrimaryPart.AssemblyLinearVelocity = Vector3.new(0, 0, 0)
char.PrimaryPart.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
task.wait(_G.autofarm_speed/20)
elseif _G.autofarm_mode == 'move' then
_G.autofarm_done = false
_G.is_autofarming = true
vectorForce.Enabled = true
if (thisCoin.Position-char.PrimaryPart.Position).Magnitude > 320 then --or (thisCoin.Position.Y-char.PrimaryPart.Position.Y) > 25 then
char.PrimaryPart.CFrame = thisCoin.CFrame
char.PrimaryPart.AssemblyLinearVelocity = Vector3.new(0, 0, 0)
char.PrimaryPart.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
char.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
end
local lolno = tick()
local tweenCompleted = false
local thisTween = game:GetService("TweenService"):Create(char.PrimaryPart,TweenInfo.new((thisCoin.Position-char.PrimaryPart.Position).Magnitude/_G.autofarm_speed,Enum.EasingStyle.Linear),{CFrame = thisCoin.CFrame*CFrame.new(0,-1.25,0)})
thisTween:Play()
local funConnect
funConnect = thisTween.Completed:Connect(function()
funConnect:Disconnect()
tweenCompleted = true
end)
repeat
task.wait()
until tick()-lolno>5 or ((not thisCoin:IsDescendantOf(game)) or tweenCompleted or thisCoin.CoinVisual.Transparency~=0) or (not map)
funConnect:Disconnect()
if ourCoins~= 0 and ourCoins%10 == 0 and _G.autofarm_speed > 23 and ourCoins~=50 then
task.wait(2) --cooldown wait
end
end
end
else
vectorForce.Enabled = false
_G.is_autofarming = false
task.wait(1)
_G.autofarm_done = true
end
end
else
vectorForce.Enabled = false
_G.autofarm_done = false
_G.is_autofarming = false
end
else
if vectorForce then
vectorForce.Enabled = false
end
_G.autofarm_done = false
_G.is_autofarming = false
end
end)
if not succ then
print(err)
end
end