print("[Spectate] Iniciando...") local P = game:GetService("Players") local UIS = game:GetService("UserInputService") local R = game:GetService("RunService") local T = game:GetService("TweenService") local p = P.LocalPlayer local cam = workspace.CurrentCamera local pg = p:WaitForChild("PlayerGui") -- ========================================== -- 1. ANIMAÇÃO DE CARREGAMENTO CINEMATOGRÁFICA -- ========================================== local lg = Instance.new("ScreenGui") lg.Name = "SpectateLoad" lg.ResetOnSpawn = false lg.IgnoreGuiInset = true lg.DisplayOrder = 99 lg.Parent = pg -- Fundo 100% Preto local darkOverlay = Instance.new("Frame", lg) darkOverlay.Size = UDim2.new(1, 0, 1, 0) darkOverlay.BackgroundColor3 = Color3.fromRGB(0, 0, 0) darkOverlay.BackgroundTransparency = 0 darkOverlay.BorderSizePixel = 0 darkOverlay.ZIndex = 100 -- Caixa principal do loading local lf = Instance.new("Frame", darkOverlay) lf.Size = UDim2.new(0, 320, 0, 180) lf.Position = UDim2.new(0.5, -160, 0.5, -90) lf.BackgroundColor3 = Color3.fromRGB(20, 20, 25) lf.BorderSizePixel = 0 lf.ZIndex = 101 Instance.new("UICorner", lf).CornerRadius = UDim.new(0, 12) local stroke = Instance.new("UIStroke", lf) stroke.Color = Color3.fromRGB(0, 255, 255) stroke.Thickness = 2 stroke.Transparency = 0.5 -- Título Animado local title = Instance.new("TextLabel", lf) title.Size = UDim2.new(1, 0, 0, 50) title.Position = UDim2.new(0, 0, 0, 10) title.BackgroundTransparency = 1 title.Text = "🔼especindex🔼" title.TextColor3 = Color3.fromRGB(0, 255, 255) title.Font = Enum.Font.GothamBlack title.TextSize = 32 title.ZIndex = 105 -- Efeito de pulsar do Título task.spawn(function() while lg.Parent do T:Create(title, TweenInfo.new(1), {TextColor3 = Color3.fromRGB(255, 255, 255)}):Play() task.wait(1) T:Create(title, TweenInfo.new(1), {TextColor3 = Color3.fromRGB(0, 255, 255)}):Play() task.wait(1) end end) -- Texto de Status local statusText = Instance.new("TextLabel", lf) statusText.Size = UDim2.new(1, -40, 0, 25) statusText.Position = UDim2.new(0, 20, 0, 60) statusText.BackgroundTransparency = 1 statusText.Text = "Aguardando..." statusText.TextColor3 = Color3.fromRGB(200, 200, 200) statusText.Font = Enum.Font.Gotham statusText.TextSize = 14 statusText.TextXAlignment = Enum.TextXAlignment.Left statusText.ZIndex = 105 -- Barra de Progresso Fundo local bb = Instance.new("Frame", lf) bb.Size = UDim2.new(1, -40, 0, 14) bb.Position = UDim2.new(0, 20, 0, 95) bb.BackgroundColor3 = Color3.fromRGB(40, 40, 50) bb.BorderSizePixel = 0 bb.ZIndex = 105 Instance.new("UICorner", bb).CornerRadius = UDim.new(0, 7) -- Barra de Progresso Preenchimento local bf = Instance.new("Frame", bb) bf.Size = UDim2.new(0, 0, 1, 0) bf.BackgroundColor3 = Color3.fromRGB(0, 255, 255) bf.BorderSizePixel = 0 bf.ZIndex = 106 Instance.new("UICorner", bf).CornerRadius = UDim.new(0, 7) -- Texto da Porcentagem local pctText = Instance.new("TextLabel", lf) pctText.Size = UDim2.new(1, 0, 0, 20) pctText.Position = UDim2.new(0, 0, 0, 120) pctText.BackgroundTransparency = 1 pctText.Text = "0%" pctText.TextColor3 = Color3.fromRGB(255, 255, 255) pctText.Font = Enum.Font.GothamBold pctText.TextSize = 16 pctText.ZIndex = 105 -- Tela de Flash Ciano local flashUI = Instance.new("Frame", lg) flashUI.Size = UDim2.new(1, 0, 1, 0) flashUI.BackgroundColor3 = Color3.fromRGB(0, 255, 255) flashUI.BackgroundTransparency = 1 flashUI.Visible = false flashUI.ZIndex = 110 local flashText = Instance.new("TextLabel", flashUI) flashText.Size = UDim2.new(1, 0, 1, 0) flashText.BackgroundTransparency = 1 flashText.Text = "COMPLETO" flashText.TextColor3 = Color3.fromRGB(255, 255, 255) flashText.TextTransparency = 1 flashText.Font = Enum.Font.GothamBlack flashText.TextSize = 60 flashText.ZIndex = 111 -- Dados das Etapas local steps = { { pct = 0, time = 1, txt = "Initializing / Inicializando" }, { pct = 20, time = 1, txt = "Creating UI / Criando UI" }, { pct = 40, time = 2, txt = "Connecting player list / Conectando a lista" }, { pct = 60, time = 2, txt = "Connecting to game / Conectando ao jogo" }, { pct = 80, time = 5, txt = "Connecting to Roblox / Conectando ao Roblox" }, { pct = 100, time = 1, txt = "Complete / Completo" } } local lastPct = 0 for i, step in ipairs(steps) do statusText.Text = step.txt local frames = 30 local waitTime = step.time / frames for j = 1, frames do local alpha = j / frames local currentPct = lastPct + (step.pct - lastPct) * alpha pctText.Text = math.floor(currentPct) .. "%" bf.Size = UDim2.new(currentPct / 100, 0, 1, 0) task.wait(waitTime) end pctText.Text = step.pct .. "%" bf.Size = UDim2.new(step.pct / 100, 0, 1, 0) lastPct = step.pct flashUI.Visible = true flashUI.BackgroundTransparency = 0.4 flashText.TextTransparency = 0 local tw1 = T:Create(flashUI, TweenInfo.new(0.4), {BackgroundTransparency = 1}) local tw2 = T:Create(flashText, TweenInfo.new(0.4), {TextTransparency = 1}) tw1:Play() tw2:Play() task.wait(0.5) flashUI.Visible = false end task.wait(0.2) lg:Destroy() -- ========================================== -- 2. UI DO ESPECTADOR (FIXA) -- ========================================== local sg = Instance.new("ScreenGui") sg.Name = "SpectateGui" sg.ResetOnSpawn = false sg.IgnoreGuiInset = true sg.DisplayOrder = 15 sg.Parent = pg local isSpectating = false local autoExitOnTP = true local currentIndex = 1 local playerList = {} local toggleBtn = Instance.new("TextButton", sg) toggleBtn.Size = UDim2.new(0, 110, 0, 40) toggleBtn.Position = UDim2.new(0, 15, 0, 80) toggleBtn.BackgroundColor3 = Color3.fromRGB(60, 130, 220) toggleBtn.Text = "Espectador" toggleBtn.TextColor3 = Color3.fromRGB(255, 255, 255) toggleBtn.Font = Enum.Font.GothamBold toggleBtn.TextSize = 14 toggleBtn.ZIndex = 10 Instance.new("UICorner", toggleBtn).CornerRadius = UDim.new(0, 8) local listFrame = Instance.new("Frame", sg) listFrame.Size = UDim2.new(0, 200, 0, 250) listFrame.Position = UDim2.new(0, 15, 0, 130) listFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 35) listFrame.Visible = false listFrame.ZIndex = 10 Instance.new("UICorner", listFrame).CornerRadius = UDim.new(0, 10) local titleList = Instance.new("TextLabel", listFrame) titleList.Size = UDim2.new(1, 0, 0, 30) titleList.BackgroundTransparency = 1 titleList.Text = "Jogadores no Servidor" titleList.TextColor3 = Color3.fromRGB(255, 255, 255) titleList.Font = Enum.Font.GothamBold titleList.TextSize = 14 titleList.ZIndex = 11 local scroll = Instance.new("ScrollingFrame", listFrame) scroll.Size = UDim2.new(1, -10, 1, -40) scroll.Position = UDim2.new(0, 5, 0, 35) scroll.BackgroundTransparency = 1 scroll.ScrollBarThickness = 4 scroll.CanvasSize = UDim2.new(0, 0, 0, 0) scroll.ZIndex = 11 local layout = Instance.new("UIListLayout", scroll) layout.Padding = UDim.new(0, 5) layout.SortOrder = Enum.SortOrder.LayoutOrder local controlFrame = Instance.new("Frame", sg) controlFrame.Size = UDim2.new(0, 260, 0, 100) -- AQUI ESTÁ A CORREÇÃO: Mudado de -150 para -100 para colar no chão controlFrame.Position = UDim2.new(0.5, -130, 1, -100) controlFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 35) controlFrame.Visible = false controlFrame.ZIndex = 10 Instance.new("UICorner", controlFrame).CornerRadius = UDim.new(0, 10) local prevBtn = Instance.new("TextButton", controlFrame) prevBtn.Size = UDim2.new(0, 50, 0, 40) prevBtn.Position = UDim2.new(0, 10, 0, 10) prevBtn.BackgroundColor3 = Color3.fromRGB(60, 130, 220) prevBtn.Text = "<" prevBtn.TextColor3 = Color3.fromRGB(255, 255, 255) prevBtn.Font = Enum.Font.GothamBold prevBtn.TextSize = 20 prevBtn.ZIndex = 11 Instance.new("UICorner", prevBtn).CornerRadius = UDim.new(0, 6) local nextBtn = Instance.new("TextButton", controlFrame) nextBtn.Size = UDim2.new(0, 50, 0, 40) nextBtn.Position = UDim2.new(1, -60, 0, 10) nextBtn.BackgroundColor3 = Color3.fromRGB(60, 130, 220) nextBtn.Text = ">" nextBtn.TextColor3 = Color3.fromRGB(255, 255, 255) nextBtn.Font = Enum.Font.GothamBold nextBtn.TextSize = 20 nextBtn.ZIndex = 11 Instance.new("UICorner", nextBtn).CornerRadius = UDim.new(0, 6) local tpBtn = Instance.new("TextButton", controlFrame) tpBtn.Size = UDim2.new(0, 110, 0, 40) tpBtn.Position = UDim2.new(0.5, -55, 0, 10) tpBtn.BackgroundColor3 = Color3.fromRGB(60, 200, 100) tpBtn.Text = "Teleportar" tpBtn.TextColor3 = Color3.fromRGB(255, 255, 255) tpBtn.Font = Enum.Font.GothamBold tpBtn.TextSize = 13 tpBtn.TextScaled = true tpBtn.ZIndex = 11 Instance.new("UICorner", tpBtn).CornerRadius = UDim.new(0, 6) local toggleTpBtn = Instance.new("TextButton", controlFrame) toggleTpBtn.Size = UDim2.new(0, 150, 0, 30) toggleTpBtn.Position = UDim2.new(0.5, -75, 0, 60) toggleTpBtn.BackgroundColor3 = Color3.fromRGB(60, 200, 100) toggleTpBtn.Text = "Sair após Teleporte: ON" toggleTpBtn.TextColor3 = Color3.fromRGB(255, 255, 255) toggleTpBtn.Font = Enum.Font.GothamBold toggleTpBtn.TextSize = 11 toggleTpBtn.TextScaled = true toggleTpBtn.ZIndex = 11 Instance.new("UICorner", toggleTpBtn).CornerRadius = UDim.new(0, 6) local stopBtn = Instance.new("TextButton", sg) stopBtn.Size = UDim2.new(0, 100, 0, 35) stopBtn.Position = UDim2.new(0.5, -50, 0, 20) stopBtn.BackgroundColor3 = Color3.fromRGB(200, 60, 60) stopBtn.Text = "Sair" stopBtn.TextColor3 = Color3.fromRGB(255, 255, 255) stopBtn.Font = Enum.Font.GothamBold stopBtn.TextSize = 14 stopBtn.Visible = false stopBtn.ZIndex = 10 Instance.new("UICorner", stopBtn).CornerRadius = UDim.new(0, 8) -- ========================================== -- 3. CONTROLES DO ROBLOX -- ========================================== local function toggleControls(enable) local touchGui = pg:FindFirstChild("TouchGui") if touchGui then local jumpBtn = touchGui:FindFirstChild("JumpButton") if not jumpBtn then local tcf = touchGui:FindFirstChild("TouchControlFrame") if tcf then jumpBtn = tcf:FindFirstChild("JumpButton") end end if jumpBtn then jumpBtn.Visible = enable end end local playerScripts = p:FindFirstChild("PlayerScripts") if playerScripts then local pm = playerScripts:FindFirstChild("PlayerModule") if pm then local success, controls = pcall(function() return require(pm):GetControls() end) if success and controls then if enable then controls:Enable() else controls:Disable() end end end end end -- ========================================== -- 4. LÓGICA -- ========================================== local function resetCamera() local char = p.Character if char then local hum = char:FindFirstChildOfClass("Humanoid") if hum then cam.CameraSubject = hum cam.CameraType = Enum.CameraType.Custom end end isSpectating = false controlFrame.Visible = false stopBtn.Visible = false listFrame.Visible = true toggleControls(true) end local function spectatePlayer(index) if #playerList == 0 then return end if index > #playerList then index = 1 end if index < 1 then index = #playerList end currentIndex = index local target = playerList[currentIndex] if target and target.Character then local hum = target.Character:FindFirstChildOfClass("Humanoid") if hum then cam.CameraSubject = hum cam.CameraType = Enum.CameraType.Custom isSpectating = true listFrame.Visible = false controlFrame.Visible = true stopBtn.Visible = true toggleControls(false) end else spectatePlayer(currentIndex + 1) end end local function updateList() for _, v in pairs(scroll:GetChildren()) do if v:IsA("TextButton") then v:Destroy() end end playerList = {} for _, plr in ipairs(P:GetPlayers()) do if plr ~= p then table.insert(playerList, plr) end end for i, plr in ipairs(playerList) do local btn = Instance.new("TextButton", scroll) btn.Size = UDim2.new(1, -10, 0, 35) btn.BackgroundColor3 = Color3.fromRGB(45, 45, 60) btn.Text = plr.Name btn.TextColor3 = Color3.fromRGB(255, 255, 255) btn.Font = Enum.Font.Gotham btn.TextSize = 12 btn.LayoutOrder = i btn.ZIndex = 11 Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 6) btn.MouseButton1Click:Connect(function() spectatePlayer(i) end) end task.wait(0.05) scroll.CanvasSize = UDim2.new(0, 0, 0, layout.AbsoluteContentSize.Y + 10) end -- ========================================== -- 5. CONEXÕES -- ========================================== toggleBtn.MouseButton1Click:Connect(function() listFrame.Visible = not listFrame.Visible if listFrame.Visible then updateList() end end) P.PlayerAdded:Connect(function() if listFrame.Visible then updateList() end end) P.PlayerRemoving:Connect(function(plr) if listFrame.Visible then updateList() end if isSpectating and playerList[currentIndex] == plr then resetCamera() end end) prevBtn.MouseButton1Click:Connect(function() spectatePlayer(currentIndex - 1) end) nextBtn.MouseButton1Click:Connect(function() spectatePlayer(currentIndex + 1) end) stopBtn.MouseButton1Click:Connect(resetCamera) toggleTpBtn.MouseButton1Click:Connect(function() autoExitOnTP = not autoExitOnTP if autoExitOnTP then toggleTpBtn.Text = "Sair após Teleporte: ON" toggleTpBtn.BackgroundColor3 = Color3.fromRGB(60, 200, 100) else toggleTpBtn.Text = "Sair após Teleporte: OFF" toggleTpBtn.BackgroundColor3 = Color3.fromRGB(200, 60, 60) end end) tpBtn.MouseButton1Click:Connect(function() if not isSpectating then return end local target = playerList[currentIndex] if target and target.Character and p.Character then local targetRoot = target.Character:FindFirstChild("HumanoidRootPart") if targetRoot then p.Character:PivotTo(targetRoot.CFrame * CFrame.new(0, 0, 4)) if autoExitOnTP then resetCamera() end end end end) R.RenderStepped:Connect(function() if isSpectating then local target = playerList[currentIndex] if not target or not target.Character or not target.Character:FindFirstChild("Humanoid") or target.Character.Humanoid.Health <= 0 then if #playerList > 1 then spectatePlayer(currentIndex + 1) else resetCamera() end end end end) print("[Spectate] Pronto e Rodando! UI Fixa.")