I’ve been using region3 for quite awhile now. I recently made a hit detection for my powers using region3 and it worked perfectly fine until i used it for this…
The region doesn’t seem to detect anything
local Damage = function(HitBox, owner, Damage)
local Region = Region3.new(HitBox.Position - (HitBox.Size/2), HitBox.Position + (HitBox.Size/2));
local Parts = workspace:FindPartsInRegion3WithWhiteList(Region, {workspace.Players, workspace.Enemies}, 200);
for i, v in pairs(Parts) do
print('a')
if v.Parent:FindFirstChild("Humanoid") then
local VicHum = v.Parent:FindFirstChild("Humanoid");
if v.Parent.Name ~= owner.Name then
VicHum:TakeDamage(Damage)
end
end
end
end
function Server_Detect(Player)
local Character = Player.Character;
local Root = Character.HumanoidRootPart;
local ServerPart = Instance.new("Part");
ServerPart.CanCollide = false;
ServerPart.Anchored = false
ServerPart.Size = Vector3.new(14,14,1000)
ServerPart.Transparency = 0
ServerPart.Parent = workspace.Debris;
ServerPart.Massless = true
local Weld = Instance.new("Weld")
Weld.Parent = ServerPart;
Weld.Part0 = ServerPart;
Weld.Part1 = Root;
Weld.C0 = CFrame.new(0,0,514)
game.Debris:AddItem(ServerPart, 3)
spawn(function()
repeat
wait(.1)
Damage(ServerPart, Player, 3)
until ServerPart.Parent == nil
end)
end
How would I fix this?