Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

A "Chain" Attack combo with Stun?

Asked by 4 years ago

I'm going to try and keep this very broad as it really depends on the person what you think a "Chain" attack combo with stun is.For my game,which has a combo system (Similar to Black Magic 2 on Roblox,or any other 2D Fighting games like Street Fighter,Blaz Blue,Under night inbirth,etc.) If you know these games really well you would know that when you are doing attacks you can combo them,and they would give the appropriate stun for the enemy,meaning that they cannot move or do anything else anymore.Now I do not need any help with the system of attacking,abilities or any other things.I'm currently wondering how a "Keep track of Stun" system would work.I'm saying that if you are doing the First attack of the Combo , for this i will call it AC (Attack Combo) and numbered from 1 - 4 as there are 4 parts to this attack combo.Each AC can be done by pressing a key,in my case I mapped it as "E".Meaning that you have to press E a number of 4 times in order to the attack.

For example, if i did AC 1 and it stunned the player,meaning they cannot move anymore.And i decided to do AC 2,they would not be unstunned from the AC 1 , and i would be able to continue with the AC 2 , and 3 and so on... What i'm trying to say in short is that.If I do my First attack and it stuns them for wait(5) and after the time has passed they would get their walkspeed back and their ability to attack.But I do not want this to happen while i'm doing the Second attack.Meaning that if they got stunned for the First attack and i continue with the Second attack the stun from the First attack would get cancelled,keeping the player unable to do anything (Stunned) .

I have managed to do a slight way of doing this,with a "DoingMoves" Bool value,but it appears that it's not always accurate,because at the end of the day, DoingMoves has to also get unchecked so that the player isn't always doing Moves,and that DoingMoves uncheck can override a certain combo the player is doing,similar to the Stun problem.

if player.Character.Condition.DoingMoves.Value == false and 
hit.Parent.Condition.Stunned.Value == true then   --The method i see if I can give Walkspeed to the enemy.
            Module.StopCurrentAnimation(hit.Parent)
            hit.Parent.Humanoid.AutoRotate = true
            hit.Parent.Condition.CanJump.Value = true
            hit.Parent.Condition.CanWalk.Value = true
            hit.Parent.Condition.Stunned.Value = false
            elseif player.Character.Condition.DoingMoves.Value == true and hit.Parent.Condition.Stunned.Value == true  then    -- If the player is DoingMoves and Stunned value is true it means that they are still doing a combo,or in this case, a "Chain"
            hit.Parent.Humanoid.AutoRotate = false
            hit.Parent.Condition.CanJump.Value = false
            hit.Parent.Condition.CanWalk.Value = false
            hit.Parent.Condition.Stunned.Value = true
            end

Answer this question