Advertisement
timmie140

Loaction

Dec 27th, 2024 (edited)
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. -- Function to copy the player's current location to the clipboard
  2. local function copyLocationToClipboard()
  3. -- Get the player's character and ensure it exists
  4. local player = game.Players.LocalPlayer
  5. local character = player.Character or player.CharacterAdded:Wait()
  6.  
  7. -- Ensure the character has a PrimaryPart (the part used for positioning)
  8. local primaryPart = character:WaitForChild("HumanoidRootPart")
  9.  
  10. -- Get the current position of the player
  11. local currentPosition = primaryPart.Position
  12.  
  13. -- Format the location as a string (for example: CFrame.new(x, y, z))
  14. local locationString = "(" .. currentPosition.X .. ", " .. currentPosition.Y .. ", " .. currentPosition.Z .. ")"
  15.  
  16. -- Copy the location to the clipboard
  17. setclipboard(locationString)
  18.  
  19. -- Notify the user that the location has been copied
  20. print("Current location copied to clipboard: " .. locationString)
  21. end
  22.  
  23. -- Call the function to copy the location
  24. copyLocationToClipboard()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement