Hi again I fixed this
Here’s the fix
wait(.2)
coroutine.resume(coroutine.create(function()
while Anim1.IsPlaying or Anim2.IsPlaying and RunService.Stepped:wait() do -- While the animation is playing and we wait for the next frame (Approx. 1/60th a second)
wait(.01)
Region = Region3.new(c.HumanoidRootPart.CFrame*CFrame.new(0,0,-2).p - Vector3.new(2,2,2),c.HumanoidRootPart.CFrame*CFrame.new(0,0,-2).p + Vector3.new(2,2,2)) -- region3 -- region3
RTable = workspace:FindPartsInRegion3(Region, nil, 20)
if run then
run = false
print("E")
break
end
for i,v in pairs(RTable) do
if v.Parent:findFirstChild("Humanoid") and v.Parent:findFirstChild("Deb") == nil and v.Parent ~= c then
run = true
end
end
end
for i,v in pairs(RTable) do
RTable = false
if v.Parent:findFirstChild("Humanoid") and v.Parent:findFirstChild("Deb") == nil and v.Parent ~= c then
v.Parent.Humanoid:TakeDamage(4)
local Deb = Instance.new("BoolValue", v.Parent)
Deb.Name = "Deb"
game.Debris:AddItem(Deb,0.2)
local S = Instance.new("Sound", v)
S.SoundId = "rbxassetid://131237241"
S.PlaybackSpeed = math.random(80,120)/100
S:Play()
local FX = Instance.new("Part", workspace.FX)
FX.Name = "CombatHit"
FX.Transparency = 0
FX.CanCollide = false
FX.Anchored = true
FX.Material = "ForceField"
FX.Color = Color3.new(1,0,0)
FX.Size = Vector3.new(1,1,1)
local SM = Instance.new("SpecialMesh", FX)SM.MeshType = "Sphere"
SM.Scale = Vector3.new(0,0,0)
FX.CFrame = v.Parent.HumanoidRootPart.CFrame*CFrame.new(math.random(-20,20)/10,math.random(-20,20)/10,math.random(-20,20)/10)
local BV = Instance.new("BodyVelocity", v)
BV.maxForce = Vector3.new(25000,25000,25000)
BV.Velocity = c.HumanoidRootPart.CFrame.lookVector*5
game.Debris:AddItem(BV,0.2)
end
end
end))