You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
Is there a better way to check for what hit the hitbox -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
So far I’m using a while true loop and a for loop inside to loop through hitboxquery to check if parts.parent is a humanoid
local function loopCheck(PartCFrame, PartSize, QueryParams)
while task.wait(0.1) do
local HitBoxQuery = workspace:GetPartBoundsInBox(PartCFrame, PartSize, QueryParams)
for index, parts in pairs(HitBoxQuery) do
if parts.Parent:FindFirstChild("Humanoid") or parts.Parent.Parent:FindFirstChild("Humanoid") then
return parts.Parent
end
if tick() - LastHit > HITBOX_SPAWNDELAY then
return
end
end
end
end