local Remote = game:GetService(“ReplicatedStorage”).RemoteEvent
local Ts =game:GetService(“TweenService”)
local RS = game:GetService(“RunService”)
Remote.OnServerEvent:Connect(function(plr)
local Char = plr.Character
local Hum = Char:WaitForChild("Humanoid")
local Hrp = Char:WaitForChild("HumanoidRootPart")
local Tpart = Instance.new("Part",workspace)
Tpart.Anchored =true
Tpart.CanCollide =false
Tpart.CFrame = Hrp.CFrame * CFrame.new(0,0,-70)
Tpart.Size = Vector3.new(1,1,1)
local TS1 = Ts:Create(Hrp,TweenInfo.new(1),{CFrame = Tpart.CFrame})
local marker = Instance.new("Part",workspace)
marker.Size = Vector3.new(1,1,1)
marker.Color = Color3.new(1, 0, 0)
marker.Transparency = .5
marker.Material = Enum.Material.Neon
local weld = Instance.new("Weld",Hrp)
weld.Part0 = Hrp
weld.Part1 = marker
weld.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame)
for i,v in pairs(workspace:GetChildren()) do
if v ~= nil and v:FindFirstChild("Humanoid") and v.Name ~= plr.Name then
local c = v
local mag = (Tpart.Position - c.HumanoidRootPart.Position).magnitude
local TS2 = Ts:Create(Hrp,TweenInfo.new(1),{CFrame = c.HumanoidRootPart.CFrame})
local mag2 = (c.HumanoidRootPart.Position - plr.Character.HumanoidRootPart.Position).magnitude
local mag3 = (c.HumanoidRootPart.Position - marker.Position).magnitude
if mag <= 40 then
TS2:Play()
print("1")
wait(.6)
if mag3 <= 20 then
Hum.Health = -1
end
local connection
print("2")
connection = RS.Heartbeat:Connect(function()
print("3")
if mag3 <= 20 then
wait()
print("hello")
TS2:Pause()
coroutine.resume(coroutine.create(function()
delay(2,function()
if connection then
connection:Disconnect()
end
end)
end))
end
end)
end
end
end
end)