DISCLAIMER: This is a Battlegrounds Combat System But not a normal one by any means.
So, Usually in Battlegrounds games. You have 4-5 M1’s, A Down slam and a Uptilt.
Games:
Videos:
Tutorials I Watched:
This. Is. Boring.
What if I give the mechanics Life? Make M1’s Great Again! Complicate the M1’s or just add more mechanics
Sooooo, Here we are! I have tried to make the logic gate for a system like this many many times but cant seem to fully understand how it even works.
How do you cycle through animations?
How do you detect downslam or uptilt?
How do you make Debounces for the M1’s and a cooldown after all 4 are done
How do you use os.clock to reset the combo if the player takes too long
How do you even detect enemy humanoids
How do you do server to client communication to differentiate diffrent moves like downslam, a normal m1 and a uptilt.
HOW HOW HOW HOW!
Hours upon Hours. I have spent trying to make a system. I get so close but it all just falls down. Crumbling upon my eyes.
Every second I wake. I curse this type of system. What a abomination!
Someone please help. I have watched all the tutorials there are. And I just want to understand what they’re even doing!
Truly, I have no idea what you’re asking for here. What’s an M1? What’s a not normal battlegrounds game like? What’s a down slam, and uptilt? We don’t all know the same things as you.
If you want, I can set up a time to call on discord. I’ve scripted a good amount of combat systems in the past and i’d be happy to help, within reason. Send a DM to swtorgamer21 on discord if interested.
I have the same offer, I could DM you some screenshots of how i script attacks and give you some tips and tricks, i don’t think i could type it all here.
Bovious on discord
Edit: I’m writing you a pm but still add me on discord for the screenshots
Usually, if the combat system is on the player, all the movements (even custom rigs like stands) of the player are already replicated to the server (as long as the rig is grouped under the player, at least from my experience). I would use remote events tho (and secure them)
To reset a combo, when a player does the first combo attack, use os.clock or tick(). Then, when they input again, check if the current os.clock - the combo1 os.clock is greater than a set number (example, 0.3). If so, advance the combo. If not, reset the combo.
local ComboTick
local MaxComboStreak = 3
local MaxComboTick = 0.7
local streak = 0
local function comboFunc()
if os.clock() - ComboTick >= MaxComboTick then
streak = 0
return end -- guard clause to make stuff look cleaner. Basically doesn't run the function if this is met, retrieving the opposite of an if statement that runs if the clause is met. But, we can also reverse the values. In this version, if the time between attacks is greater than 0.5, then it changes the comboval to 0, then stops the function. Therefore, exact same result, but less indentation which ultimately looks the function look cleaner.
if streak >= MaxComboStreak then
streak = 0
end
streak += 1
ComboTick = os.clock()
AttackFunc(streak)
end
Some parts may be incorrect or unclean, I’m writing this at school rn
well create a table with all animations stored, have some M1 number, Add +1 to that number for each call and table[M1] will return you that certain animation
How do you detect downslam or uptilt?
Downslam is detected by Raycast to the floor ( for the most precise results) Uptilt is detected by client, fire an extra boolean if this client is holding Spacebar
How do you make Debounces for the M1’s and a cooldown after all 4 are done
You have to figure that out yourself i have no idea of your coding style
How do you use os.clock to reset the combo if the player takes too long
It doesnt have to be os.clock its like just a way to keep a track of time. You can like do
local currM1 = M1Count -- you have to store and keep a track of it somewhere
task.spawn(function()
task.wait(3)
if currM1 == M1Count then
M1Count = 0
end
end)
How do you even detect enemy humanoids
Hitboxes? It will return a part that it found, you can do part.Parent:FindFirstChildOfClass(“Humanoid”)
How do you do server to client communication to differentiate diffrent moves like downslam, a normal m1 and a uptilt.
Send a remote on client M1 Input, If player is holding a spacebar - send some boolean in that remote to indicate Uptilt.
When it comes to downslam its gonna be dependant on the way you do it
One way is to check if the M1Count is equal to LAST M1 of your m1 chain, and send a raycast to the floor originating from a caster.
Second way would be more complicated, However do you really need it on your level of LUAU knowledge and like global programming understanding?