How do i fix this janky combo system?

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!

I want a combo system that gets faster when you land a hit, and has longer recovery if the attack is missed.

  1. What is the issue? Include screenshots / videos if possible!

its just overall really janky.

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

i tried searching for someone with the same problem, but i think this thing is really specific and i couldnt find anything that could help

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

UserInputService.InputBegan:Connect(function(Input,GameProcessed)
	if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.KeyCode == Enum.KeyCode.ButtonX then
		if State == "OnStance" then
			if ComboNumber == 1 then
				State = "Swinging"
				Character.Humanoid.WalkSpeed = 0
				--
				AttackNumber += 1
				local CurrentAttackNumber = AttackNumber
				local CurrentHitNumber1 = HitNumber
				--
				StopAllAnimations(LightStartup * 0.6)
				CombatRemoteEvent:FireServer("EnableSomething",Character.RightHand.Trail)
				AnimationTracks["LIGHT1"]:Play(LightStartup)
				task.wait(LightStartup)
				if CurrentAttackNumber ~= AttackNumber then return end
				Attack(Vector3.new(3,2,3),Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-2),"Light")
				Slide(10,0.2)
				task.wait(0.2)
				CombatRemoteEvent:FireServer("DisableSomething",Character.RightHand.Trail)
				if CurrentAttackNumber ~= AttackNumber then return end
				local CurrentHitNumber2 = HitNumber
				--
				if CurrentHitNumber1 == CurrentHitNumber2 then
					State = "Recovery"
					HitNumber = 0
					task.wait(LightRecovery)
					Character.Humanoid.WalkSpeed = WalkSpeed
					State = "OnStance"
				elseif CurrentHitNumber1 ~= CurrentHitNumber2 then
					ComboNumber = 2
					State = "OnStance"
					task.wait(0.2)
					if CurrentHitNumber2 == HitNumber then
						State = "Recovery"
						task.wait(LightRecovery)
						Character.Humanoid.WalkSpeed = WalkSpeed
						State = "OnStance"
					end
				end

			elseif ComboNumber == 2 then
				ComboNumber = 1
				State = "Swinging"
				Character.Humanoid.WalkSpeed = 0
				--
				AttackNumber += 1
				local CurrentAttackNumber = AttackNumber
				local CurrentHitNumber1 = HitNumber
				--
				StopAllAnimations(LightStartup)
				CombatRemoteEvent:FireServer("EnableSomething",Character.LeftHand.Trail)
				AnimationTracks["LIGHT2"]:Play(LightStartup * 0.6)
				task.wait(LightStartup)
				if CurrentAttackNumber ~= AttackNumber then return end
				Attack(Vector3.new(3,2,3),Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-2),"Light")
				Slide(10,0.2)
				task.wait(0.2)
				CombatRemoteEvent:FireServer("DisableSomething",Character.LeftHand.Trail)
				if CurrentAttackNumber ~= AttackNumber then return end
				local CurrentHitNumber2 = HitNumber
				--
				if CurrentHitNumber1 == CurrentHitNumber2 then
					State = "Recovery"
					HitNumber = 0
					task.wait(LightRecovery)
					Character.Humanoid.WalkSpeed = WalkSpeed
					State = "OnStance"
				elseif CurrentHitNumber1 ~= CurrentHitNumber2 then
					ComboNumber = 1
					State = "OnStance"
					task.wait(0.2)
					if CurrentHitNumber2 == HitNumber then
						State = "Recovery"
						task.wait(LightRecovery)
						Character.Humanoid.WalkSpeed = WalkSpeed
						State = "OnStance"
					end
				end
				
			end
		end
		--M2's>>>

this “Attack” function uses the GetPartsBoundInBox thingy, and when it finds a humanoid, it increases the “HitNumber” by one.

thats the full script of the m1’s, i tried many ways to fix it but it just got more janky
also, theyre kinda just the same thing but they play different animations so…yeah

i just want a way to fix the combo thing

2 Likes

Looks like it should be smoother … hard to test anything without the program.

i found kinda of a fix, but still, its still kinda janky, also, what do ya mean by smoother?

it looks fine to me … guess I’m not seeing the janky part.

the combo should just kinda stop if ya miss a hit as a punishiment, but it kinda just bugs out and gets faster and jankier.

im gonna close this topic cause a kinda of fixed it, thanks for trying to help too

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.