#Need help with my hitbox
9 messages · Page 1 of 1 (latest)
local part = Instance.new('Part')
local RedHitBox = game.ReplicatedStorage.SpaceEyeshitbox
local SpaceEyes = game.Workspace.SpaceEyes2
local size = Vector3.new(4, 5.56, 36.55)
local cf = CFrame.new(SpaceEyes.Position)
part.Anchored = true
part.CanCollide = false
part.CanQuery = false
part.CanTouch = false
part.CFrame = cf
part.Orientation = SpaceEyes.Orientation
part.Size = size
part.Transparency = 0.5
part.Parent = game.workspace
local params = OverlapParams.new()
params.FilterDescendantsInstances = {part}
function DeletePart()
part:Destroy()
end
while true do
local hitCharacters = {}
local parts = workspace:GetPartBoundsInBox(cf, size, params)
for i, part in pairs(parts) do
if part.Parent:FindFirstChild("Humanoid") and not table.find(hitCharacters, part.Parent) then
table.insert(hitCharacters, part.Parent)
part.Parent:FindFirstChildOfClass("Humanoid"):TakeDamage(15)
params:AddToFilter(hitCharacters)
print(hitCharacters)
table.clear(hitCharacters)
wait(0.1)
game.Workspace.part:Destroy()
DeletePart()
end
end
print(hitCharacters)
params:AddToFilter(hitCharacters)
wait(2)
end
do u even need a function for deleting the part, just do part:Destroy(), any why is there game.Workspace.part:Destroy() if the function allraedy destroys
the part wont destroy though
** You are now Level 3! **