Advertisement
Zuklim65

Sumga

Apr 3rd, 2025
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local character = player.Character or player.CharacterAdded:Wait()
  3. local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
  4.  
  5. -- GUI setup
  6. local screenGui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))
  7. screenGui.Name = "MobileCoordsGUI"
  8. screenGui.ResetOnSpawn = false
  9.  
  10. -- Get Coordinates Button
  11. local getButton = Instance.new("TextButton")
  12. getButton.Size = UDim2.new(0, 200, 0, 50)
  13. getButton.Position = UDim2.new(0.5, -100, 0.3, 0)
  14. getButton.Text = "Get Coordinates"
  15. getButton.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
  16. getButton.TextColor3 = Color3.new(1, 1, 1)
  17. getButton.Font = Enum.Font.SourceSansBold
  18. getButton.TextScaled = true
  19. getButton.Parent = screenGui
  20.  
  21. -- Coordinates TextBox
  22. local coordBox = Instance.new("TextBox")
  23. coordBox.Size = UDim2.new(0, 300, 0, 50)
  24. coordBox.Position = UDim2.new(0.5, -150, 0.4, 0)
  25. coordBox.Text = "X: 0, Y: 0, Z: 0"
  26. coordBox.ClearTextOnFocus = false
  27. coordBox.TextEditable = false
  28. coordBox.Font = Enum.Font.SourceSans
  29. coordBox.TextScaled = true
  30. coordBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  31. coordBox.TextColor3 = Color3.new(0, 0, 0)
  32. coordBox.Parent = screenGui
  33.  
  34. -- Copy Button
  35. local copyButton = Instance.new("TextButton")
  36. copyButton.Size = UDim2.new(0, 200, 0, 50)
  37. copyButton.Position = UDim2.new(0.5, -100, 0.5, 0)
  38. copyButton.Text = "Copy"
  39. copyButton.BackgroundColor3 = Color3.fromRGB(0, 200, 100)
  40. copyButton.TextColor3 = Color3.new(1, 1, 1)
  41. copyButton.Font = Enum.Font.SourceSansBold
  42. copyButton.TextScaled = true
  43. copyButton.Parent = screenGui
  44.  
  45. -- Function to get position
  46. local function updateCoords()
  47. local char = player.Character or player.CharacterAdded:Wait()
  48. local hrp = char:WaitForChild("HumanoidRootPart", 2)
  49. if hrp then
  50. local pos = hrp.Position
  51. coordBox.Text = string.format("X: %.2f, Y: %.2f, Z: %.2f", pos.X, pos.Y, pos.Z)
  52. end
  53. end
  54.  
  55. -- Button events
  56. getButton.MouseButton1Click:Connect(updateCoords)
  57.  
  58. copyButton.MouseButton1Click:Connect(function()
  59. if setclipboard then
  60. setclipboard(coordBox.Text)
  61. else
  62. coordBox.Text = "Copy not supported here"
  63. end
  64. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement