Making an Air combo ender

Hello! I’m making a move that ends air combos by slamming the player downwards into the ground and making a crater effect under them but I’m facing an issue…

The tween is not even playing correctly even though I am deleting the body position responsible for holding the player in the air.

I am not even sure if using Tweenservice is viable for what I am doing but I cant think of anything else…

Any help is appreciated!!!

Video:

Code Snippet:

local parts = workspace:GetPartsInPart(hitbox, overlap)
local personHit

for i,v in pairs(parts) do
	if v.Parent:FindFirstChild("Humanoid") and personHit == nil then
		personHit = v.Parent
					
		local params = RaycastParams.new()
		params.FilterType = Enum.RaycastFilterType.Blacklist
		overlap.FilterDescendantsInstances = {character, hitbox, personHit}
					
		local destroyed = false
		if FFC(personHit.HumanoidRootPart, "AirCombo") then
			FFC(personHit.HumanoidRootPart, "AirCombo"):Destroy()
			destroyed = true
		else
			destroyed = true
		end
					
					
		repeat wait() until destroyed
		warn("destroyed aircombo")
					
		local under = workspace:Raycast(personHit.HumanoidRootPart.Position, Vector3.new(0,-100,0), params)
						
		if under then
			warn("under hit")
						
			local tween = tweenService:Create(personHit.HumanoidRootPart, TweenInfo.new(0.2), {CFrame = CFrame.new(under.Position+ Vector3.new(0,personHit.HumanoidRootPart.Size.Z + 1,0)) * CFrame.Angles(math.rad(90),0,0)})
			tween:Play()
			
		end
					
		local info = {
			punch = true,
			blockable = false,
			damage = 5,
			stun = 1,
		}

		TagHumanoid.Fire(character, v.Parent, info)
	end
end

this might work but im not fully sure this is actually what you want to achieve

if under then
	warn("under hit")
	personHit.HumanoidRootPart.Anchored = true
	
	-- tween code here
	
	spawn(function()
		wait(x) -- set time for your liking or completely delete this part of code
		if personHit then
			if personHit:FindFirstChild("HumanoidRootPart") then
				personHit.Anchored = false
			end
		end
	end)
end

I found the issue with the code, I accidentally called the wrong variable which made the raycast detect the character’s body parts, I changed overlap to params and it works fine now! thanks for replying

1 Like