-- 创建主悬浮球GUI local player = game:GetService("Players").LocalPlayer local playerGui = player:WaitForChild("PlayerGui") local RunService = game:GetService("RunService") -- 创建屏幕GUI local screenGui = Instance.new("ScreenGui") screenGui.Name = "happyGui" screenGui.ResetOnSpawn = false screenGui.Parent = playerGui -- 主悬浮球 local dragBall = Instance.new("TextButton") dragBall.Name = "DragBall" dragBall.Size = UDim2.new(0, 60, 0, 60) dragBall.Position = UDim2.new(0, 10, 0, 10) dragBall.BackgroundColor3 = Color3.new(0, 0, 0) dragBall.BorderColor3 = Color3.new(1, 0.5, 0) dragBall.BorderSizePixel = 2 dragBall.Active = true dragBall.Draggable = true dragBall.Text = "传送" dragBall.TextColor3 = Color3.new(1, 1, 1) dragBall.ZIndex = 10 dragBall.Parent = screenGui -- 主窗口 local mainWindow = Instance.new("Frame") mainWindow.Name = "MainWindow" mainWindow.Size = UDim2.new(0, 300, 0, 400) mainWindow.BackgroundColor3 = Color3.new(0, 0, 0) mainWindow.BorderColor3 = Color3.new(1, 0.5, 0) mainWindow.BorderSizePixel = 2 mainWindow.Visible = false mainWindow.ZIndex = 20 mainWindow.Parent = screenGui -- 窗口标题 local title = Instance.new("TextLabel") title.Name = "Title" title.Size = UDim2.new(1, 0, 0, 30) title.BackgroundTransparency = 1 title.Text = "玩家坐标: (0, 0, 0)" title.TextColor3 = Color3.new(1, 1, 1) title.Font = Enum.Font.SourceSansBold title.ZIndex = 21 title.Parent = mainWindow -- 坐标输入 local xInput = Instance.new("TextBox") xInput.Name = "XInput" xInput.Size = UDim2.new(0.3, -5, 0, 30) xInput.Position = UDim2.new(0.05, 0, 0.1, 0) xInput.BackgroundColor3 = Color3.new(0.05, 0.05, 0.05) xInput.BorderColor3 = Color3.new(1, 0.5, 0) xInput.BorderSizePixel = 1 xInput.TextColor3 = Color3.new(1, 1, 1) xInput.PlaceholderText = "X" xInput.Text = "" xInput.ZIndex = 22 xInput.Parent = mainWindow local yInput = Instance.new("TextBox") yInput.Name = "YInput" yInput.Size = UDim2.new(0.3, -5, 0, 30) yInput.Position = UDim2.new(0.35, 0, 0.1, 0) yInput.BackgroundColor3 = Color3.new(0.05, 0.05, 0.05) yInput.BorderColor3 = Color3.new(1, 0.5, 0) yInput.BorderSizePixel = 1 yInput.TextColor3 = Color3.new(1, 1, 1) yInput.PlaceholderText = "Y" yInput.Text = "" yInput.ZIndex = 22 yInput.Parent = mainWindow local zInput = Instance.new("TextBox") zInput.Name = "ZInput" zInput.Size = UDim2.new(0.3, -5, 0, 30) zInput.Position = UDim2.new(0.65, 0, 0.1, 0) zInput.BackgroundColor3 = Color3.new(0.05, 0.05, 0.05) zInput.BorderColor3 = Color3.new(1, 0.5, 0) zInput.BorderSizePixel = 1 zInput.TextColor3 = Color3.new(1, 1, 1) zInput.PlaceholderText = "Z" zInput.Text = "" zInput.ZIndex = 22 zInput.Parent = mainWindow -- 功能按钮 local copyCoordsBtn = Instance.new("TextButton") copyCoordsBtn.Name = "CopyCoordsButton" copyCoordsBtn.Size = UDim2.new(0.4, 0, 0, 30) copyCoordsBtn.Position = UDim2.new(0.05, 0, 0.2, 0) copyCoordsBtn.BackgroundColor3 = Color3.new(0.05, 0.05, 0.05) copyCoordsBtn.BorderColor3 = Color3.new(1, 0.5, 0) copyCoordsBtn.BorderSizePixel = 1 copyCoordsBtn.TextColor3 = Color3.new(1, 1, 1) copyCoordsBtn.Text = "复制坐标" copyCoordsBtn.ZIndex = 21 copyCoordsBtn.Parent = mainWindow local teleportBtn = Instance.new("TextButton") teleportBtn.Name = "TeleportButton" teleportBtn.Size = UDim2.new(0.4, 0, 0, 30) teleportBtn.Position = UDim2.new(0.55, 0, 0.2, 0) teleportBtn.BackgroundColor3 = Color3.new(0.05, 0.05, 0.05) teleportBtn.BorderColor3 = Color3.new(1, 0.5, 0) teleportBtn.BorderSizePixel = 1 teleportBtn.TextColor3 = Color3.new(1, 1, 1) teleportBtn.Text = "传送" teleportBtn.ZIndex = 21 teleportBtn.Parent = mainWindow local saveCurrentBtn = Instance.new("TextButton") saveCurrentBtn.Name = "SaveCurrentButton" saveCurrentBtn.Size = UDim2.new(0.4, 0, 0, 30) saveCurrentBtn.Position = UDim2.new(0.05, 0, 0.3, 0) saveCurrentBtn.BackgroundColor3 = Color3.new(0.05, 0.05, 0.05) saveCurrentBtn.BorderColor3 = Color3.new(1, 0.5, 0) saveCurrentBtn.BorderSizePixel = 1 saveCurrentBtn.TextColor3 = Color3.new(1, 1, 1) saveCurrentBtn.Text = "保存位置" saveCurrentBtn.ZIndex = 21 saveCurrentBtn.Parent = mainWindow local trackBtn = Instance.new("TextButton") trackBtn.Name = "TrackButton" trackBtn.Size = UDim2.new(0.4, 0, 0, 30) trackBtn.Position = UDim2.new(0.55, 0, 0.3, 0) trackBtn.BackgroundColor3 = Color3.new(0.05, 0.05, 0.05) trackBtn.BorderColor3 = Color3.new(1, 0.5, 0) trackBtn.BorderSizePixel = 1 trackBtn.TextColor3 = Color3.new(1, 1, 1) trackBtn.Text = "启动透视" trackBtn.ZIndex = 21 trackBtn.Parent = mainWindow local playerListBtn = Instance.new("TextButton") playerListBtn.Name = "PlayerListButton" playerListBtn.Size = UDim2.new(0.4, 0, 0, 30) playerListBtn.Position = UDim2.new(0.05, 0, 0.4, 0) playerListBtn.BackgroundColor3 = Color3.new(0.05, 0.05, 0.05) playerListBtn.BorderColor3 = Color3.new(1, 0.5, 0) playerListBtn.BorderSizePixel = 1 playerListBtn.TextColor3 = Color3.new(1, 1, 1) playerListBtn.Text = "玩家列表" playerListBtn.ZIndex = 21 playerListBtn.Parent = mainWindow local randomTeleportBtn = Instance.new("TextButton") randomTeleportBtn.Name = "RandomTeleportButton" randomTeleportBtn.Size = UDim2.new(0.4, 0, 0, 30) randomTeleportBtn.Position = UDim2.new(0.55, 0, 0.4, 0) randomTeleportBtn.BackgroundColor3 = Color3.new(0.05, 0.05, 0.05) randomTeleportBtn.BorderColor3 = Color3.new(1, 0.5, 0) randomTeleportBtn.BorderSizePixel = 1 randomTeleportBtn.TextColor3 = Color3.new(1, 1, 1) randomTeleportBtn.Text = "随机传送" randomTeleportBtn.ZIndex = 21 randomTeleportBtn.Parent = mainWindow -- 保存的坐标列表 local savedCoordsList = Instance.new("ScrollingFrame") savedCoordsList.Name = "SavedCoordsList" savedCoordsList.Size = UDim2.new(0.9, 0, 0.4, 0) savedCoordsList.Position = UDim2.new(0.05, 0, 0.5, 0) savedCoordsList.BackgroundColor3 = Color3.new(0.02, 0.02, 0.02) savedCoordsList.BorderColor3 = Color3.new(1, 0.5, 0) savedCoordsList.BorderSizePixel = 1 savedCoordsList.CanvasSize = UDim2.new(0, 0, 0, 0) savedCoordsList.ScrollBarThickness = 5 savedCoordsList.ZIndex = 22 savedCoordsList.Parent = mainWindow -- 玩家列表窗口 local playerListWindow = Instance.new("Frame") playerListWindow.Name = "PlayerListWindow" playerListWindow.Size = UDim2.new(0, 300, 0, 400) playerListWindow.BackgroundColor3 = Color3.new(0, 0, 0) playerListWindow.BorderColor3 = Color3.new(1, 0.5, 0) playerListWindow.BorderSizePixel = 2 playerListWindow.Visible = false playerListWindow.ZIndex = 30 playerListWindow.Parent = screenGui local playerListTitle = Instance.new("TextLabel") playerListTitle.Name = "Title" playerListTitle.Size = UDim2.new(1, 0, 0, 30) playerListTitle.BackgroundTransparency = 1 playerListTitle.Text = "玩家列表" playerListTitle.TextColor3 = Color3.new(1, 1, 1) playerListTitle.Font = Enum.Font.SourceSansBold playerListTitle.ZIndex = 31 playerListTitle.Parent = playerListWindow local closePlayerListBtn = Instance.new("TextButton") closePlayerListBtn.Name = "CloseButton" closePlayerListBtn.Size = UDim2.new(0, 30, 0, 30) closePlayerListBtn.Position = UDim2.new(1, -30, 0, 0) closePlayerListBtn.BackgroundColor3 = Color3.new(0.05, 0.05, 0.05) closePlayerListBtn.BorderColor3 = Color3.new(1, 0.5, 0) closePlayerListBtn.BorderSizePixel = 1 closePlayerListBtn.TextColor3 = Color3.new(1, 1, 1) closePlayerListBtn.Text = "X" closePlayerListBtn.ZIndex = 31 closePlayerListBtn.Parent = playerListWindow local playerList = Instance.new("ScrollingFrame") playerList.Name = "PlayerList" playerList.Size = UDim2.new(1, 0, 1, -40) playerList.Position = UDim2.new(0, 0, 0, 40) playerList.BackgroundTransparency = 1 playerList.CanvasSize = UDim2.new(0, 0, 0, 0) playerList.ScrollBarThickness = 5 playerList.ZIndex = 31 playerList.Parent = playerListWindow -- 存储变量 local savedCoords = {} local randomTeleporting = false local tracking = false local espHighlights = {} local trackConnections = {} -- 显示通知 local function showNotification(text) local notification = Instance.new("TextLabel") notification.Name = "Notification" notification.Size = UDim2.new(0, 200, 0, 30) notification.Position = UDim2.new(0.5, -100, 0, 10) notification.BackgroundColor3 = Color3.new(0, 0, 0) notification.BorderColor3 = Color3.new(1, 0.5, 0) notification.Text = text notification.TextColor3 = Color3.new(1, 1, 1) notification.ZIndex = 50 notification.Parent = screenGui spawn(function() for i = 1, 10 do notification.BackgroundTransparency = i/10 notification.TextTransparency = i/10 task.wait(0.1) end notification:Destroy() end) end -- 更新玩家坐标显示 local function updatePlayerPosition() local character = player.Character if character and character:FindFirstChild("HumanoidRootPart") then local position = character.HumanoidRootPart.Position title.Text = string.format("玩家坐标: (%.1f, %.1f, %.1f)", position.X, position.Y, position.Z) xInput.Text = string.format("%.1f", position.X) yInput.Text = string.format("%.1f", position.Y) zInput.Text = string.format("%.1f", position.Z) end end -- 传送玩家到坐标 local function teleportToPosition(position) local character = player.Character if character and character:FindFirstChild("HumanoidRootPart") then character.HumanoidRootPart.CFrame = CFrame.new(position) end end -- 解析坐标 local function parseCoordinates() local x = tonumber(xInput.Text) or 0 local y = tonumber(yInput.Text) or 0 local z = tonumber(zInput.Text) or 0 return Vector3.new(x, y, z) end -- 复制到剪贴板 local function copyToClipboard(text) pcall(function() local clip = setclipboard or toclipboard or set_clipboard or (Clipboard and Clipboard.set) if clip then clip(text) showNotification("坐标已复制: "..text) else xInput.Text = text xInput:CaptureFocus() showNotification("请手动复制: "..text) end end) end -- 更新保存的坐标列表 local function updateSavedCoordsList() savedCoordsList:ClearAllChildren() savedCoordsList.CanvasSize = UDim2.new(0, 0, 0, #savedCoords * 30) for i, coord in ipairs(savedCoords) do local frame = Instance.new("Frame") frame.Size = UDim2.new(1, 0, 0, 25) frame.Position = UDim2.new(0, 0, 0, (i-1)*30) frame.BackgroundColor3 = i % 2 == 0 and Color3.new(0.05, 0.05, 0.05) or Color3.new(0.02, 0.02, 0.02) frame.BorderColor3 = Color3.new(1, 0.5, 0) frame.BorderSizePixel = 1 frame.ZIndex = 23 frame.Parent = savedCoordsList local coordText = Instance.new("TextLabel") coordText.Size = UDim2.new(0.5, 0, 1, 0) coordText.BackgroundTransparency = 1 coordText.Text = string.format("%d. (%.1f, %.1f, %.1f)", i, coord.X, coord.Y, coord.Z) coordText.TextColor3 = Color3.new(1, 1, 1) coordText.ZIndex = 24 coordText.Parent = frame local teleportBtn = Instance.new("TextButton") teleportBtn.Size = UDim2.new(0.2, 0, 0.8, 0) teleportBtn.Position = UDim2.new(0.5, 0, 0.1, 0) teleportBtn.BackgroundColor3 = Color3.new(0.05, 0.05, 0.05) teleportBtn.BorderColor3 = Color3.new(1, 0.5, 0) teleportBtn.BorderSizePixel = 1 teleportBtn.TextColor3 = Color3.new(1, 1, 1) teleportBtn.Text = "传送" teleportBtn.ZIndex = 24 teleportBtn.Parent = frame local deleteBtn = Instance.new("TextButton") deleteBtn.Size = UDim2.new(0.2, 0, 0.8, 0) deleteBtn.Position = UDim2.new(0.7, 0, 0.1, 0) deleteBtn.BackgroundColor3 = Color3.new(0.08, 0.03, 0) deleteBtn.BorderColor3 = Color3.new(1, 0.5, 0) deleteBtn.BorderSizePixel = 1 deleteBtn.TextColor3 = Color3.new(1, 1, 1) deleteBtn.Text = "删除" deleteBtn.ZIndex = 24 deleteBtn.Parent = frame teleportBtn.MouseButton1Click:Connect(function() teleportToPosition(coord) showNotification("已传送到保存的位置") end) deleteBtn.MouseButton1Click:Connect(function() table.remove(savedCoords, i) updateSavedCoordsList() showNotification("位置已删除") end) end end -- 创建高亮 local function createBodyHighlight(character, isPlayer) if not character then return nil end local highlight = Instance.new("Highlight") highlight.Name = "ESPHighlight" highlight.Adornee = character highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop highlight.FillTransparency = 1 highlight.OutlineTransparency = 0 if isPlayer then local otherPlayer = game:GetService("Players"):GetPlayerFromCharacter(character) if otherPlayer then if otherPlayer.Team then highlight.OutlineColor = otherPlayer.Team.TeamColor.Color else highlight.OutlineColor = Color3.new(0, 1, 0) end end else local humanoid = character:FindFirstChild("Humanoid") if humanoid then if humanoid.Health > 0 then highlight.OutlineColor = Color3.new(1, 0, 0) else highlight.OutlineColor = Color3.new(0.5, 0.5, 0.5) end else highlight.OutlineColor = Color3.new(1, 1, 0) end end highlight.Parent = character return highlight end -- 清除高亮 local function clearAllHighlights() for character, highlight in pairs(espHighlights) do if highlight and highlight.Parent then highlight:Destroy() end end espHighlights = {} end -- 更新高亮 local function updateHighlights() if not tracking then clearAllHighlights() return end local players = game:GetService("Players"):GetPlayers() for _, otherPlayer in ipairs(players) do if otherPlayer ~= player then local character = otherPlayer.Character if character and not espHighlights[character] then local highlight = createBodyHighlight(character, true) if highlight then espHighlights[character] = highlight end end end end for _, npc in ipairs(workspace:GetDescendants()) do if npc:IsA("Model") and npc:FindFirstChild("Humanoid") then local isPlayer = false pcall(function() isPlayer = npc:FindFirstChildOfClass("Player") ~= nil end) if not isPlayer and not espHighlights[npc] then local highlight = createBodyHighlight(npc, false) if highlight then espHighlights[npc] = highlight end end end end for character, highlight in pairs(espHighlights) do if not character or not character.Parent or not character:FindFirstChild("Humanoid") then if highlight and highlight.Parent then highlight:Destroy() end espHighlights[character] = nil end end end -- 随机传送 local function randomTeleportAllEntities() while randomTeleporting do local players = game:GetService("Players"):GetPlayers() for _, otherPlayer in ipairs(players) do if otherPlayer ~= player then pcall(function() local character = otherPlayer.Character if character and character:FindFirstChild("HumanoidRootPart") then local x = math.random(-500, 500) local y = math.random(0, 100) local z = math.random(-500, 500) character.HumanoidRootPart.CFrame = CFrame.new(x, y, z) end end) end end for _, entity in ipairs(workspace:GetDescendants()) do if entity:IsA("Model") and entity:FindFirstChild("HumanoidRootPart") then local isPlayer = false pcall(function() isPlayer = entity:FindFirstChildOfClass("Player") ~= nil end) if not isPlayer then pcall(function() local x = math.random(-500, 500) local y = math.random(0, 100) local z = math.random(-500, 500) entity.HumanoidRootPart.CFrame = CFrame.new(x, y, z) end) end end end task.wait(0.1) end end -- 定位功能 local function trackPlayersAndNPCs() for _, connection in pairs(trackConnections) do connection:Disconnect() end trackConnections = {} if not tracking then clearAllHighlights() return end local updateConnection updateConnection = RunService.Heartbeat:Connect(function() if not tracking then updateConnection:Disconnect() clearAllHighlights() return end updateHighlights() end) table.insert(trackConnections, updateConnection) local playerAddedConnection = game:GetService("Players").PlayerAdded:Connect(function(otherPlayer) if tracking then local characterAddedConnection = otherPlayer.CharacterAdded:Connect(function(character) if tracking then task.wait(1) updateHighlights() end end) table.insert(trackConnections, characterAddedConnection) end end) table.insert(trackConnections, playerAddedConnection) local players = game:GetService("Players"):GetPlayers() for _, otherPlayer in ipairs(players) do if otherPlayer ~= player then local characterAddedConnection = otherPlayer.CharacterAdded:Connect(function(character) if tracking then task.wait(1) updateHighlights() end end) table.insert(trackConnections, characterAddedConnection) end end updateHighlights() end -- 更新玩家列表 local function updatePlayerList() playerList:ClearAllChildren() local players = game:GetService("Players"):GetPlayers() playerList.CanvasSize = UDim2.new(0, 0, 0, #players * 40) for i, otherPlayer in ipairs(players) do local frame = Instance.new("Frame") frame.Size = UDim2.new(1, -10, 0, 35) frame.Position = UDim2.new(0, 5, 0, (i-1)*40) frame.BackgroundColor3 = i % 2 == 0 and Color3.new(0.05, 0.05, 0.05) or Color3.new(0.02, 0.02, 0.02) frame.BorderColor3 = Color3.new(1, 0.5, 0) frame.BorderSizePixel = 1 frame.ZIndex = 32 frame.Parent = playerList local nameLabel = Instance.new("TextLabel") nameLabel.Size = UDim2.new(0.5, 0, 1, 0) nameLabel.BackgroundTransparency = 1 nameLabel.Text = otherPlayer.Name nameLabel.TextColor3 = Color3.new(1, 1, 1) nameLabel.TextXAlignment = Enum.TextXAlignment.Left nameLabel.ZIndex = 33 nameLabel.Parent = frame local teleportBtn = Instance.new("TextButton") teleportBtn.Size = UDim2.new(0.4, 0, 0.7, 0) teleportBtn.Position = UDim2.new(0.55, 0, 0.15, 0) teleportBtn.BackgroundColor3 = Color3.new(0.05, 0.05, 0.05) teleportBtn.BorderColor3 = Color3.new(1, 0.5, 0) teleportBtn.BorderSizePixel = 1 teleportBtn.TextColor3 = Color3.new(1, 1, 1) teleportBtn.Text = "传送" teleportBtn.ZIndex = 33 teleportBtn.Parent = frame teleportBtn.MouseButton1Click:Connect(function() local character = otherPlayer.Character if character and character:FindFirstChild("HumanoidRootPart") then teleportToPosition(character.HumanoidRootPart.Position) showNotification("已传送到 "..otherPlayer.Name) end end) end end -- 事件处理 dragBall.MouseButton1Click:Connect(function() mainWindow.Visible = not mainWindow.Visible if mainWindow.Visible then updatePlayerPosition() updateSavedCoordsList() end end) copyCoordsBtn.MouseButton1Click:Connect(function() local x = xInput.Text or "0" local y = yInput.Text or "0" local z = zInput.Text or "0" copyToClipboard(x.." "..y.." "..z) end) teleportBtn.MouseButton1Click:Connect(function() teleportToPosition(parseCoordinates()) showNotification("已传送到指定坐标") end) saveCurrentBtn.MouseButton1Click:Connect(function() local character = player.Character if character and character:FindFirstChild("HumanoidRootPart") then local position = character.HumanoidRootPart.Position if #savedCoords >= 100 then table.remove(savedCoords, 1) end table.insert(savedCoords, position) updateSavedCoordsList() showNotification("当前位置已保存") else showNotification("无法保存: 角色不存在") end end) trackBtn.MouseButton1Click:Connect(function() tracking = not tracking trackBtn.Text = tracking and "停止透视" or "启动透视" if tracking then showNotification("透视定位已开启") trackPlayersAndNPCs() else showNotification("透视定位已关闭") clearAllHighlights() for _, connection in pairs(trackConnections) do connection:Disconnect() end trackConnections = {} end end) playerListBtn.MouseButton1Click:Connect(function() playerListWindow.Visible = true updatePlayerList() end) randomTeleportBtn.MouseButton1Click:Connect(function() randomTeleporting = not randomTeleporting randomTeleportBtn.Text = randomTeleporting and "停止传送" or "随机传送" if randomTeleporting then showNotification("随机传送已开启") spawn(randomTeleportAllEntities) else showNotification("随机传送已停止") end end) closePlayerListBtn.MouseButton1Click:Connect(function() playerListWindow.Visible = false end) -- 持续更新 spawn(function() while true do if mainWindow.Visible then updatePlayerPosition() end task.wait(0.1) end end) -- 窗口跟随 spawn(function() while true do if mainWindow.Visible then local ballPos = dragBall.AbsolutePosition mainWindow.Position = UDim2.new(0, ballPos.X + 70, 0, ballPos.Y) end if playerListWindow.Visible then playerListWindow.Position = UDim2.new(0.5, -150, 0.5, -200) end task.wait(0.1) end end) showNotification("happyGui传送脚本已加载!")