How would I do something such as clashing? I’m trying to figure out, and after learning through remaking a working blocking, I’m sitting down questioning how I would make my clashing work, is it when two of the same parts hit at the same time, then boom there’s a clashing sequence or what?
( This is for a fighting game, not anime related really. )
Usually to make clashing, there will be too Boolean values in a player like
Player.AttackingClash.Value == true
if Player.AttackingClash.Value == true and EnemyPlayer.AttackingClash.Value == true then
-- Clash script
end
You’ll want a few more value like if the player is already clashing, but this is the basic concept. Depending on how you want the clash you’ll have to change things, for example, if you want a clashing sequence you’ll need to work with firing to there clients and sending values back to the server after the clashing to see who wins.
^ sorry for the large explanation, if you need me to explain anything, you can ask.
The Clash values are true when the player is able to clash, so lets say both the players are attacking
The attacking value will be true while they are attacking and it’ll check if it hits the player if that player was attacking also.
No, the attacking value will be either in a folder in the Player or you can have the value in the character, they’ll always exist and they’ll be true when attacking and be false when not.
So as a recap, When Player attacks making the attacking value “true”, if a player attacks a character, and that player was also attacking, then both attacking values will be true, creating a clash between each other.
You can change the attacking value to be a Number Value, and if both the players attacking numbers are the same they’ll clash
Player.Attacking.Value = math.Random(1,3)
if Player.Attacking.Value ~= nil and EnemyPlayer.Attacking.Value ~= nil then -- Checks if they both are attacking
if Player.Attacking.Value == EnemyPlayer.Attacking.Value then -- Checks if the numbers are the same
end
end
and yes, that’s what I was saying.
So Instead “true” would be a number and “false” would be nil
Ah… Then that’s where it gets confusing. The functionality/range of the Number’s would differ instead? Like say if it was a 1 chance that the clash happens, only two numbers would count for being false?
so like
1 = true
50 = false
2-49 = a chance to clash
16 = the actual clashing value?
But wouldn’t the numbers change so much that false and trues functionally wouldn’t be able to work?
Sorry, I may of confused you. If any number is in the value it will be considered true, but if your attacking number is the same as the other opponents attacking value then the clashing will happen
so… if you had a math.Random(1,3), then it’s a 1/3 chance that the clash might happen. Since the chances for both numbers to be the same, aka.