Push Players ability

  1. What do you want to achieve? I want the push players ability to be nice and smooth without any delays

  2. What is the issue? So I have a push players tool that works with a remote event, client to server. I want the ability to work smooth without that small delay at the start. Here’s a video of how it’s working at the moment: Push Players

  3. What solutions have you tried so far? I looked at some DevForum posts and they were all using BodyVelocity. I know that BodyVelocity is deprecated so I would need to use something else instead… But I don’t know what to use cause I want the player to be able to push the other player the same way the player is facing towards.
    sorry i gave you brain cancer reading this lmao

Client:

local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()

print('1')
Character.ChildAdded:Connect(function(Tool)
	print('2')
	if Tool:IsA("Tool") then
		print('3')
		Tool.Activated:Connect(function()
			print('4')
			local Force = Tool:GetAttribute("Force")
			local Head = Character:FindFirstChild("Head")
			local Mouse = LocalPlayer:GetMouse()
			local MouseTarget = Mouse.Target or nil
			if MouseTarget ~= nil then
				print('5')
				local HumanoidRootPart = MouseTarget.Parent:FindFirstChild("HumanoidRootPart") or MouseTarget:FindFirstChild("HumanoidRootPart")
				if HumanoidRootPart then
					if MouseTarget ~= Character:WaitForChild("HumanoidRootPart") then
						script:WaitForChild("Push"):FireServer(HumanoidRootPart, Head, Force)
					end
				end
			end
		end)
	end
end)
Server:

local Debris = game:GetService("Debris")

script.Parent:WaitForChild("Push").OnServerEvent:Connect(function(Player, HumanoidRootPart, Head, Force)
	local BodyVelocity = Instance.new("BodyVelocity")
	BodyVelocity.Parent = HumanoidRootPart
	BodyVelocity.Velocity = Head.CFrame.LookVector * (8 + Force)
	BodyVelocity.MaxForce = Vector3.new(30000, 0, 30000)
	Debris:AddItem(BodyVelocity, .5)
end)
1 Like

After watching the video, I’m not sure what you’re talking about. Could you elaborate further on what you mean by “without the delay at the start”?

Well, once I click on the character, it’s supposed to push the player instantly but there’s a small delay at the start. Would you like to maybe test it out?

I want the push ability to be just like in Crab Game. You can find videos of it on youtube.

Yes, I would like to test it out, as via video I can’t notice anything wrong.

Alright, I’ll tell the owner to publish the game as it’s not created by me. I’ll send you the link to the game once he’s done it.

1 Like

Have you also tried setting the NetworkOwner to nil?

:SetNetworkOwner(nil)

or setting it to the pushing player?

:SetNetworkOwner(PushingPlayer)