Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local UserInputService = game:GetService("UserInputService")
- local VirtualInputManager = game:GetService("VirtualInputManager")
- local TweenService = game:GetService("TweenService")
- local correctKey = "blurdowashere21"
- local speed = 200 -- Speed in studs per second
- -- Create ScreenGui
- local screenGui = Instance.new("ScreenGui")
- screenGui.Parent = Players.LocalPlayer:WaitForChild("PlayerGui")
- screenGui.ResetOnSpawn = false
- -- Create the "Enter Key" frame
- local enterKeyFrame = Instance.new("Frame")
- enterKeyFrame.Size = UDim2.new(0, 400, 0, 200)
- enterKeyFrame.Position = UDim2.new(0.5, -200, 0.5, -100)
- enterKeyFrame.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
- enterKeyFrame.Active = true
- enterKeyFrame.Draggable = true
- enterKeyFrame.Visible = true
- enterKeyFrame.Parent = screenGui
- -- Create the frame title
- local enterKeyTitle = Instance.new("TextLabel")
- enterKeyTitle.Size = UDim2.new(1, 0, 0, 50)
- enterKeyTitle.Position = UDim2.new(0, 0, 0, 0)
- enterKeyTitle.Text = "Enter Key"
- enterKeyTitle.TextColor3 = Color3.new(1, 1, 1)
- enterKeyTitle.BackgroundTransparency = 1
- enterKeyTitle.Font = Enum.Font.SourceSansBold
- enterKeyTitle.TextSize = 36
- enterKeyTitle.Parent = enterKeyFrame
- -- Create the TextBox for entering the key
- local keyTextBox = Instance.new("TextBox")
- keyTextBox.Size = UDim2.new(0, 300, 0, 50)
- keyTextBox.Position = UDim2.new(0.5, -150, 0.5, -25)
- keyTextBox.Text = ""
- keyTextBox.PlaceholderText = "Enter Key"
- keyTextBox.TextColor3 = Color3.new(1, 1, 1)
- keyTextBox.Font = Enum.Font.SourceSansBold
- keyTextBox.TextSize = 18
- keyTextBox.BackgroundTransparency = 0.5
- keyTextBox.BackgroundColor3 = Color3.new(0, 0, 0)
- keyTextBox.Parent = enterKeyFrame
- -- Create the "Enter" button
- local enterButton = Instance.new("TextButton")
- enterButton.Size = UDim2.new(0, 150, 0, 50)
- enterButton.Position = UDim2.new(0.5, -75, 0.75, -25)
- enterButton.Text = "Enter"
- enterButton.TextColor3 = Color3.new(1, 1, 1)
- enterButton.Font = Enum.Font.SourceSansBold
- enterButton.TextSize = 18
- enterButton.BackgroundTransparency = 0.5
- enterButton.BackgroundColor3 = Color3.new(0, 0, 0)
- enterButton.Parent = enterKeyFrame
- -- Create the main frame (hidden initially)
- local mainFrame = Instance.new("Frame")
- mainFrame.Size = UDim2.new(0, 400, 0, 400)
- mainFrame.Position = UDim2.new(0.5, -200, 0.5, -200)
- mainFrame.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
- mainFrame.Active = true
- mainFrame.Draggable = true
- mainFrame.Visible = false
- mainFrame.Parent = screenGui
- -- Create the frame title
- local title = Instance.new("TextLabel")
- title.Size = UDim2.new(1, 0, 0, 50)
- title.Position = UDim2.new(0, 0, 0, 0)
- title.Text = "Mari's Hoop Central 6 Gui"
- title.TextColor3 = Color3.new(1, 1, 1)
- title.BackgroundTransparency = 1
- title.Font = Enum.Font.SourceSansBold
- title.TextSize = 36
- title.Parent = mainFrame
- -- Create the "Click to Orbit" button
- local orbitButton = Instance.new("TextButton")
- orbitButton.Size = UDim2.new(0, 150, 0, 50)
- orbitButton.Position = UDim2.new(0.05, 0, 0.3, -25)
- orbitButton.Text = "Auto Guard"
- orbitButton.TextColor3 = Color3.new(1, 1, 1)
- orbitButton.Font = Enum.Font.SourceSansBold
- orbitButton.TextSize = 18
- orbitButton.BackgroundTransparency = 0.5
- orbitButton.BackgroundColor3 = Color3.new(0, 0, 0)
- orbitButton.Parent = mainFrame
- local orbiting = false
- local targetPlayer = nil
- local distanceInFront = 3
- -- Function to toggle the orbiting state
- local function toggleOrbiting()
- orbiting = not orbiting
- if orbiting then
- orbitButton.Text = "Stop Auto Guarding"
- orbitButton.BackgroundColor3 = Color3.new(0, 1, 0)
- VirtualInputManager:SendKeyEvent(true, Enum.KeyCode.G, false, game)
- else
- orbitButton.Text = "Auto Guard"
- orbitButton.BackgroundColor3 = Color3.new(0, 0, 0)
- targetPlayer = nil
- VirtualInputManager:SendKeyEvent(false, Enum.KeyCode.G, false, game)
- end
- end
- -- Function to find the player character that is clicked
- local function getClickedPlayer(mousePos)
- local camera = workspace.CurrentCamera
- local unitRay = camera:ScreenPointToRay(mousePos.X, mousePos.Y)
- local ray = Ray.new(unitRay.Origin, unitRay.Direction * 1000)
- local part, position = workspace:FindPartOnRay(ray, Players.LocalPlayer.Character)
- if part then
- local clickedPlayer = Players:GetPlayerFromCharacter(part.Parent)
- return clickedPlayer
- end
- return nil
- end
- -- Function to handle mouse clicks
- local function onMouseClick()
- if orbiting then
- local mousePos = UserInputService:GetMouseLocation()
- local player = getClickedPlayer(mousePos)
- if player then
- targetPlayer = player
- end
- end
- end
- -- Connect the button click event
- orbitButton.MouseButton1Click:Connect(toggleOrbiting)
- -- Connect the UserInputService input began event
- UserInputService.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- onMouseClick()
- end
- end)
- -- Function to handle the positioning
- local function onRenderStep(deltaTime)
- if orbiting then
- if targetPlayer and targetPlayer.Character and targetPlayer.Character:FindFirstChild("HumanoidRootPart") then
- local targetPos = targetPlayer.Character.HumanoidRootPart.Position
- local targetLookVector = targetPlayer.Character.HumanoidRootPart.CFrame.LookVector
- local newPos = targetPos + targetLookVector * distanceInFront
- Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(newPos, targetPos)
- end
- end
- end
- -- Connect the RenderStepped event to handle the positioning
- RunService.RenderStepped:Connect(onRenderStep)
- -- Create the "Auto Score" button
- local autoScoreButton = Instance.new("TextButton")
- autoScoreButton.Size = UDim2.new(0, 150, 0, 50)
- autoScoreButton.Position = UDim2.new(0.45, 0, 0.3, -25)
- autoScoreButton.Text = "Auto Score: OFF"
- autoScoreButton.TextColor3 = Color3.new(1, 1, 1)
- autoScoreButton.Font = Enum.Font.SourceSansBold
- autoScoreButton.TextSize = 18
- autoScoreButton.BackgroundTransparency = 0.5
- autoScoreButton.BackgroundColor3 = Color3.new(0, 0, 0)
- autoScoreButton.Parent = mainFrame
- -- List of CFrame positions
- local positions = {
- CFrame.new(82.0245209, 4.73824358, 147.255615, -0.865853965, 9.99409799e-09, -0.500296831, -2.02986516e-09, 1, 2.34893847e-08, 0.500296831, 2.13539124e-08, -0.865853965),
- CFrame.new(81.4850464, 4.7463212, -2.16714334, -0.946834981, -3.82307235e-08, -0.321719587, -3.61803565e-08, 1, -1.23520492e-08, 0.321719587, -5.54236101e-11, -0.946834981),
- CFrame.new(-84.419487, 4.73700142, 11.0002966, 0.948681593, 1.83182323e-08, 0.31623292, -4.40376491e-09, 1, -4.47153354e-08, -0.31623292, 4.14764918e-08, 0.948681593),
- CFrame.new(-114.350708, 4.73628473, -1.54850757, 0.972152889, -1.08958578e-09, 0.234302208, -1.26084354e-08, 1, 6.0976455e-08, -0.234302208, -6.23402297e-08, 0.972152889)
- }
- -- Function to move the player smoothly
- local function moveToPositionSmoothly(position)
- local character = Players.LocalPlayer.Character
- local hrp = character:FindFirstChild("HumanoidRootPart")
- if hrp then
- local distance = (hrp.Position - position.Position).Magnitude
- local timeToMove = distance / speed
- local tweenInfo = TweenInfo.new(timeToMove, Enum.EasingStyle.Linear)
- local tween = TweenService:Create(hrp, tweenInfo, {CFrame = position})
- tween:Play()
- tween.Completed:Wait()
- end
- end
- -- Function to find the nearest CFrame position
- local function findNearestPosition()
- local closestPosition = nil
- local closestDistance = math.huge
- local playerPos = Players.LocalPlayer.Character.HumanoidRootPart.Position
- for _, position in ipairs(positions) do
- local distance = (playerPos - position.Position).Magnitude
- if distance < closestDistance then
- closestDistance = distance
- closestPosition = position
- end
- end
- return closestPosition
- end
- -- Function to teleport the player to the nearest position
- local function teleportToNearestPosition()
- local nearestPosition = findNearestPosition()
- if nearestPosition then
- moveToPositionSmoothly(nearestPosition)
- wait(0.2)
- VirtualInputManager:SendKeyEvent(true, Enum.KeyCode.E, false, game)
- wait(0.5)
- VirtualInputManager:SendKeyEvent(false, Enum.KeyCode.E, false, game)
- end
- end
- -- Toggle auto score functionality
- local autoScoreActive = false
- local function toggleAutoScore()
- autoScoreActive = not autoScoreActive
- if autoScoreActive then
- autoScoreButton.Text = "Auto Score: ON"
- autoScoreButton.BackgroundColor3 = Color3.new(0, 1, 0)
- while autoScoreActive do
- teleportToNearestPosition()
- wait(11.5)
- end
- else
- autoScoreButton.Text = "Auto Score: OFF"
- autoScoreButton.BackgroundColor3 = Color3.new(0, 0, 0)
- end
- end
- autoScoreButton.MouseButton1Click:Connect(toggleAutoScore)
- -- Ensure the button is more to the right
- autoScoreButton.Position = UDim2.new(0.55, 0, 0.3, -25)
- -- Function to check the entered key
- local function checkKey()
- if keyTextBox.Text == correctKey then
- enterKeyFrame.Visible = false
- mainFrame.Visible = true
- else
- enterButton.Text = "Wrong Key!"
- wait(4)
- enterButton.Text = "Enter"
- end
- end
- -- Connect the enter button click event
- enterButton.MouseButton1Click:Connect(checkKey)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement