Advertisement
justneed

Print Part's name, parent or clone it script

Dec 25th, 2024 (edited)
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.31 KB | Gaming | 0 0
  1. local plr = game:GetService("Players")
  2. local me  = plr.LocalPlayer
  3. local hum = me.Character.Humanoid
  4. local hrp = me.Character.HumanoidRootPart
  5.  
  6. local work = game:GetService("Workspace")
  7.  
  8. local mouse = me:GetMouse()
  9. local mhit  = mouse.Hit.p + Vector3.new(0,2.5,0)
  10.  
  11. local patarget = mouse.Target
  12.  
  13. local pgui  = Instance.new("ScreenGui")
  14. pgui.Parent = me.PlayerGui
  15. pgui.Name   = "Result"
  16.  
  17. local terame                  = Instance.new("Frame")
  18. terame.Parent                 = pgui
  19. terame.Size                   = UDim2.new(0.3,0,0.2,0)
  20. terame.Position               = UDim2.new(0.68, 0, 0.7,0)
  21. terame.BackgroundTransparency = 0.5
  22.  
  23. local pext             = Instance.new("TextBox")
  24. pext.ClearTextOnFocus  = false
  25. pext.Parent            = terame
  26. pext.Text              = ""
  27. pext.PlaceholderText   = "Result will be here"
  28. pext.Size              = UDim2.new(0.8,0,0.6,0)
  29. pext.Position          = UDim2.new(0.1,0,0.2,0)
  30. pext.TextSize          = 16
  31. pext.PlaceholderColor3 = Color3.fromRGB(55,55,55)
  32.  
  33. terame.Active    = true
  34. terame.Draggable = true
  35.  
  36. local parentGui   = Instance.new("ScreenGui")
  37. parentGui.Name    = "Parent_Choose"
  38. parentGui.Parent  = me.PlayerGui
  39. parentGui.Enabled = false
  40.  
  41. local prame                  = Instance.new("Frame")
  42. prame.Parent                 = parentGui
  43. prame.Size                   = UDim2.new(0, 450, 0, 250)
  44. prame.Position               = UDim2.new(0.02, 0, 0.7, 0)
  45. prame.BackgroundTransparency = 0.5
  46.  
  47. prame.Active    = true
  48. prame.Draggable = true
  49.  
  50. local ptn    = Instance.new("TextButton")
  51. ptn.Parent   = prame
  52. ptn.Text     = "Parent"
  53. ptn.Position = UDim2.new(0.03,0,0.04,0)
  54. ptn.Size     = UDim2.new(0.15,0,0.1,0)
  55. ptn.TextSize = 12
  56.  
  57. local cptn    = ptn:Clone()
  58. cptn.Parent   = prame
  59. cptn.Text     = "P.P"
  60. cptn.Position = UDim2.new(0.2,0,0.04,0)
  61.  
  62. local cptn2    = ptn:Clone()
  63. cptn2.Parent   = prame
  64. cptn2.Text     = "P.P.P"
  65. cptn2.Position = UDim2.new(0.37,0,0.04,0)
  66.  
  67. local cptn3    = ptn:Clone()
  68. cptn3.Parent   = prame
  69. cptn3.Text     = "P.P.P.P"
  70. cptn3.Position = UDim2.new(0.54,0,0.04,0)
  71.  
  72. local cptn4    = ptn:Clone()
  73. cptn4.Parent   = prame
  74. cptn4.Text     = "P.P.P.P.P"
  75. cptn4.Position = UDim2.new(0.71,0,0.04,0)
  76.  
  77. local cptn5    = ptn:Clone()
  78. cptn5.Parent   = prame
  79. cptn5.Size     = UDim2.new(0.25,0,0.1,0)
  80. cptn5.Text     = "P.P.P.P.P.P"
  81. cptn5.Position = UDim2.new(0.03,0,0.17,0)
  82.  
  83. local cptn6    = ptn:Clone()
  84. cptn6.Parent   = prame
  85. cptn6.Size     = UDim2.new(0.25,0,0.1,0)
  86. cptn6.Text     = "P.P.P.P.P.P.P"
  87. cptn6.Position = UDim2.new(0.3,0,0.17,0)
  88.  
  89. local cptn7    = ptn:Clone()
  90. cptn7.Parent   = prame
  91. cptn7.Size     = UDim2.new(0.25,0,0.1,0)
  92. cptn7.Text     = "P.P.P.P.P.P.P.P"
  93. cptn7.Position = UDim2.new(0.57,0,0.17,0)
  94.  
  95. local lab                  = Instance.new("TextLabel")
  96. lab.Parent                 = prame
  97. lab.BackgroundTransparency = 1
  98. lab.BorderSizePixel        = 0
  99. lab.TextSize               = 18
  100. lab.Text                   = "P = Parent"
  101. lab.Position               = UDim2.new(0.47, 0, 0.4, 0)
  102.  
  103. local status    = lab:Clone()
  104. status.Parent   = prame
  105. status.Position = UDim2.new(0.47,0,0.52,0)
  106. status.Text     = "Choose"
  107.  
  108. local tool          = Instance.new("Tool")
  109. tool.RequiresHandle = false
  110. tool.Parent         = me.Backpack
  111. tool.Name           = "Name"
  112.  
  113. local tool2          = Instance.new("Tool")
  114. tool2.RequiresHandle = false
  115. tool2.Parent         = me.Backpack
  116. tool2.Name           = "Parent"
  117.  
  118. local tool3          = Instance.new("Tool")
  119. tool3.RequiresHandle = false
  120. tool3.Parent         = me.Backpack
  121. tool3.Name           = "Clone"
  122.  
  123. tool.Activated:Connect(function()
  124.     if mouse.Target:IsA("BasePart") then
  125.         print(mouse.Target)
  126.         pext.Text = mouse.Target.Name
  127.     end
  128. end)
  129.  
  130. tool3.Activated:Connect(function()
  131.     local ctarget = mouse.Target
  132.     if ctarget:IsA("BasePart") then
  133.         local cl  = ctarget:Clone()
  134.         cl.Parent = ctarget.Parent
  135.         cl.CFrame = hrp.CFrame
  136.     end
  137. end)
  138.  
  139. tool2.Equipped:Connect(function()
  140.     parentGui.Enabled = true
  141. end)
  142.  
  143. tool2.Unequipped:Connect(function()
  144.     parentGui.Enabled = false
  145. end)
  146.  
  147. ptn.MouseButton1Click:Connect(function()
  148.     status.Text = "Parent"
  149. end)
  150.  
  151. cptn.MouseButton1Click:Connect(function()
  152.     status.Text = "Parent.Parent"
  153. end)
  154.  
  155. cptn2.MouseButton1Click:Connect(function()
  156.     status.Text = "Parent.Parent.Parent"
  157. end)
  158.  
  159. cptn3.MouseButton1Click:Connect(function()
  160.     status.Text = "Parent.Parent.Parent.Parent"
  161. end)
  162.  
  163. cptn4.MouseButton1Click:Connect(function()
  164.     status.Text = "Parent.Parent.Parent.Parent.Parent"
  165. end)
  166.  
  167. cptn5.MouseButton1Click:Connect(function()
  168.     status.Text = "Parent.Parent.Parent.Parent.Parent.Parent"
  169. end)
  170.  
  171. cptn6.MouseButton1Click:Connect(function()
  172.     status.Text = "Parent.Parent.Parent.Parent.Parent.Parent.Parent"
  173. end)
  174.  
  175. cptn7.MouseButton1Click:Connect(function()
  176.     status.Text = "Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent"
  177. end)
  178.  
  179. tool2.Activated:Connect(function()
  180.     if status.Text == "Parent" then
  181.         if patarget:IsA("BasePart") then
  182.             print(mouse.Target.Parent)
  183.             pext.Text = mouse.Target.Parent.Name
  184.         end
  185.     elseif status.Text == "Parent.Parent" then
  186.         if patarget:IsA("BasePart") then
  187.             print(mouse.Target.Parent.Parent)
  188.             pext.Text = mouse.Target.Parent.Parent.Name
  189.         end
  190.     elseif status.Text == "Parent.Parent.Parent" then
  191.         if patarget:IsA("BasePart") then
  192.             print(mouse.Target.Parent.Parent.Parent)
  193.             pext.Text = mouse.Target.Parent.Parent.Parent.Name
  194.         end
  195.     elseif status.Text == "Parent.Parent.Parent.Parent" then
  196.         if patarget:IsA("BasePart") then
  197.             print(mouse.Target.Parent.Parent.Parent.Parent)
  198.             pext.Text = mouse.Target.Parent.Parent.Parent.Parent.Name
  199.         end
  200.     elseif status.Text == "Parent.Parent.Parent.Parent.Parent" then
  201.         if patarget:IsA("BasePart") then
  202.             print(mouse.Target.Parent.Parent.Parent.Parent.Parent)
  203.             pext.Text = mouse.Target.Parent.Parent.Parent.Parent.Parent.Name
  204.         end
  205.     elseif status.Text == "Parent.Parent.Parent.Parent.Parent.Parent" then
  206.         if patarget:IsA("BasePart") then
  207.             print(mouse.Target.Parent.Parent.Parent.Parent.Parent.Parent)
  208.             pext.Text = mouse.Target.Parent.Parent.Parent.Parent.Parent.Parent.Name
  209.         end
  210.     elseif status.Text == "Parent.Parent.Parent.Parent.Parent.Parent.Parent" then
  211.         if patarget:IsA("BasePart") then
  212.             print(mouse.Target.Parent.Parent.Parent.Parent.Parent.Parent.Parent)
  213.             pext.Text = mouse.Target.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Name
  214.         end
  215.     elseif status.Text == "Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent" then
  216.         if patarget:IsA("BasePart") then
  217.             print(mouse.Target.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent)
  218.             pext.Text = mouse.Target.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Name
  219.         end
  220.     else
  221.         game:GetService("StarterGui"):SetCore("SendNotification",{
  222.         Title = "Helper",
  223.         Text  = "Choose!!!",
  224.         Icon  = "rbxassetid://137790612712172"
  225.         })
  226.     end
  227. end)
  228.  
  229. game:GetService("StarterGui"):SetCore("SendNotification",{
  230.     Title = "Helper",
  231.     Text  = "Name and Parent will be printed in console and textbox!",
  232.     Icon  = "rbxassetid://137790612712172"
  233. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement