this is a Heavy attack script and by that i mean when they want to finish a combo the player uses this attack and it should Knock the player back a few blocks but i have no idea how to go about this so any help would be appreciated heres the code
Enabled = true Combo = 1 script.Parent.OnServerEvent:connect(function(Player, Action, V1) local c = Player.Character if Enabled == false then return end if Action == "Combat" then Enabled = false if Combo == 1 then -- if player presses the button once the animation will play
local Track = Instance.new("Animation") Track.AnimationId = "rbxassetid://4804402067" local Anim = c.Humanoid:LoadAnimation(Track) Anim:Play() wait(0.5) -- this is the amount of time it takes for the animation to reach the punch i put this here so the damage would happen when the animation reaches the punch local Region = Region3.new(V1-Vector3.new(2,2,2),V1+Vector3.new(2,2,2)) local RTable = workspace:FindPartsInRegion3(Region, nil, 20) for i,v in pairs(RTable) do if v.Parent:findFirstChild("Humanoid") and v.Parent:FindFirstChild("Deb") == nil and v.Parent ~=c then local Deb = Instance.new("BoolValue", v.Parent) Deb.Name = "Deb" game.Debris:AddItem(Deb,0.2) v.Parent.Humanoid:TakeDamage(7)
--if want to insert the knock back here but i have little to no idea on how to go about this help please!!
end end end wait(0.2) Enabled = true end
end)