Advertisement
Guest User

Copy ava orang

a guest
Mar 23rd, 2025
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local InsertService = game:GetService("InsertService")
  3.  
  4. -- Buat UI
  5. local screenGui = Instance.new("ScreenGui")
  6. screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  7.  
  8. local frame = Instance.new("Frame")
  9. frame.Size = UDim2.new(0, 300, 0, 150)
  10. frame.Position = UDim2.new(0.5, -150, 0.5, -75)
  11. frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  12. frame.Active = true
  13. frame.Draggable = true -- Bisa dipindah
  14. frame.Parent = screenGui
  15.  
  16. local usernameBox = Instance.new("TextBox")
  17. usernameBox.Size = UDim2.new(0.8, 0, 0, 30)
  18. usernameBox.Position = UDim2.new(0.1, 0, 0.2, 0)
  19. usernameBox.PlaceholderText = "Masukkan Username..."
  20. usernameBox.Parent = frame
  21.  
  22. local copyButton = Instance.new("TextButton")
  23. copyButton.Size = UDim2.new(0.8, 0, 0, 30)
  24. copyButton.Position = UDim2.new(0.1, 0, 0.5, 0)
  25. copyButton.Text = "Copy Avatar"
  26. copyButton.Parent = frame
  27.  
  28. local closeButton = Instance.new("TextButton")
  29. closeButton.Size = UDim2.new(0.2, 0, 0, 30)
  30. closeButton.Position = UDim2.new(0.8, -10, 0, -10)
  31. closeButton.Text = "X"
  32. closeButton.Parent = frame
  33.  
  34. -- Fungsi untuk Copy Avatar
  35. copyButton.MouseButton1Click:Connect(function()
  36. local username = usernameBox.Text
  37. local success, userId = pcall(function()
  38. return Players:GetUserIdFromNameAsync(username)
  39. end)
  40.  
  41. if success and userId then
  42. local humanoidDescription = Players:GetHumanoidDescriptionFromUserId(userId)
  43. local character = Players.LocalPlayer.Character
  44. if character and character:FindFirstChild("Humanoid") then
  45. character.Humanoid:ApplyDescription(humanoidDescription)
  46. end
  47. else
  48. warn("Username tidak ditemukan!")
  49. end
  50. end)
  51.  
  52. -- Fungsi untuk Menutup UI
  53. closeButton.MouseButton1Click:Connect(function()
  54. screenGui:Destroy()
  55. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement