Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Function to copy the player's current location to the clipboard
- local function copyLocationToClipboard()
- -- Get the player's character and ensure it exists
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- -- Ensure the character has a PrimaryPart (the part used for positioning)
- local primaryPart = character:WaitForChild("HumanoidRootPart")
- -- Get the current position of the player
- local currentPosition = primaryPart.Position
- -- Format the location as a string (for example: CFrame.new(x, y, z))
- local locationString = "(" .. currentPosition.X .. ", " .. currentPosition.Y .. ", " .. currentPosition.Z .. ")"
- -- Copy the location to the clipboard
- setclipboard(locationString)
- -- Notify the user that the location has been copied
- print("Current location copied to clipboard: " .. locationString)
- end
- -- Call the function to copy the location
- copyLocationToClipboard()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement