Advertisement
2AreYouMental110

copy cframe gui

Apr 3rd, 2023
1,550
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.17 KB | None | 0 0
  1. function notif(title,text)
  2.     if text then
  3.         game:GetService("StarterGui"):SetCore("SendNotification",{tostring(title),tostring(text)})
  4.     else
  5.         game:GetService("StarterGui"):SetCore("SendNotification",{tostring(title),tostring(title)})
  6.     end
  7. end
  8. local notdestroyed = true
  9. local localplr = game.Players.LocalPlayer
  10. if getgenv().cframegui then
  11.     getgenv().cframegui:Destroy()
  12. end
  13. getgenv().cframegui = Instance.new("ScreenGui")
  14. cframegui.Parent = game.CoreGui
  15. local mainframe = Instance.new("Frame")
  16. mainframe.Parent = cframegui
  17. mainframe.Size = UDim2.new(.2,0,.15,0)
  18. mainframe.Position = UDim2.new(.4,0,.435)
  19. mainframe.Active = true
  20. mainframe.Draggable = true
  21. mainframe.BackgroundColor3 = Color3.fromRGB(40,40,40)
  22. local credits = Instance.new("TextLabel")
  23. credits.Parent = mainframe
  24. credits.Size = UDim2.new(1,0,.3)
  25. credits.Text = "Original by Jmuse, Remake by 2AreYouMental110"
  26. credits.BackgroundColor3 = Color3.fromRGB(50,50,50)
  27. credits.TextColor3 = Color3.fromRGB(255,255,255)
  28. credits.TextScaled = true
  29. local copycframe = Instance.new("TextButton")
  30. copycframe.Parent = mainframe
  31. copycframe.Size = UDim2.new(1,0,.7)
  32. copycframe.Position = UDim2.new(0,0,0.3)
  33. copycframe.BackgroundColor3 = Color3.fromRGB(60,60,60)
  34. copycframe.TextColor3 = Color3.fromRGB(255,255,255)
  35. copycframe.TextScaled = true
  36. copycframe.Text = "Click To Copy"
  37. local a = copycframe.MouseButton1Click:Connect(function()
  38.     if localplr.Character ~= nil and localplr.Character:FindFirstChild("HumanoidRootPart") then
  39.         setclipboard("CFrame.new("..tostring(localplr.Character.HumanoidRootPart.CFrame)..")")
  40.         copycframe.Text = "Copied!"
  41.         notif("Copied!")
  42.     else
  43.         copycframe.Text = "Can't find character or humanoidrootpart!"
  44.     end
  45. end)
  46. local b = cframegui.Destroying:Connect(function()
  47.     notdestroyed = false
  48. end)
  49. wait(4)
  50. while notdestroyed do
  51.     wait(1)
  52.     if localplr.Character ~= nil and localplr.Character:FindFirstChild("HumanoidRootPart") then
  53.         copycframe.Text = tostring(localplr.Character.HumanoidRootPart.CFrame)
  54.     else
  55.         copycframe.Text = "Can't find character or humanoidrootpart!"
  56.     end
  57. end
  58. a:Disconnect()
  59. b:Disconnect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement