How do I make air combo for my melee?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    https://gyazo.com/1ab0ffd6c8d7e32ae21ab9e69802691b

I want to make air combo, when the player hold space while punching, at the 5 hit the player and enemy character both gets lift up

  1. What is the issue? Include screenshots / videos if possible!
    this is what I made currently
    https://gyazo.com/1d88cd802becf443dab0497d58fe3f23

It does not lift in the same time, and I cant figure out how to make it float for a short amount of time in the air after the lift, sometimes i couldnt even finish my combo and the player and the enemy character falls down

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I have tried to make it create the 2 body velocities at the same time
searched on devforum about floating players
found 2 posts about this topic and was absolutely useless

server script

	if aircombo then
		--play tilt animation
		--velocity up 
		--evelocity up
		
		local punchanimationloader = player.Character.Humanoid.Animator:LoadAnimation(script.Parent.Animations.Uptilt)
		punchanimationloader:Play(0.3)
		coroutine.wrap(function()
			repeat task.wait() until player.Character:GetAttribute("Stunned") == true
			punchanimationloader:Stop()
		end)()
		
		
		local velocityUp = Instance.new("BodyVelocity",player.Character.HumanoidRootPart)
		velocityUp.MaxForce = Vector3.new(0,math.huge,0)
		velocityUp.Velocity = Vector3.new(0,20,0)
		game.Debris:AddItem(velocityUp,1)
		local EnvelocityUp = Instance.new("BodyVelocity",humanoid.Parent.HumanoidRootPart)
		EnvelocityUp.MaxForce = Vector3.new(0,math.huge,0)
		EnvelocityUp.Velocity = Vector3.new(0,20,0)
		game.Debris:AddItem(EnvelocityUp,1)
		
		
		ComboExtendEvent:FireClient(player)
		humanoid:LoadAnimation(RightStunAnimation):Play(0)


		local KickEffectClone = KickEffect.Attachment:Clone()
		KickEffectClone.Name = "KickEffect"
		KickEffectClone.Parent = humanoid.Parent.HumanoidRootPart
		player.Character.Humanoid.JumpPower = 0
		coroutine.wrap(function()
			repeat task.wait() until humanoid.Parent:GetAttribute("Stunned") == false		
			player.Character.Humanoid.JumpPower = 29.88
		end)()
		StunModule.Stun(humanoid,KickStunTime)
	else
	
	
		
		local newbodyvelocity = Instance.new("BodyForce")
		newbodyvelocity.Force = player.Character.HumanoidRootPart.CFrame.lookVector * KickForce
		newbodyvelocity.Parent = humanoid.Parent.HumanoidRootPart
		game.Debris:AddItem(newbodyvelocity,0.6)
		
		--[[local KnockLoader = KnockbackModule.new(humanoid.Parent,player.Character,5,0)
		KnockLoader:Construct()]]
		
		
		humanoid.Parent.RagdollTrigger.Value = true
		
		
		ComboExtendEvent:FireClient(player)

		
		
		local KickEffectClone = KickEffect.Attachment:Clone()
		KickEffectClone.Name = "KickEffect"
		KickEffectClone.Parent = humanoid.Parent.HumanoidRootPart


		humanoid:LoadAnimation(RightStunAnimation):Play(0)




		StunModule.Stun(humanoid,KickStunTime)
		
		
		player.Character.Humanoid.JumpPower = 0
		coroutine.wrap(function()
			repeat task.wait() until humanoid.Parent:GetAttribute("Stunned") == false		
			player.Character.Humanoid.JumpPower = 29.88
		end)()
		
		
		coroutine.wrap(function()
			wait(StunTime)
			humanoid.Parent.RagdollTrigger.Value = false
		end)()
	end

local script

elseif Check == 4 then
			
			if isHoldingJumpInput and humanoid:GetState() ~= Enum.HumanoidStateType.Freefall then
				KickLeftEvent:FireServer(isHoldingJumpInput)
				humanoid.WalkSpeed =PunchWalkSpeed
				script.Parent.Events.Cooldown:FireServer(true)
				coroutine.wrap(function()
					wait(Cooldown)
					if humanoid.Parent:GetAttribute("Stunned") == false then 

						humanoid.WalkSpeed =16
					end
				end)()
				print(Check)
				wait(Cooldown+0.3)
				script.Parent.Events.Cooldown:FireServer(false)
				timeSinceLastHit = tick()

				Check = 3
				Enable = true
			else
				local punchanimationloader = humanoid.Animator:LoadAnimation(Tool.Animations.HeavyKick)
				punchanimationloader:Play(0.3,1,PunchSpeed)
				coroutine.wrap(function()
					repeat task.wait() until script.Parent.Parent:GetAttribute("Stunned") == true
					punchanimationloader:Stop()
				end)()
				KickLeftEvent:FireServer(false)

				humanoid.WalkSpeed =PunchWalkSpeed

				script.Parent.Events.Cooldown:FireServer(true)

				coroutine.wrap(function()
					wait(Cooldown)
					if humanoid.Parent:GetAttribute("Stunned") == false then 

						humanoid.WalkSpeed =16
					end
				end)()


				print(Check)
				wait(2.8)
				script.Parent.Events.Cooldown:FireServer(false)

				timeSinceLastHit = tick()

				Check = 0
				Enable = true
			end
3 Likes

To make them come up at the same time or at least make the rise and descent more closer. I used :SetNetworkOwner() on the rootParts of attacker and target and made the attacking player the Owner.

As for the staying in the air part I would use BodyPosition (AlignPosition is better/not depreciated) and just make it so they rise 20 studs above current location and it should give the floating effect instead of just launching them up once and then letting them fall.

1 Like

but iā€™m pretty sure that would make the victim client laggy, is there anyway to fix that?

Probably a better way to implement this, but when somebody gets attacked I put like a tag inside their character (then use debris service on the tag to remove) and then in the StarterCharacter Scripts I have a server-script loop that looks for these tags. If it finds no tags then I do :GetNetworkOwner and if the owner is not the player itself to reset/set the owner back to the original player. So while being attacked your owned by the attacker, but once the stun/attack has ended the player gains control back in like .1 .25 seconds making it seem seamless.