Exosuit Punch Knockback

Hey! Any idea on why my exosuit punch only knockbacks dummies, but not real players? I even tried setting the target’s HumanoidRootPart anchored value to false, but that didn’t help.

The code:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ContentProvider = game:GetService("ContentProvider")

ReplicatedStorage:WaitForChild("KillHumanoidEvent").OnServerEvent:Connect(function(firerPlayer, targetHumanoid, targetCharacter, sound, damage)
	local soundToLoad = {sound}
	ContentProvider:PreloadAsync(soundToLoad) -- Preloads the sound to prevent delay
	
	targetHumanoid:TakeDamage(damage) -- Makes the targetHumanoid take (Configuration > Damage) damage.
	sound:Play() -- Plays the hit sound
	
	targetCharacter.HumanoidRootPart.Velocity = firerPlayer.Character.HumanoidRootPart.CFrame.LookVector * 150
end)

Showcase video of the issue:

I don’t know if this would work, but can you set the networkOwner of the Hit player to the attacker’s Client?

The velocity value is not high enough: The line of code that sets the target’s velocity uses a value of 150. This might not be enough to noticeably knock back the player. You could try increasing the value to see if it has a greater effect.

The punch is missing the target’s HumanoidRootPart: It’s possible that the punch is not actually hitting the target’s HumanoidRootPart. Make sure that the punch is correctly aimed at the part that you want to knock back.

The player is immune to knockback effects: It’s also possible that the target player has some kind of immunity to knockback effects. This could be due to a game setting or a script that the player is running.

I hope these suggestions help you diagnose the issue!

1 Like

I have tried making the velocity value really high, but it didn’t help. I’m also pretty certain that the animation is making player hit another player directly into HumanoidRootPart. Therefore, I’m not really sure what to try more… Thanks for your help though!

You cannot set client’s velocity from server, because client has authority over his own character. You also can’t change player’s character network ownership to server, it doesn’t work.

Your only option here is to fire a remote event to the client, and add the velocity on the client itself (local script). There will of course be a noticeable delay depending on ping, but Roblox doesn’t give you much opportunities to mess with networking, there is always naturally gonna be a delay when there is communication between client and server.

P.S. you also cannot set server’s velocity from client. If you for example try to set a velocity of a part that is far away, from a local script, you will see that that part will also not move at all. When near it might work, because network ownership of workspace parts changes to the player when you move close enough.

Thank you :pray:Works perfectly now, I don’t even think there’s any delay.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.