-- ========== MENU ADMIN DEFINITIVO (VIEW + RESET CORRIGIDOS) ========== local lp = game.Players.LocalPlayer local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local Players = game:GetService("Players") local Camera = workspace.CurrentCamera local CoreGui = game:GetService("CoreGui") -- ========== VARIÁVEIS GLOBAIS ========== -- Reset All (ciclo único) local resetAllConn = nil local resetAllActive = false local resetAllTargets = {} local resetAllIndex = 1 local resetAllSwitchTime = 0 local interval = 0.1 local finalDelay = 0.5 -- Reset All Loop (infinito) local resetAllLoopConn = nil local resetAllLoopActive = false local resetAllLoopTargets = {} local resetAllLoopIndex = 1 local resetAllLoopSwitchTime = 0 -- Reset Target (2 segundos) local resetTargetConn = nil local resetTargetActive = false local currentTarget = nil local timeout = nil -- AntiFling local antiFlingConn = nil local antiFlingActive = false -- View (espectador) local viewActive = false local viewLoop = nil local viewTarget = nil local viewRemovingConn = nil local originalCameraSubject = nil local originalCameraType = nil -- ========== FUNÇÕES AUXILIARES ========== local function notificar(msg, cor) end -- será sobrescrita -- Busca jogador por NOME REAL ou APELIDO (qualquer parte) local function encontrarJogador(texto) if texto == "" then return nil end local lower = texto:lower() local matches = {} for _, plr in pairs(Players:GetPlayers()) do if plr ~= lp then if plr.Name:lower():find(lower, 1, true) then table.insert(matches, plr) elseif plr.DisplayName and plr.DisplayName:lower():find(lower, 1, true) then table.insert(matches, plr) end end end if #matches == 0 then return nil end for _, plr in pairs(matches) do if plr.Name:lower() == lower or (plr.DisplayName and plr.DisplayName:lower() == lower) then return plr end end for _, plr in pairs(matches) do if plr.Name:lower():sub(1, #lower) == lower or (plr.DisplayName and plr.DisplayName:lower():sub(1, #lower) == lower) then return plr end end return matches[1] end -- ========== RESET ALL (CICLO ÚNICO) ========== local function pararResetAll() if resetAllConn then resetAllConn:Disconnect(); resetAllConn = nil end resetAllActive = false local char = lp.Character if char and char:FindFirstChild("Humanoid") then char.Humanoid.PlatformStand = false end if char and char:FindFirstChild("HumanoidRootPart") then local root = char.HumanoidRootPart pcall(sethiddenproperty, root, "PhysicsRepRootPart", nil) root.AssemblyLinearVelocity = Vector3.zero root.AssemblyAngularVelocity = Vector3.zero end notificar("Reset All desativado", Color3.fromRGB(200,0,0)) end local function iniciarResetAll() if resetAllActive then pararResetAll() end resetAllTargets = {} for _, plr in pairs(Players:GetPlayers()) do if plr ~= lp and plr.Character then local r = plr.Character:FindFirstChild("HumanoidRootPart") if r then table.insert(resetAllTargets, r) end end end if #resetAllTargets == 0 then notificar("Nenhum outro jogador encontrado", Color3.fromRGB(200,100,0)) return end resetAllActive = true resetAllIndex = 1 resetAllSwitchTime = tick() pcall(function() settings().Physics.AllowSleep = false settings().Physics.ThrottleAdjustTime = 0 lp.ReplicationFocus = lp.Character and lp.Character:FindFirstChild("HumanoidRootPart") if lp.Character then for _, part in pairs(lp.Character:GetDescendants()) do if part:IsA("BasePart") then part:SetNetworkOwner(lp) end end end end) local NaNVec = Vector3.new(0/0,0/0,0/0) resetAllConn = RunService.Heartbeat:Connect(function() if not resetAllActive then return end local char = lp.Character if not char then return end local hum = char:FindFirstChild("Humanoid") local root = char:FindFirstChild("HumanoidRootPart") if not hum or not root then return end hum.PlatformStand = true local target = resetAllTargets[resetAllIndex] if not target or not target.Parent then local newTargets = {} for _, plr in pairs(Players:GetPlayers()) do if plr ~= lp and plr.Character then local r = plr.Character:FindFirstChild("HumanoidRootPart") if r then table.insert(newTargets, r) end end end if #newTargets == 0 then pararResetAll() return end resetAllTargets = newTargets if resetAllIndex > #resetAllTargets then resetAllIndex = 1 end target = resetAllTargets[resetAllIndex] end if target and target.Parent then root.CFrame = target.CFrame root.AssemblyLinearVelocity = NaNVec root.AssemblyAngularVelocity = NaNVec pcall(function() hum:Move(NaNVec) end) pcall(sethiddenproperty, root, "PhysicsRepRootPart", target) end if tick() - resetAllSwitchTime >= interval then if resetAllIndex < #resetAllTargets then resetAllIndex = resetAllIndex + 1 resetAllSwitchTime = tick() else resetAllSwitchTime = tick() task.wait(finalDelay) if resetAllActive then pararResetAll() notificar("Reset All: ciclo completo", Color3.fromRGB(200,200,0)) end return end end end) notificar("Reset All ativado (ciclo único)", Color3.fromRGB(0,200,0)) end -- ========== RESET ALL LOOP (INFINITO) ========== local function pararResetAllLoop() if resetAllLoopConn then resetAllLoopConn:Disconnect(); resetAllLoopConn = nil end resetAllLoopActive = false local char = lp.Character if char and char:FindFirstChild("Humanoid") then char.Humanoid.PlatformStand = false end if char and char:FindFirstChild("HumanoidRootPart") then local root = char.HumanoidRootPart pcall(sethiddenproperty, root, "PhysicsRepRootPart", nil) root.AssemblyLinearVelocity = Vector3.zero root.AssemblyAngularVelocity = Vector3.zero end notificar("Reset All Loop desativado", Color3.fromRGB(200,0,0)) end local function iniciarResetAllLoop() if resetAllLoopActive then pararResetAllLoop() end resetAllLoopTargets = {} for _, plr in pairs(Players:GetPlayers()) do if plr ~= lp and plr.Character then local r = plr.Character:FindFirstChild("HumanoidRootPart") if r then table.insert(resetAllLoopTargets, r) end end end if #resetAllLoopTargets == 0 then notificar("Nenhum outro jogador encontrado", Color3.fromRGB(200,100,0)) return end resetAllLoopActive = true resetAllLoopIndex = 1 resetAllLoopSwitchTime = tick() pcall(function() settings().Physics.AllowSleep = false settings().Physics.ThrottleAdjustTime = 0 lp.ReplicationFocus = lp.Character and lp.Character:FindFirstChild("HumanoidRootPart") if lp.Character then for _, part in pairs(lp.Character:GetDescendants()) do if part:IsA("BasePart") then part:SetNetworkOwner(lp) end end end end) local NaNVec = Vector3.new(0/0,0/0,0/0) resetAllLoopConn = RunService.Heartbeat:Connect(function() if not resetAllLoopActive then return end local char = lp.Character if not char then return end local hum = char:FindFirstChild("Humanoid") local root = char:FindFirstChild("HumanoidRootPart") if not hum or not root then return end hum.PlatformStand = true local novos = {} for _, plr in pairs(Players:GetPlayers()) do if plr ~= lp and plr.Character then local r = plr.Character:FindFirstChild("HumanoidRootPart") if r then table.insert(novos, r) end end end if #novos == 0 then pararResetAllLoop() return end resetAllLoopTargets = novos if resetAllLoopIndex > #resetAllLoopTargets then resetAllLoopIndex = 1 end if tick() - resetAllLoopSwitchTime >= interval then resetAllLoopIndex = resetAllLoopIndex % #resetAllLoopTargets + 1 resetAllLoopSwitchTime = tick() end local target = resetAllLoopTargets[resetAllLoopIndex] if target and target.Parent then root.CFrame = target.CFrame root.AssemblyLinearVelocity = NaNVec root.AssemblyAngularVelocity = NaNVec pcall(function() hum:Move(NaNVec) end) pcall(sethiddenproperty, root, "PhysicsRepRootPart", target) end end) notificar("Reset All Loop ativado (infinito)", Color3.fromRGB(0,200,0)) end -- ========== RESET TARGET (2 SEGUNDOS) CORRIGIDO ========== local function pararResetTarget() if resetTargetConn then resetTargetConn:Disconnect(); resetTargetConn = nil end if timeout then task.cancel(timeout); timeout = nil end resetTargetActive = false local char = lp.Character if char and char:FindFirstChild("Humanoid") then char.Humanoid.PlatformStand = false end if char and char:FindFirstChild("HumanoidRootPart") then local root = char.HumanoidRootPart pcall(sethiddenproperty, root, "PhysicsRepRootPart", nil) root.AssemblyLinearVelocity = Vector3.zero root.AssemblyAngularVelocity = Vector3.zero end currentTarget = nil notificar("Reset em alvo desativado", Color3.fromRGB(200,0,0)) end local function iniciarResetTarget(jogador) if resetTargetActive then pararResetTarget() end -- Aguarda o personagem do jogador existir if not lp.Character or not lp.Character:FindFirstChild("HumanoidRootPart") then notificar("Aguarde seu personagem carregar...", Color3.fromRGB(200,100,0)) return end currentTarget = jogador resetTargetActive = true pcall(function() settings().Physics.AllowSleep = false settings().Physics.ThrottleAdjustTime = 0 lp.ReplicationFocus = lp.Character and lp.Character:FindFirstChild("HumanoidRootPart") if lp.Character then for _, part in pairs(lp.Character:GetDescendants()) do if part:IsA("BasePart") then part:SetNetworkOwner(lp) end end end end) local NaNVec = Vector3.new(0/0,0/0,0/0) resetTargetConn = RunService.Heartbeat:Connect(function() if not resetTargetActive then return end -- Verifica se o alvo ainda existe e tem personagem if not currentTarget or not currentTarget.Parent or not currentTarget.Character then pararResetTarget() return end local char = lp.Character if not char then return end local hum = char:FindFirstChild("Humanoid") local root = char:FindFirstChild("HumanoidRootPart") if not hum or not root then return end local targetRoot = currentTarget.Character:FindFirstChild("HumanoidRootPart") if not targetRoot then return end hum.PlatformStand = true root.CFrame = targetRoot.CFrame root.AssemblyLinearVelocity = NaNVec root.AssemblyAngularVelocity = NaNVec pcall(function() hum:Move(NaNVec) end) pcall(sethiddenproperty, root, "PhysicsRepRootPart", targetRoot) end) timeout = task.delay(2, function() if resetTargetActive then pararResetTarget() notificar("Reset em "..jogador.Name.." desativado (2s)", Color3.fromRGB(200,100,0)) end end) notificar("Reset em "..jogador.Name.." ativado (2s)", Color3.fromRGB(0,200,0)) end -- ========== ANTI FLING ========== local function toggleAntiFling() antiFlingActive = not antiFlingActive if antiFlingActive then if antiFlingConn then antiFlingConn:Disconnect() end antiFlingConn = RunService.Stepped:Connect(function() for _, plr in pairs(Players:GetPlayers()) do if plr ~= lp and plr.Character then for _, part in pairs(plr.Character:GetDescendants()) do if part:IsA("BasePart") then part.CanCollide = false end end end end end) notificar("AntiFling ATIVADO (outros sem colisão)", Color3.fromRGB(0,200,0)) else if antiFlingConn then antiFlingConn:Disconnect(); antiFlingConn = nil end for _, plr in pairs(Players:GetPlayers()) do if plr ~= lp and plr.Character then for _, part in pairs(plr.Character:GetDescendants()) do if part:IsA("BasePart") then part.CanCollide = true end end end end notificar("AntiFling DESATIVADO", Color3.fromRGB(200,0,0)) end end -- ========== VIEW CORRIGIDO (DESATIVA QUANDO JOGADOR SAI) ========== local function pararView() if viewLoop then task.cancel(viewLoop) viewLoop = nil end if viewRemovingConn then viewRemovingConn:Disconnect() viewRemovingConn = nil end viewActive = false viewTarget = nil if originalCameraSubject and originalCameraSubject.Parent then Camera.CameraSubject = originalCameraSubject else local char = lp.Character if char and char:FindFirstChild("Humanoid") then Camera.CameraSubject = char.Humanoid end end if originalCameraType then Camera.CameraType = originalCameraType else Camera.CameraType = Enum.CameraType.Custom end notificar("View desativado, câmera restaurada.", Color3.fromRGB(200,0,0)) end local function iniciarView(jogador) if viewActive then pararView() end if not jogador then notificar("Jogador inválido", Color3.fromRGB(200,0,0)) return end originalCameraSubject = Camera.CameraSubject originalCameraType = Camera.CameraType viewTarget = jogador viewActive = true -- Desativa imediatamente se o jogador sair do jogo viewRemovingConn = jogador.AncestryChanged:Connect(function() if not jogador.Parent then pararView() end end) -- Também escuta o evento de saída local function onPlayerRemoving(player) if player == jogador then pararView() end end Players.PlayerRemoving:Connect(onPlayerRemoving) viewLoop = task.spawn(function() while viewActive and viewTarget == jogador do -- Verifica se o jogador ainda existe if not jogador.Parent then pararView() break end -- Verifica se o personagem existe if jogador.Character and jogador.Character:FindFirstChild("Humanoid") then local hum = jogador.Character.Humanoid Camera.CameraSubject = hum if Camera.CameraType ~= Enum.CameraType.Custom then Camera.CameraType = Enum.CameraType.Custom end else task.wait(0.5) end task.wait(1) -- verifica a cada 1 segundo (mais rápido) end end) notificar("View ativado: seguindo " .. jogador.DisplayName, Color3.fromRGB(0,200,0)) end -- ========== DESATIVAR TUDO ========== local function desativarTudo() if resetAllActive then pararResetAll() end if resetAllLoopActive then pararResetAllLoop() end if resetTargetActive then pararResetTarget() end if antiFlingActive then toggleAntiFling() end if viewActive then pararView() end notificar("Todos os comandos desativados", Color3.fromRGB(200,200,0)) end -- ========== TELEPORTE ========== local function teleportar(nome) local alvo = encontrarJogador(nome) if not alvo or not alvo.Character then notificar("Jogador não encontrado", Color3.fromRGB(200,0,0)) return end local char = lp.Character if not char then notificar("Aguarde", Color3.fromRGB(200,100,0)) return end local root = char:FindFirstChild("HumanoidRootPart") local targetRoot = alvo.Character:FindFirstChild("HumanoidRootPart") if not root or not targetRoot then return end root.CFrame = targetRoot.CFrame * CFrame.new(0,1.8,-1.2) root.AssemblyLinearVelocity = Vector3.zero root.AssemblyAngularVelocity = Vector3.zero pcall(sethiddenproperty, root, "PhysicsRepRootPart", targetRoot) task.wait(0.1) pcall(sethiddenproperty, root, "PhysicsRepRootPart", nil) notificar("Teleportado para "..alvo.DisplayName, Color3.fromRGB(0,200,0)) end -- ========== CRIAÇÃO DA GUI (UMA ÚNICA VEZ, NO COREGUI) ========== local screenGui = nil local targetBox = nil local commandsFrame = nil if CoreGui:FindFirstChild("AdminMenu") then screenGui = CoreGui:FindFirstChild("AdminMenu") local frame = screenGui:FindFirstChild("Frame") if frame then targetBox = frame:FindFirstChild("TextBox") commandsFrame = frame:FindFirstChild("ScrollingFrame") end else screenGui = Instance.new("ScreenGui") screenGui.Name = "AdminMenu" screenGui.Parent = CoreGui local menuFrame = Instance.new("Frame") menuFrame.Name = "Frame" menuFrame.Size = UDim2.new(0, 200, 0, 200) menuFrame.Position = UDim2.new(0.5, -100, 0.5, -100) menuFrame.BackgroundColor3 = Color3.fromRGB(30,30,30) menuFrame.BorderSizePixel = 0 menuFrame.Active = true menuFrame.Parent = screenGui local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0,8) corner.Parent = menuFrame local title = Instance.new("TextLabel") title.Size = UDim2.new(1,0,0,25) title.BackgroundColor3 = Color3.fromRGB(50,50,50) title.Text = "MENU ADMIN" title.TextColor3 = Color3.fromRGB(255,255,255) title.Font = Enum.Font.GothamBold title.TextSize = 14 title.Parent = menuFrame local dragBar = Instance.new("Frame") dragBar.Size = UDim2.new(1,0,0,20) dragBar.Position = UDim2.new(0,0,1,-20) dragBar.BackgroundColor3 = Color3.fromRGB(40,40,40) dragBar.Parent = menuFrame local dragText = Instance.new("TextLabel") dragText.Size = UDim2.new(1,0,1,0) dragText.BackgroundTransparency = 1 dragText.Text = "▼ Arraste ▼" dragText.TextColor3 = Color3.fromRGB(200,200,200) dragText.Font = Enum.Font.Gotham dragText.TextSize = 10 dragText.Parent = dragBar targetBox = Instance.new("TextBox") targetBox.Name = "TextBox" targetBox.Size = UDim2.new(0.9,0,0,25) targetBox.Position = UDim2.new(0.05,0,0,28) targetBox.BackgroundColor3 = Color3.fromRGB(20,20,20) targetBox.TextColor3 = Color3.fromRGB(255,255,255) targetBox.PlaceholderText = "Nome ou apelido" targetBox.Font = Enum.Font.Gotham targetBox.TextSize = 11 targetBox.ClearTextOnFocus = true targetBox.Parent = menuFrame commandsFrame = Instance.new("ScrollingFrame") commandsFrame.Name = "ScrollingFrame" commandsFrame.Size = UDim2.new(0.9,0,0,110) commandsFrame.Position = UDim2.new(0.05,0,0,58) commandsFrame.BackgroundColor3 = Color3.fromRGB(25,25,25) commandsFrame.BorderSizePixel = 0 commandsFrame.ScrollBarThickness = 4 commandsFrame.CanvasSize = UDim2.new(0,0,0,0) commandsFrame.AutomaticCanvasSize = Enum.AutomaticSize.Y commandsFrame.Parent = menuFrame local listLayout = Instance.new("UIListLayout") listLayout.SortOrder = Enum.SortOrder.LayoutOrder listLayout.Padding = UDim.new(0,4) listLayout.Parent = commandsFrame -- Arrastar local dragging = false local dragStart, startPos local function startDrag(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPos = menuFrame.Position end end local function onDrag(input) if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then local delta = input.Position - dragStart menuFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset+delta.X, startPos.Y.Scale, startPos.Y.Offset+delta.Y) end end local function endDrag(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = false end end title.InputBegan:Connect(startDrag) dragBar.InputBegan:Connect(startDrag) UserInputService.InputChanged:Connect(onDrag) UserInputService.InputEnded:Connect(endDrag) -- Notificar notificar = function(msg, cor) local notif = Instance.new("Frame") notif.Size = UDim2.new(0,200,0,40) notif.Position = UDim2.new(0.5,-100,0,50) notif.BackgroundColor3 = cor or Color3.fromRGB(0,0,0) notif.BackgroundTransparency = 0.3 notif.Parent = screenGui local text = Instance.new("TextLabel") text.Size = UDim2.new(1,0,1,0) text.BackgroundTransparency = 1 text.Text = msg text.TextColor3 = Color3.fromRGB(255,255,255) text.Font = Enum.Font.Gotham text.TextSize = 14 text.TextWrapped = true text.Parent = notif local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0,8) corner.Parent = notif game:GetService("TweenService"):Create(notif, TweenInfo.new(2, Enum.EasingStyle.Linear), {BackgroundTransparency = 1}):Play() task.wait(2.5) notif:Destroy() end -- Criar botões local function criarBotao(nome, callback) local btn = Instance.new("TextButton") btn.Size = UDim2.new(1,0,0,25) btn.Text = nome btn.BackgroundColor3 = Color3.fromRGB(60,60,60) btn.TextColor3 = Color3.fromRGB(255,255,255) btn.Font = Enum.Font.GothamBold btn.TextSize = 11 btn.Parent = commandsFrame btn.MouseButton1Click:Connect(callback) return btn end criarBotao("Reset All", function() if resetAllActive then pararResetAll() else iniciarResetAll() end end) criarBotao("Reset All Loop", function() if resetAllLoopActive then pararResetAllLoop() else iniciarResetAllLoop() end end) criarBotao("Reset", function() local nome = targetBox.Text if nome=="" then notificar("Digite um nome", Color3.fromRGB(200,100,0)) return end local alvo = encontrarJogador(nome) if not alvo then notificar("Jogador não encontrado", Color3.fromRGB(200,0,0)) return end if resetTargetActive and currentTarget == alvo then pararResetTarget() else iniciarResetTarget(alvo) end end) criarBotao("Goto", function() local nome = targetBox.Text if nome=="" then notificar("Digite um nome", Color3.fromRGB(200,100,0)) return end teleportar(nome) end) criarBotao("AntiFling", function() toggleAntiFling() end) criarBotao("View", function() local nome = targetBox.Text if nome=="" then notificar("Digite um nome", Color3.fromRGB(200,100,0)) return end local alvo = encontrarJogador(nome) if not alvo then notificar("Jogador não encontrado", Color3.fromRGB(200,0,0)) return end if viewActive and viewTarget == alvo then pararView() else iniciarView(alvo) end end) criarBotao("Desativar Tudo", function() desativarTudo() end) commandsFrame.CanvasSize = UDim2.new(0,0,0,0) end -- ========== INICIALIZAÇÃO ========== -- Comandos de chat lp.Chatted:Connect(function(msg) if not msg:sub(1,1)=="/" then return end local args = {} for palavra in msg:sub(2):gmatch("%S+") do table.insert(args, palavra:lower()) end if #args==0 then return end local cmd = args[1] if cmd=="goto" or cmd=="tp" then if not args[2] then notificar("Uso: /goto ", Color3.fromRGB(200,100,0)) return end teleportar(args[2]) elseif cmd=="reset" and (args[2]=="all" or not args[2]) or cmd=="re" and args[2]=="all" or cmd=="reall" then if resetAllActive then pararResetAll() else iniciarResetAll() end elseif cmd=="reset" and args[2]=="all" and args[3]=="loop" or cmd=="re" and args[2]=="all" and args[3]=="loop" or cmd=="reallloop" then if resetAllLoopActive then pararResetAllLoop() else iniciarResetAllLoop() end elseif cmd=="reset" and args[2] and args[2]~="all" then local alvo = encontrarJogador(args[2]) if not alvo then notificar("Jogador não encontrado", Color3.fromRGB(200,0,0)) return end if resetTargetActive and currentTarget == alvo then pararResetTarget() else iniciarResetTarget(alvo) end elseif cmd=="antifling" or cmd=="antihack" then toggleAntiFling() elseif cmd=="view" then if not args[2] then notificar("Uso: /view ", Color3.fromRGB(200,100,0)) return end local alvo = encontrarJogador(args[2]) if not alvo then notificar("Jogador não encontrado", Color3.fromRGB(200,0,0)) return end if viewActive and viewTarget == alvo then pararView() else iniciarView(alvo) end elseif cmd=="no" or cmd=="off" or cmd=="desativar" then desativarTudo() else notificar("Comandos: /goto, /reset all, /reset all loop, /reset , /antifling, /view, /off", Color3.fromRGB(200,100,0)) end end) notificar("Menu carregado (persistente). Use /reset para fling de 2 segundos.", Color3.fromRGB(0,200,0))