Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local TweenService = game:GetService("TweenService")
- local RunService = game:GetService("RunService")
- local player = Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local playerGui = game:GetService("CoreGui")
- if playerGui:FindFirstChild("CustomGUI") then
- playerGui:FindFirstChild("CustomGUI"):Destroy()
- end
- local gui = Instance.new("ScreenGui")
- gui.Name = "CustomGUI"
- gui.ResetOnSpawn = false
- gui.Parent = playerGui
- local frame = Instance.new("Frame", gui)
- local textBox = Instance.new("TextBox", frame)
- local toggleButton = Instance.new("TextButton", frame)
- local uiCorner = Instance.new("UICorner", frame)
- frame.Size = UDim2.new(0, 200, 0, 120)
- frame.Position = UDim2.new(0.5, -100, 0.2, 0)
- frame.BackgroundColor3 = Color3.new(0, 0, 0)
- frame.Visible = false
- frame.ClipsDescendants = true
- frame.Active = true
- frame.Draggable = true
- uiCorner.CornerRadius = UDim.new(0, 10)
- textBox.Size = UDim2.new(0.8, 0, 0.2, 0)
- textBox.Position = UDim2.new(0.1, 0, 0.1, 0)
- textBox.PlaceholderText = "Введите имя"
- local textBoxCorner = Instance.new("UICorner", textBox)
- textBoxCorner.CornerRadius = UDim.new(0, 6)
- toggleButton.Size = UDim2.new(0.8, 0, 0.3, 0)
- toggleButton.Position = UDim2.new(0.1, 0, 0.5, 0)
- toggleButton.Text = "ON"
- toggleButton.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
- local buttonCorner = Instance.new("UICorner", toggleButton)
- buttonCorner.CornerRadius = UDim.new(0, 6)
- local function showGui()
- frame.Visible = true
- frame.Size = UDim2.new(0, 0, 0, 0)
- local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
- local tween = TweenService:Create(frame, tweenInfo, {Size = UDim2.new(0, 200, 0, 120)})
- tween:Play()
- end
- showGui()
- local function getRandomPosition()
- return Vector3.new(math.random(-100, 100), math.random(10, 50), math.random(-100, 100))
- end
- local function getTargetPlayer(query)
- for _, otherPlayer in ipairs(Players:GetPlayers()) do
- if otherPlayer ~= player then
- if string.find(string.lower(otherPlayer.Name), string.lower(query)) or string.find(string.lower(otherPlayer.DisplayName), string.lower(query)) then
- return otherPlayer
- end
- end
- end
- return nil
- end
- local running = false
- local followConnection
- local function executeCycle()
- while running do
- local targetPlayer = getTargetPlayer(textBox.Text)
- if targetPlayer and targetPlayer.Character and targetPlayer.Character:FindFirstChild("HumanoidRootPart") then
- character:SetPrimaryPartCFrame(CFrame.new(getRandomPosition()))
- wait(1.5)
- if character:FindFirstChild("Events") and character.Events:FindFirstChild("Grab") then
- character.Events.Grab:FireServer()
- end
- wait(2)
- local targetCFrame = targetPlayer.Character.HumanoidRootPart.CFrame * CFrame.new(0, 0, 2)
- character:SetPrimaryPartCFrame(targetCFrame)
- followConnection = RunService.Heartbeat:Connect(function()
- if running and targetPlayer and targetPlayer.Character and targetPlayer.Character:FindFirstChild("HumanoidRootPart") then
- character:SetPrimaryPartCFrame(targetPlayer.Character.HumanoidRootPart.CFrame * CFrame.new(0, 0, 2))
- end
- end)
- if character:FindFirstChild("Events") and character.Events:FindFirstChild("Throw") then
- character.Events.Throw:FireServer()
- end
- wait(1.5)
- if followConnection then
- followConnection:Disconnect()
- followConnection = nil
- end
- end
- wait(1)
- end
- end
- toggleButton.MouseButton1Click:Connect(function()
- if not running then
- running = true
- toggleButton.Text = "OFF"
- toggleButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
- executeCycle()
- else
- running = false
- toggleButton.Text = "ON"
- toggleButton.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
- end
- end)
- player.CharacterAdded:Connect(function(newCharacter)
- character = newCharacter
- wait(1)
- showGui()
- if running then
- executeCycle()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement