Im working on a pushing script where you can push other players and this is the server script for it,
it pushes the player you interact with (idrk how to explain the rest)
local pushReplicator = game.ReplicatedStorage.PushReplicator
pushReplicator.OnServerEvent:Connect(function(player, characterBeingPushed)
local humanoidRootPart: BasePart = characterBeingPushed:FindFirstChild("HumanoidRootPart")
if humanoidRootPart then
local forwardDirection = (humanoidRootPart.Position - player.Character:FindFirstChild("HumanoidRootPart").Position).Unit
local upwardDirection = Vector3.new(0, 1, 0)
local forwardStrength = 825 / 1.5
local upwardStrength = 450 / 1.5
local impulse = (forwardDirection * forwardStrength) + (upwardDirection * upwardStrength)
humanoidRootPart:ApplyImpulse(impulse)
print("Hello!")
end
end)
sorry if my post is very vague