What you should do is use CollectionService
to set tags to the player whenever he is doing a certain action. For example if the player is hit you could give him the tag Stunned
and check if he has the tag stunned in the fighting attack script so he can’t fight back for a moment.
local collectionService = game:GetService("CollectionService")
function attack(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
if collectionService:HasTag(char, "Stunned") then return end
-- run the code of the attack here
end
Remember, this is just a rough example of how you should approach it. Go learn about CollectionService
and make sure to manipulate tags in the server
.