
Keyless

--[[
WARNING: script de terceiros / use por sua conta.
]]
local Players = game:GetService("Players")
local UIS = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local camera = workspace.CurrentCamera
-- CONFIG
local BALL_NAME = "Ball"
local TOGGLE_UI_KEY = Enum.KeyCode.RightShift -- abre/fecha a janelinha
local LOCK_CAMERA_KEY = Enum.KeyCode.F -- seguir bola ON/OFF
-- IMAGEM DO BOTÃO (coloque o seu ImageId aqui)
local OPEN_ICON = "rbxassetid://SEU_ID_AQUI"
-- estado
local uiOpen = true
local followBall = false
local followConn = nil
-- pega a bola (espera aparecer)
local function getBall()
local ball = workspace:FindFirstChild(BALL_NAME)
if ball then return ball end
return workspace:WaitForChild(BALL_NAME)
end
-- UI
local gui = Instance.new("ScreenGui")
gui.Name = "AssistGui"
gui.ResetOnSpawn = false
gui.Parent = player:WaitForChild("PlayerGui")
-- BOTÃO DE IMAGEM (fica sempre aparecendo)
local openBtn = Instance.new("ImageButton")
openBtn.Name = "OpenCloseButton"
openBtn.Size = UDim2.new(0, 80, 0, 80)
openBtn.Position = UDim2.new(0, 20, 0, 20)
openBtn.BackgroundTransparency = 1
openBtn.Image = OPEN_ICON
openBtn.Parent = gui
local openCorner = Instance.new("UICorner")
openCorner.CornerRadius = UDim.new(1, 0)
openCorner.Parent = openBtn
-- JANELA (frame) que abre/fecha
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0, 260, 0, 120)
frame.Position = UDim2.new(0, 20, 0, 120)
frame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
frame.BorderSizePixel = 0
frame.Visible = uiOpen
frame.Parent = gui
local frameCorner = Instance.new("UICorner")
frameCorner.CornerRadius = UDim.new(0, 10)
frameCorner.Parent = frame
local title = Instance.new("TextLabel")
title.Size = UDim2.new(1, -20, 0, 30)
title.Position = UDim2.new(0, 10, 0, 0)
title.BackgroundTransparency = 1
title.Text = "Assistência (Treino)"
title.TextColor3 = Color3.fromRGB(255, 255, 255)
title.TextScaled = true
title.Parent = frame
local btn = Instance.new("TextButton")
btn.Size = UDim2.new(1, -20, 0, 40)
btn.Position = UDim2.new(0, 10, 0, 45)
btn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
btn.BorderSizePixel = 0
btn.TextColor3 = Color3.fromRGB(255, 255, 255)
btn.TextScaled = true
btn.Parent = frame
local btnCorner = Instance.new("UICorner")
btnCorner.CornerRadius = UDim.new(0, 8)
btnCorner.Parent = btn
local hint = Instance.new("TextLabel")
hint.Size = UDim2.new(1, -20, 0, 25)
hint.Position = UDim2.new(0, 10, 1, -28)
hint.BackgroundTransparency = 1
hint.Text = "RightShift: UI | F: seguir bola"
hint.TextColor3 = Color3.fromRGB(200, 200, 200)
hint.TextScaled = true
hint.Parent = frame
local function setButtonText()
btn.Text = followBall and "Seguir bola: ON" or "Seguir bola: OFF"
btn.BackgroundColor3 = followBall and Color3.fromRGB(46, 120, 66) or Color3.fromRGB(60, 60, 60)
end
local function stopFollowing()
followBall = false
if followConn then
followConn:Disconnect()
followConn = nil
end
camera.CameraType = Enum.CameraType.Custom
setButtonText()
end
local function startFollowing()
local ball = getBall()
followBall = true
camera.CameraType = Enum.CameraType.Scriptable
if followConn then followConn:Disconnect() end
followConn = RunService.RenderStepped:Connect(function()
if not ball or not ball.Parent then
ball = workspace:FindFirstChild(BALL_NAME)
if not ball then return end
end
local pos = ball.Position
local camPos = pos + Vector3.new(0, 12, 18)
camera.CFrame = CFrame.new(camPos, pos)
end)
setButtonText()
end
local function toggleFollow()
if followBall then
stopFollowing()
else
startFollowing()
end
end
local function toggleUI()
uiOpen = not uiOpen
frame.Visible = uiOpen
end
-- clicks
btn.MouseButton1Click:Connect(toggleFollow)
openBtn.MouseButton1Click:Connect(toggleUI)
setButtonText()
-- teclas
UIS.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == TOGGLE_UI_KEY then
toggleUI()
elseif input.KeyCode == LOCK_CAMERA_KEY then
toggleFollow()
end
end)No comments yet for this script.