I made slimes with only 2 parts and the script works perfectly with them, r6 works alright, r15 kinda works, and rthro barely works. Why is this? It prints all the parts, but doesnt damage a lot of them.
while CircleSlash.IsPlaying==true and dosworddamage==true do
for i,target in pairs(game.Workspace:GetPartBoundsInBox(script.Parent.Parent.Blade.Hitbox.CFrame,script.Parent.Parent.Blade.Hitbox.Size)) do
if target.Parent:FindFirstChild("Humanoid") and target.Parent.Humanoid.Health>0 and not target:IsDescendantOf(player.Character) and target.Name=="HumanoidRootPart" then
for i,v in pairs(damaged) do
if target.Parent==v then
damagethis=false
end
end
if damagethis==true then
target.Parent.Humanoid:TakeDamage(20)
sound=script.Parent.Parent.Blade.Slice:Clone()
sound.Parent=script.Parent.Parent.Blade
sound:Play()
game.Debris:AddItem(sound,1)
table.insert(damaged,target.Parent)
end
end
end
task.wait()
end
table.clear(damaged)
damagethis=true
dosworddamage=true
player.Character.Humanoid.WalkSpeed=16
task.wait(.5)
db=false