Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Config = {
- Bind = Enum.KeyCode.Z,
- Select_Color = Color3.fromRGB(0, 255, 0),
- Prediction_Enable = true
- }
- local UserInputService = game:GetService("UserInputService")
- local RunService = game:GetService("RunService")
- local Players = game:GetService("Players")
- local Player = Players.LocalPlayer
- local Char = Player.Character
- local Mouse = Player:GetMouse()
- local Root = Char:WaitForChild("HumanoidRootPart")
- local Humanoid = Char:WaitForChild("Humanoid")
- local SelectionBox = Instance.new("SelectionBox", script)
- SelectionBox.Color3 = Config.Select_Color
- SelectionBox.LineThickness = 0.02
- local A_1 = false
- local A_2 = false
- UserInputService.InputBegan:Connect(function(Input, GPE)
- if GPE then return end
- if Input.KeyCode == Config.Bind then
- if A_2 == false then
- A_1 = not A_1
- SelectionBox.Adornee = nil
- end
- end
- end)
- Mouse.Move:Connect(function()
- if A_1 == true then
- if Mouse.Target then
- if Mouse.Target.Parent:FindFirstChildOfClass("Humanoid") then
- local Character = Mouse.Target.Parent
- SelectionBox.Adornee = Character
- else
- SelectionBox.Adornee = nil
- end
- else
- SelectionBox.Adornee = nil
- end
- end
- end)
- Mouse.Button1Down:Connect(function()
- if A_1 == true and A_2 == false then
- local Character = SelectionBox.Adornee
- if Character ~= nil then
- A_2 = true
- local BodyThrust = Instance.new('BodyGyro', Char.HumanoidRootPart)
- BodyThrust.CFrame = CFrame.Angles(math.huge, math.huge, math.huge)
- local LastPos = Char.HumanoidRootPart.CFrame
- while Char.HumanoidRootPart and Character.HumanoidRootPart do
- RunService.Heartbeat:Wait()
- if Character.HumanoidRootPart.Velocity.Magnitude <= 100 then
- if Config.Prediction_Enable then
- local Direction = Character.HumanoidRootPart.Position + (Character.Humanoid.MoveDirection * Character.Humanoid.WalkSpeed)/2 + (Vector3.new(0, Character.HumanoidRootPart.Velocity.Y/10, 0))
- Char.HumanoidRootPart.CFrame = (CFrame.new(Direction)) * Root.CFrame.Rotation
- else
- Char.HumanoidRootPart.CFrame = Character.HumanoidRootPart.CFrame * Root.CFrame.Rotation
- end
- Char.HumanoidRootPart.Velocity = Vector3.new()
- else
- break;
- end
- end
- BodyThrust:Destroy()
- Char.HumanoidRootPart.AssemblyLinearVelocity = Vector3.new()
- Char.HumanoidRootPart.AssemblyAngularVelocity = Vector3.new()
- Char.HumanoidRootPart.CFrame = LastPos
- Char.Humanoid:ChangeState(Enum.HumanoidStateType.Landed)
- end
- A_2 = false
- end
- end)
Advertisement
Comments
-
- Press Z to activate, and then point at the player and click the mouse to fling him (the script is not supported for phones)
-
- Version 1.1 - prediction update ( there may be bugs due to ping )
Add Comment
Please, Sign In to add comment
Advertisement