getgenv().Settings = {
Avoid = {}, -- Add Usernames inside strings like: "Player123" or 'Player321' and add a , whenever you're adding a second or third string/player.
AvoidFriends = false,
Attack_IShowSpeed = true,
Keybind = Enum.KeyCode.X
}
local Settings = getgenv().Settings
local punch = game:GetService("ReplicatedStorage"):WaitForChild("MainEvents") and game:GetService("ReplicatedStorage").MainEvents:WaitForChild("PUNCHEVENT")
local plrs = game:GetService("Players")
local lplr = plrs.LocalPlayer
local char = lplr.Character or lplr.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")
local uis = game:GetService("UserInputService")
lplr.CharacterAdded:Connect(function(character) char = character;hrp = character:WaitForChild("HumanoidRootPart"); end)
local ready = {}
local function setup(plr,char)
if plr == lplr then return end
local hum = char:WaitForChild("Humanoid")
local hrp = char:WaitForChild("HumanoidRootPart")
ready[plr] = {v_char = char,v_hum = hum,v_hrp = hrp,Field = false,Pvp = false,Teammates = false}
if Settings.Attack_IShowSpeed then
local folder = char.Parent
if folder:FindFirstChild("Speed") then
local speed_char = folder.Speed
local speed_hum = speed_char:WaitForChild("Humanoid")
local speed_hrp = speed_char:WaitForChild("HumanoidRootPart")
ready["IShowSpeed"..string.rep("0",math.random(20,25)):gsub(".",function() return tostring(math.random(0,9)) end)] = {v_char = speed_char,v_hum = speed_hum,v_hrp = speed_hrp,Field = false,Pvp = false,Teammates = false}
end
end
char.ChildAdded:Connect(function(obj)
if obj:IsA("ForceField") then
ready[plr].Field = true
end
if obj.Name == "PartyHighlight" then
ready[plr].Teammates = true
end
end)
char.ChildRemoved:Connect(function(obj)
if obj:IsA("ForceField") then
ready[plr].Field = false
end
if obj.Name == "PartyHighlight" then
ready[plr].Teammates = false
end
end)
local bbg = char:FindFirstChild("PVPOFFGUI")
if bbg then
local tl = bbg:FindFirstChild("TextLabel")
if tl then
ready[plr].Pvp = tl.Text == "PVP : OFF"
tl:GetPropertyChangedSignal("Text"):Connect(function()
ready[plr].Pvp = tl.Text == "PVP : OFF"
end)
end
end
end
plrs.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(plr_char)
setup(plr,plr_char)
end)
end)
plrs.PlayerRemoving:Connect(function(plr)
ready[plr] = nil
end)
for i,v in next,plrs:GetPlayers() do
if v.Character then
setup(v,v.Character)
end
v.CharacterAdded:Connect(function(plr_char)
setup(v,plr_char)
end)
end
local conn = true
uis.InputBegan:Connect(function(input,gp)
if gp then return end
if input.KeyCode == Settings.Keybind then
conn = not conn
end
end)
local c_char,c_hrp
local function closest()
local max = 1e5
for key,data in pairs(ready) do
if key ~= lplr then
for _,name in ipairs(Settings.Avoid) do if key.Name == name then continue end end
if Settings.AvoidFriends and lplr:IsFriendsWith(key.UserId) then continue end
local thrp = data.v_hrp
if thrp and not data.Teammates then
local dist = thrp.Position-hrp.Position
local current = dist:Dot(dist)
if current < max then
max = current
c_char = data.v_char
c_hrp = thrp
end
end
end
end
end
game:GetService("RunService").Heartbeat:Connect(function()
if not conn then return end
closest()
if c_char and c_hrp then
punch:FireServer(4,c_char,400,c_hrp)
end
end)This kill aura beats: https://scriptblox.com/script/School-Thugs-HALLOWEEN-FE-kill-aura-script-20266#google_vignette easily, it's not a challenge I was just bored. And you're code wasn't good enough for me.
1getgenv().Settings = {
2 Avoid = {}, -- Add Usernames inside strings like: "Player123" or 'Player321' and add a , whenever you're adding a second or third string/player.
3 AvoidFriends = false,
4 Attack_IShowSpeed = true,
5 Keybind = Enum.KeyCode.X
6}
7local Settings = getgenv().Settings
8local punch = game:GetService("ReplicatedStorage"):WaitForChild("MainEvents") and game:GetService("ReplicatedStorage").MainEvents:WaitForChild("PUNCHEVENT")
9local plrs = game:GetService("Players")
10local lplr = plrs.LocalPlayer
11local char = lplr.Character or lplr.CharacterAdded:Wait()
12local hrp = char:WaitForChild("HumanoidRootPart")
13local uis = game:GetService("UserInputService")
14lplr.CharacterAdded:Connect(function(character) char = character;hrp = character:WaitForChild("HumanoidRootPart"); end)
15local ready = {}
16local function setup(plr,char)
17 if plr == lplr then return end
18 local hum = char:WaitForChild("Humanoid")
19 local hrp = char:WaitForChild("HumanoidRootPart")
20 ready[plr] = {v_char = char,v_hum = hum,v_hrp = hrp,Field = false,Pvp = false,Teammates = false}
21 if Settings.Attack_IShowSpeed then
22 local folder = char.Parent
23 if folder:FindFirstChild("Speed") then
24 local speed_char = folder.Speed
25 local speed_hum = speed_char:WaitForChild("Humanoid")
26 local speed_hrp = speed_char:WaitForChild("HumanoidRootPart")
27 ready["IShowSpeed"..string.rep("0",math.random(20,25)):gsub(".",function() return tostring(math.random(0,9)) end)] = {v_char = speed_char,v_hum = speed_hum,v_hrp = speed_hrp,Field = false,Pvp = false,Teammates = false}
28 end
29 end
30 char.ChildAdded:Connect(function(obj)
31 if obj:IsA("ForceField") then
32 ready[plr].Field = true
33 end
34 if obj.Name == "PartyHighlight" then
35 ready[plr].Teammates = true
36 end
37 end)
38 char.ChildRemoved:Connect(function(obj)
39 if obj:IsA("ForceField") then
40 ready[plr].Field = false
41 end
42 if obj.Name == "PartyHighlight" then
43 ready[plr].Teammates = false
44 end
45 end)
46 local bbg = char:FindFirstChild("PVPOFFGUI")
47 if bbg then
48 local tl = bbg:FindFirstChild("TextLabel")
49 if tl then
50 ready[plr].Pvp = tl.Text == "PVP : OFF"
51 tl:GetPropertyChangedSignal("Text"):Connect(function()
52 ready[plr].Pvp = tl.Text == "PVP : OFF"
53 end)
54 end
55 end
56end
57plrs.PlayerAdded:Connect(function(plr)
58 plr.CharacterAdded:Connect(function(plr_char)
59 setup(plr,plr_char)
60 end)
61end)
62plrs.PlayerRemoving:Connect(function(plr)
63 ready[plr] = nil
64end)
65for i,v in next,plrs:GetPlayers() do
66 if v.Character then
67 setup(v,v.Character)
68 end
69 v.CharacterAdded:Connect(function(plr_char)
70 setup(v,plr_char)
71 end)
72end
73local conn = true
74uis.InputBegan:Connect(function(input,gp)
75 if gp then return end
76 if input.KeyCode == Settings.Keybind then
77 conn = not conn
78 end
79end)
80local c_char,c_hrp
81local function closest()
82 local max = 1e5
83 for key,data in pairs(ready) do
84 if key ~= lplr then
85 for _,name in ipairs(Settings.Avoid) do if key.Name == name then continue end end
86 if Settings.AvoidFriends and lplr:IsFriendsWith(key.UserId) then continue end
87 local thrp = data.v_hrp
88 if thrp and not data.Teammates then
89 local dist = thrp.Position-hrp.Position
90 local current = dist:Dot(dist)
91 if current < max then
92 max = current
93 c_char = data.v_char
94 c_hrp = thrp
95 end
96 end
97 end
98 end
99end
100game:GetService("RunService").Heartbeat:Connect(function()
101 if not conn then return end
102 closest()
103 if c_char and c_hrp then
104 punch:FireServer(4,c_char,400,c_hrp)
105 end
106end)