Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script.Parent.Push.OnServerEvent:Connect(function(player, toPush)
- local playerRoot = player.Character:FindFirstChild("HumanoidRootPart")
- local pushRoot = toPush:FindFirstChild("HumanoidRootPart")
- if(playerRoot and not playerRoot:FindFirstChild("PushF") and pushRoot and not pushRoot:FindFirstChild("PushF") and (playerRoot.Position - pushRoot.Position).magnitude <= 10) then
- local pushF = Instance.new("BodyVelocity")
- pushF.Name = "PushF"
- pushF.MaxForce = Vector3.new(1000000, 1000000, 1000000)
- pushF.Velocity = (-pushRoot.CFrame.lookVector) * 110
- pushF.Parent = pushRoot
- wait(0.3)
- pushF:Destroy()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement