Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- 📋 COPIAR USERID DO PLAYER
- local Players = game:GetService("Players")
- local player = Players.LocalPlayer
- local gui = Instance.new("ScreenGui")
- gui.ResetOnSpawn = false
- gui.Parent = player:WaitForChild("PlayerGui")
- local frame = Instance.new("Frame", gui)
- frame.Size = UDim2.fromScale(0.3, 0.2)
- frame.Position = UDim2.fromScale(0.35, 0.4)
- frame.BackgroundColor3 = Color3.fromRGB(30,30,30)
- frame.BorderSizePixel = 0
- frame.Active = true
- frame.Draggable = true
- local title = Instance.new("TextLabel", frame)
- title.Size = UDim2.fromScale(1, 0.3)
- title.Text = "SEU USER ID"
- title.TextScaled = true
- title.BackgroundTransparency = 1
- title.TextColor3 = Color3.new(1,1,1)
- local box = Instance.new("TextBox", frame)
- box.Size = UDim2.fromScale(0.9, 0.3)
- box.Position = UDim2.fromScale(0.05, 0.35)
- box.Text = tostring(player.UserId)
- box.TextScaled = true
- box.ClearTextOnFocus = false
- box.BackgroundColor3 = Color3.fromRGB(45,45,45)
- box.TextColor3 = Color3.new(1,1,1)
- local copyBtn = Instance.new("TextButton", frame)
- copyBtn.Size = UDim2.fromScale(0.9, 0.25)
- copyBtn.Position = UDim2.fromScale(0.05, 0.7)
- copyBtn.Text = "COPIAR ID"
- copyBtn.TextScaled = true
- copyBtn.BackgroundColor3 = Color3.fromRGB(70,70,70)
- copyBtn.TextColor3 = Color3.new(1,1,1)
- copyBtn.MouseButton1Click:Connect(function()
- -- Tenta copiar (funciona no PC, e em alguns mobiles)
- if setclipboard then
- setclipboard(tostring(player.UserId))
- copyBtn.Text = "COPIADO ✅"
- else
- -- fallback: seleciona o texto
- box:CaptureFocus()
- box.SelectionStart = 1
- box.CursorPosition = #box.Text + 1
- copyBtn.Text = "SELECIONADO"
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment