Here is my script:
local region = Region3.new(Vector3.new(script.Parent.Reg1.Position), Vector3.new(script.Parent.Reg2.Position))
while true do
wait()
local touching = game.Workspace:FindPartsInRegion3(region, 1000)
for i,v in pairs(touching) do
if v.Parent:FindFirstChild('Humanoid') and v.Parent:FindFirstChild("HInfect") then
local number = math.random(1,10)
if number == 1 then
v.Parent.HInfect:Destroy()
else
v.Parent.Humanoid:TakeDamage(v.Parent.Humanoid.Health)
end
end
end
end

1 comment
Thanks. Also for some reason it only gets the baseplate. Did I format the region3 wrong in the first line?