Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Script
- script.Parent.Push.OnServerEvent:Connect(function(player,victim)
- local animation = script:WaitForChild('Animation')
- local humanoid = player.Character:WaitForChild('Humanoid')
- local anim = humanoid:LoadAnimation(animation)
- anim:Play()
- wait(1)
- if (victim.HumanoidRootPart.Position - player.Character.HumanoidRootPart.Position).magnitude <= 4.5 and (not player.Character:FindFirstChild("PushForce")) and (not victim:FindFirstChild("PushForce")) then
- local PushForce = Instance.new("BodyVelocity")
- PushForce.Name = "PushForce"
- PushForce.MaxForce = Vector3.new(10000000,10000000,10000000)
- PushForce.Velocity = (-victim.HumanoidRootPart.CFrame.lookVector) * 100
- PushForce.Parent = victim.HumanoidRootPart
- wait(0.5)
- PushForce:Destroy()
- end
- end)
- -- LocalScript
- local mouse = game.Players.LocalPlayer:GetMouse()
- script.Parent.Activated:Connect(function()
- if mouse.Target then
- local model = mouse.Target:FindFirstAncestorOfClass("Model")
- if model then
- if model:FindFirstChild("Humanoid") then
- script.Parent.Push:FireServer(model)
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement