View difference between Paste ID: h5YkM484 and h5UsqxDu
SHOW: | | - or go back to the newest paste.
1-
Eduip ur sword or Hallow combat - Execute this:
1+
-- Equip your sword or Play Hallow Combat - Execute this:
2
3
4
local Player = game.Players.LocalPlayer
5
6
local Connections = {}
7
8
local function MakeConnection(Mob)
9
   if not Connections[Mob] and Mob:FindFirstChildOfClass("Humanoid") then
10
       local tbl = game.Players:GetPlayers()
11
       for i,v in pairs(tbl) do
12
           if Mob == v.Character then
13
               return
14
           end
15
       end
16
       Connections[Mob] = Mob.Humanoid:GetPropertyChangedSignal("Health"):Connect(function()
17
           for i = 1, 20 do
18
               Mob.Humanoid.Health = 0
19
           end
20
       end)
21
   end
22
end
23
24
for i,v in pairs(workspace:GetDescendants()) do
25
   local Hum = v:FindFirstChild("Humanoid")
26
   if Hum then
27
       MakeConnection(v)
28
   end
29
end
30
31
workspace.DescendantAdded:Connect(function(Child)
32
   local Hum = Child:FindFirstChild("Humanoid") or Child:WaitForChild("Humanoid", 10)
33
   if Hum then
34
       MakeConnection(Child)
35
   end
36
end)