Everything is tagged correctly, and i want it to also kill them if they are withing 5 studs of me I am only giving the chunk with the ray of my code.
ray = Ray.new(char.Torso.Position,Vector3.new(5,5,5))
coroutine.resume(coroutine.create(function()
while wait() do
if pent.Parent == game.Workspace then
hit = Workspace:FindPartOnRay()
print(hit.Name)
if hit and hit.Parent:findFirstChild("Humanoid") then
hit.Humanoid.Health = 0
end
end
end
end))
