✓ Accepted answer
I will suggest you use these five tips :
use .Touched, make the player hitbox bigger to make up for the delay, use transition animations. also try making a cooldown animation, moar particle effects to hide the bad animations.
try using delays in the function , use raycasting to find who you're hitting, try making a level system to make it better, for smoothness try making the place as NOT laggy it can get. for the delay, make it so its 1/2 of the move use time.
try making a priority system to let the system run smoother, like this one:
local priority = nil
local punch = 1
local block = 5
local kick = 10
function determine(punch,kick,block)
punch = punch + 2
kick = kick*kick
block = block + block
if (punch >= kick && kick >= block)
// do what you want to do
punch = 1
end
if (punch >= kick && kick >= block)
// do what you want to do
punch = 1
end
if (punch >= kick && kick >= block)
// do what you want to do
punch = 1
end
end
4.try computing how much time do you need to do the move, and make the animation that long.try using a tiny block that tracks where the hand is at( or foot ),that kills anyone that touches it except the LocalPlayer.
5.make a hurt hitbox for every move,if anyone except the LocalPlayer touches it,it hurts them.
as incapaz stated above:" you could check if the part that touched it and if the attacker then take damage. and a bool value in the attacker that is set to true when the animation is set".
2 comments
I am not sure on how to answer this question, I just use .Touched combined with a cooldown that checks if the player has been punched already, I'm sure there are better ideas though and I'd love to hear them
you could check if the part that touched it and if the attacker then take damage. and a bool value in the attacker that is set to true when the animation is set