I have this explosion hitbox using region3, when the player touches it, its supposed to deal 3 damage to them. But for some reason, the damage is more than 3, and keeps going up each time the player gets damage. I tried debounce, but that didn't seem to work. Can anyone help me?
local part = script.Parent
local region = Region3.new(part.Position - part.Size/2, part.Position + part.Size/2)
local db = false
while true do
if not db then
local parts = workspace:FindPartsInRegion3(region, part)
for i, part in pairs(parts) do
local char = part.Parent
local player = game.Players:GetPlayerFromCharacter(part.Parent)
if player then
char.Humanoid.Health -= 3
print(player.Name)
end
end
wait(1)
db = false
end
end

4 comments
Thanks for your help! I can't get GetPartBoundsInBox to work for the life of me, so I'll use region3 for the time being.
Well it turns out region3 doesn't even work for the use I had in mind. I have to switch to GetPartBoundsInBox. Sorry for wasting your time.
hmmmmmmmmmmmmmmmmmmm i guess if you beg me so much i might consider forgiving you.............
:sob: