This is my first time on the dev-forum, so sorry if I don’t do things correctly!
I’ve been having a really annoying issue where my Hitboxes knockback don’t work on players but they still work on humanoids. I’ve tried a bunch of methods, checked with different players and character types but the only thing that does not work affect real players in my script is the knockback. I honestly don’t know how to fix this and have been looking through the dev-forum just to find nothing, and have even asked the roblox ai assistant (it was as useless as you would expect it to be). Here is the script part that does the knockback:
local function applyDamageToCharacter(humanoid, hrp, damage, knockback, vknockback, lookVector, attackerPlayer, emitStrikes, fireSpeedClient)
--
if humanoid:GetAttribute("Killer") == false or humanoid:GetAttribute("Invincible") == true then
return false
end
if emitStrikes then
STRIKES:emit(5)
end
-- res
local resistance = humanoid:GetAttribute("Resistance") or 1
humanoid:TakeDamage(damage * resistance)
-- knockback
hrp.AssemblyLinearVelocity = lookVector * knockback + Vector3.new(0, vknockback, 0)
if fireSpeedClient then
remotespeed:FireClient(attackerPlayer)
end
return true
end
Also, no errors occur when I do this. The entire script processes through.