-- LocalScript local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local TweenService = game:GetService("TweenService") local player = Players.LocalPlayer local mouse = player:GetMouse() local ogpn = player.Name local simulationEnabled = true -- Variável para guardar o destaque visual atual local currentHighlight = nil -- Configurações da UI local uiSettings = { Position = UDim2.new(0.5, 0, 0.1, 0), Size = UDim2.new(0, 250, 0, 150), Color = Color3.fromRGB(30, 30, 30), BorderColor = Color3.fromRGB(100, 100, 100), AccentColor = Color3.fromRGB(0, 255, 100) } -- Configurações do Efeito Visual (Highlight) local highlightSettings = { FillColor = Color3.fromRGB(0, 255, 100), -- Cor do preenchimento (mesma da UI) FillTransparency = 0.6, -- Transparência do preenchimento OutlineColor = Color3.fromRGB(255, 255, 255), -- Cor da borda (branca) OutlineTransparency = 0, -- Transparência da borda DepthMode = Enum.HighlightDepthMode.AlwaysOnTop -- Visível através de paredes } -- Criação da UI local function createUI() local screenGui = Instance.new("ScreenGui") screenGui.Name = "NPCControlUI" screenGui.ResetOnSpawn = false screenGui.Parent = player:WaitForChild("PlayerGui") local mainFrame = Instance.new("Frame") mainFrame.Name = "MainFrame" mainFrame.Size = uiSettings.Size mainFrame.Position = uiSettings.Position mainFrame.BackgroundColor3 = uiSettings.Color mainFrame.BorderSizePixel = 0 mainFrame.Parent = screenGui local uiCorner = Instance.new("UICorner") uiCorner.CornerRadius = UDim.new(0, 8) uiCorner.Parent = mainFrame local uiStroke = Instance.new("UIStroke") uiStroke.Color = uiSettings.BorderColor uiStroke.Thickness = 2 uiStroke.Parent = mainFrame -- Título local titleLabel = Instance.new("TextLabel") titleLabel.Size = UDim2.new(1, 0, 0, 30) titleLabel.Position = UDim2.new(0, 0, 0, 0) titleLabel.BackgroundTransparency = 1 titleLabel.Text = "NPC Controller" titleLabel.TextColor3 = Color3.fromRGB(255, 255, 255) titleLabel.TextSize = 16 titleLabel.Font = Enum.Font.GothamBold titleLabel.Parent = mainFrame -- Botão de Toggle local toggleButton = Instance.new("TextButton") toggleButton.Size = UDim2.new(1, -20, 0, 40) toggleButton.Position = UDim2.new(0, 10, 0, 40) toggleButton.BackgroundColor3 = uiSettings.AccentColor toggleButton.Text = "Simulação: ON" toggleButton.TextColor3 = Color3.fromRGB(0, 0, 0) toggleButton.Font = Enum.Font.GothamBold toggleButton.TextSize = 14 toggleButton.Parent = mainFrame local toggleCorner = Instance.new("UICorner") toggleCorner.CornerRadius = UDim.new(0, 5) toggleCorner.Parent = toggleButton -- Status Label local statusLabel = Instance.new("TextLabel") statusLabel.Size = UDim2.new(1, -20, 0, 20) statusLabel.Position = UDim2.new(0, 10, 0, 90) statusLabel.BackgroundTransparency = 1 statusLabel.Text = "Status: Ativo" statusLabel.TextColor3 = Color3.fromRGB(0, 255, 100) -- Cor inicial correta statusLabel.TextSize = 12 statusLabel.Font = Enum.Font.Gotham statusLabel.Parent = mainFrame -- Botão Fechar local closeButton = Instance.new("TextButton") closeButton.Size = UDim2.new(0, 30, 0, 30) closeButton.Position = UDim2.new(1, -40, 0, 5) closeButton.BackgroundColor3 = Color3.fromRGB(200, 50, 50) closeButton.Text = "X" closeButton.TextColor3 = Color3.fromRGB(255, 255, 255) closeButton.Font = Enum.Font.GothamBold closeButton.TextSize = 16 closeButton.Parent = mainFrame local closeCorner = Instance.new("UICorner") closeCorner.CornerRadius = UDim.new(0, 5) closeCorner.Parent = closeButton -- Funções internas da UI local function updateUIState() if simulationEnabled then toggleButton.BackgroundColor3 = uiSettings.AccentColor toggleButton.Text = "Simulação: ON" statusLabel.Text = "Status: Ativo" statusLabel.TextColor3 = Color3.fromRGB(0, 255, 100) else toggleButton.BackgroundColor3 = Color3.fromRGB(200, 50, 50) toggleButton.Text = "Simulação: OFF" statusLabel.Text = "Status: Inativo" statusLabel.TextColor3 = Color3.fromRGB(200, 50, 50) end end -- Conexões toggleButton.MouseButton1Click:Connect(function() simulationEnabled = not simulationEnabled updateUIState() end) closeButton.MouseButton1Click:Connect(function() screenGui:Destroy() end) -- Animação de entrada local tweenInfo = TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out) local targetPosition = uiSettings.Position local initialPosition = UDim2.new(targetPosition.X.Scale, targetPosition.X.Offset, 0, -150) mainFrame.Position = initialPosition local tween = TweenService:Create(mainFrame, tweenInfo, {Position = targetPosition}) tween:Play() return screenGui, toggleButton end -- Inicializa a UI local ui, toggleBtn = createUI() -- Função para definir o raio de simulação local function setSimulationRadius() if simulationEnabled then local success, err = pcall(function() player.MaximumSimulationRadius = math.huge if game:GetService("RunService"):IsServer() then return end -- setsisulationradius é geralmente uma função de exploit, mantendo o pcall if typeof(setsimulationradius) == "function" then setsimulationradius(math.huge) end end) end end -- Função MODIFICADA para definir o personagem e adicionar efeito visual local function setCharacter(character) if not character or not character:FindFirstChild("Humanoid") then return end -- Tenta definir o personagem local success, err = pcall(function() player.Character = character workspace.CurrentCamera.CameraSubject = character -- Gerenciamento do Efeito Visual (Highlight) -- 1. Remove o destaque antigo se existir if currentHighlight then currentHighlight:Destroy() currentHighlight = nil end -- 2. Cria um novo destaque no personagem atual local highlight = Instance.new("Highlight") highlight.Name = "ControlHighlight" highlight.FillColor = highlightSettings.FillColor highlight.FillTransparency = highlightSettings.FillTransparency highlight.OutlineColor = highlightSettings.OutlineColor highlight.OutlineTransparency = highlightSettings.OutlineTransparency highlight.DepthMode = highlightSettings.DepthMode highlight.Adornee = character -- Define o alvo do destaque highlight.Parent = character -- Coloca o destaque dentro do personagem currentHighlight = highlight -- Salva a referência para remover depois -- Desabilita animação padrão para evitar conflitos de controle if character:FindFirstChild("Animate") then character.Animate.Disabled = true task.wait(0.1) character.Animate.Disabled = false end end) if not success then warn("Erro ao trocar personagem ou aplicar efeito:", err) end end -- Função para encontrar o NPC mais próximo local function getNearestNPC() local character = player.Character if not character or not character:FindFirstChild("HumanoidRootPart") then return nil end local myPos = character.HumanoidRootPart.Position local closestNPC = nil local shortestDistance = math.huge for _, obj in pairs(workspace:GetChildren()) do if obj:IsA("Model") and obj:FindFirstChild("Humanoid") and obj ~= character then local rootPart = obj:FindFirstChild("HumanoidRootPart") if rootPart then local distance = (myPos - rootPart.Position).Magnitude if distance < shortestDistance then shortestDistance = distance closestNPC = obj end end end end return closestNPC end -- Loop para definir o raio de simulação (Otimizado) task.spawn(function() while task.wait(1) do setSimulationRadius() end end) -- Conexão do botão do mouse (Ctrl + Clique) mouse.Button1Down:Connect(function() if UserInputService:IsKeyDown(Enum.KeyCode.LeftControl) and mouse.Target and mouse.Target.Parent.Name ~= "Workspace" then local humanoid = mouse.Target.Parent:FindFirstChildOfClass("Humanoid") if humanoid then setCharacter(mouse.Target.Parent) end end end) -- Conexão da tecla do teclado UserInputService.InputBegan:Connect(function(input, gameProcessed) if gameProcessed then return end if input.KeyCode == Enum.KeyCode.X then simulationEnabled = not simulationEnabled updateUIState() print("Simulação " .. (simulationEnabled and "ativada" or "desativada")) elseif input.KeyCode == Enum.KeyCode.V then -- Tecla V: Seleciona o mais próximo local nearest = getNearestNPC() if nearest then print("Selecionando NPC mais próximo: " .. nearest.Name) setCharacter(nearest) else print("Nenhum NPC encontrado por perto.") end elseif input.KeyCode == Enum.KeyCode.Minus then -- Tecla Hífen: Volta pro original for _, descendant in pairs(game.Workspace:GetDescendants()) do if descendant.Name == ogpn and descendant:IsA("Model") then setCharacter(descendant) break end end elseif input.KeyCode == Enum.KeyCode.Insert then -- Abre/Fecha a UI if ui then ui.Enabled = not ui.Enabled end end end) -- Função auxiliar para atualizar UI fora do loop de criação function updateUIState() if toggleBtn and ui:FindFirstChild("MainFrame") then local statusLabel = ui.MainFrame:FindFirstChild("StatusLabel") if simulationEnabled then toggleBtn.BackgroundColor3 = uiSettings.AccentColor toggleBtn.Text = "Simulação: ON" if statusLabel then statusLabel.Text = "Status: Ativo" statusLabel.TextColor3 = Color3.fromRGB(0, 255, 100) end else toggleBtn.BackgroundColor3 = Color3.fromRGB(200, 50, 50) toggleBtn.Text = "Simulação: OFF" if statusLabel then statusLabel.Text = "Status: Inativo" statusLabel.TextColor3 = Color3.fromRGB(200, 50, 50) end end end end