Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- -- Create ScreenGui
- local screenGui = Instance.new("ScreenGui")
- screenGui.Parent = player:FindFirstChild("PlayerGui")
- -- Create Main Frame
- local mainFrame = Instance.new("Frame")
- mainFrame.Size = UDim2.new(0.4, 0, 0.3, 0)
- mainFrame.Position = UDim2.new(0.3, 0, 0.3, 0)
- mainFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- mainFrame.BorderSizePixel = 2
- mainFrame.Parent = screenGui
- -- Create Close (X) Button
- local closeButton = Instance.new("TextButton")
- closeButton.Size = UDim2.new(0.15, 0, 0.2, 0)
- closeButton.Position = UDim2.new(0.85, 0, 0, 0)
- closeButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
- closeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- closeButton.Text = "X"
- closeButton.TextScaled = true
- closeButton.Parent = mainFrame
- -- Create Show (✔) Button
- local showButton = Instance.new("TextButton")
- showButton.Size = UDim2.new(0.15, 0, 0.1, 0)
- showButton.Position = UDim2.new(0.425, 0, 0.65, 0)
- showButton.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
- showButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- showButton.Text = "✔"
- showButton.TextScaled = true
- showButton.Visible = false
- showButton.Parent = screenGui
- -- Create Coordinate Label
- local coordinateLabel = Instance.new("TextLabel")
- coordinateLabel.Size = UDim2.new(0.8, 0, 0.2, 0)
- coordinateLabel.Position = UDim2.new(0.1, 0, 0.2, 0)
- coordinateLabel.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- coordinateLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- coordinateLabel.Text = "0, 0, 0"
- coordinateLabel.TextScaled = true
- coordinateLabel.Parent = mainFrame
- -- Create Generate Button
- local generateButton = Instance.new("TextButton")
- generateButton.Size = UDim2.new(0.4, 0, 0.2, 0)
- generateButton.Position = UDim2.new(0.05, 0, 0.6, 0)
- generateButton.BackgroundColor3 = Color3.fromRGB(0, 150, 255)
- generateButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- generateButton.Text = "Generate"
- generateButton.TextScaled = true
- generateButton.Parent = mainFrame
- -- Create Copy Button
- local copyButton = Instance.new("TextButton")
- copyButton.Size = UDim2.new(0.4, 0, 0.2, 0)
- copyButton.Position = UDim2.new(0.55, 0, 0.6, 0)
- copyButton.BackgroundColor3 = Color3.fromRGB(0, 255, 150)
- copyButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- copyButton.Text = "Copy"
- copyButton.TextScaled = true
- copyButton.Parent = mainFrame
- -- Function to update coordinates
- local function updateCoordinates()
- if character and character:FindFirstChild("HumanoidRootPart") then
- local position = character.HumanoidRootPart.Position
- local coords = string.format("%d, %d, %d", position.X, position.Y, position.Z)
- coordinateLabel.Text = coords
- end
- end
- -- Function to copy coordinates
- local function copyCoordinates()
- if coordinateLabel.Text ~= "0, 0, 0" then
- setclipboard(coordinateLabel.Text) -- Copies text
- end
- end
- -- Function to hide GUI
- local function hideGUI()
- mainFrame.Visible = false
- showButton.Visible = true
- end
- -- Function to show GUI
- local function showGUI()
- mainFrame.Visible = true
- showButton.Visible = false
- end
- -- Connect buttons
- generateButton.MouseButton1Click:Connect(updateCoordinates)
- copyButton.MouseButton1Click:Connect(copyCoordinates)
- closeButton.MouseButton1Click:Connect(hideGUI)
- showButton.MouseButton1Click:Connect(showGUI)
Add Comment
Please, Sign In to add comment