Well it works on singleplayer. Now to test with a local server. This’ll take a minute or two.
Sadly, it didn’t. I guess I’ll stick to LinearVelocity, cause it works with both dummies and players.
Oh well, LinearVelocity is a solid option indeed.
Yeah, before I was just using .Velocity which was deprecated. Only problem I have is that for like a second or two the dummy/player floats in the air like they’re Jesus or something rather than falling back down.
Are you setting the assembly linear velocity on the server or the client? The property isn’t replicated so setting that property on the server for an assembly that is owned by the client (ie the character) won’t have any effect. You would have to set the assemblylinearvelocity on the client
Yeah, but how would I do that in a module? Using a remotefunction? I’m confused whether I should do knockback with the server or on the client.
Edit: I’m gonna rework the combat system. Cause if one thing doesn’t work everything after that won’t as well.
In this link/solution, i provided someone with some code how AssemblyLinearVelocity works How To Use AssemblyLinearVelocity? - #2 by BobbieTrooper
And the best thing u could do is to calculate the knockback on the server, for security reasons but also because you have full control.
And u could use client-sided codes to create a smooth animation and effects.
If necessary, temporarily transfer network ownership of the player’s character to the server during the knockback calculation to ensure accuracy: Network Ownership | Documentation - Roblox Creator Hub
Also use RemoteEvents to communicate knockback information between the server and clients.
So do I say:
Character:SetNetworkOwnership(Nil)
-- Set NetworkOwnership to server temporarily
player.Character.HumanoidRootPart:SetNetworkOwner(nil)
-- Knockback code
-- Return player to client ownership
player.Character.HumanoidRootPart:SetNetworkOwner(player)
How would I make a stagger animation when the player uppercuts the opponent? I already have one. Just need to script it.
Well basically, just sent a signal to the client and play the animation there
I don’t really have expierence with animations tbf
Character:WaitForChild("HumanoidRootPart"):SetNetworkOwner(nil)
Humanoid.Parent:WaitForChild("HumanoidRootPart").AssemblyLinearVelocity = Character:WaitForChild("HumanoidRootPart").CFrame.lookVector * 60
task.wait(1)
Character:WaitForChild("HumanoidRootPart"):SetNetworkOwner(Player)
it’s not working or am i doing something wrong
This is on a serverScript right?
if Yes, great, also
local humanoidRootPart = Character:WaitForChild("HumanoidRootPart")
humanoidRootPart:SetNetworkOwner(nil)
humanoidRootPart.AssemblyLinearVelocity = humanoidRootPart.CFrame.LookVector* 200
task.wait(1)
humanoidRootPart:SetNetworkOwner(Player)
If you want to player to launce upwards, u can use UpVector instead of LookVector
I’ve gotta go. See you. I’ll try this out later.
My only option is to fire a RemoteEvent from the ModuleScript on the Server to the Client and add the velocity from their with the parameters passed.
Actually, the main reason it doesn’t work is because the applied velocity barely moves the character. The character doesn’t flinch applying this amount of velocity.
Okay, I’ll try that. Also, I have like 4 Remotefunctions just for one combo. Is there any more convenient way?
Thank you so much! It works!
This actually worked, but note I had to change the NetworkOwner to the parent of the Humanoid that was being attacked. Not the player who was attacking.
Humanoid.Parent:WaitForChild("HumanoidRootPart"):SetNetworkOwner(nil) -- Sets ownership to the server.
-- do damage and etc.
Humanoid.Parent:WaitForChild("HumanoidRootPart"):SetNetworkOwner(Player) -- Sets ownership to the client.
Edit: Considering that first, I had a RemoteFunction in the Client script, then fired it to the server, I tried firing it back to the client, but it kept printing “remote call disconnected”. This was in a module btw.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.