Advertisement
aewdfawd623

PIGGY

Apr 9th, 2020
79,922
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.38 KB | None | 0 0
  1. local PiggyGui = Instance.new("ScreenGui")
  2. PiggyGui.Name = "PiggyGui"
  3. PiggyGui.Parent = game.StarterGui
  4. PiggyGui.Draggable = true
  5.  
  6. local ScrollingFrame = Instance.new("ScrollingFrame", PiggyGui)
  7. ScrollingFrame.BackgroundColor3 = Color3.new(0.15, 0.15, 0.15)
  8. ScrollingFrame.Position = UDim2.new(0.08, 0, 0.42, 0)
  9. ScrollingFrame.Size = UDim2.new(0, 296, 0, 388)
  10.  
  11.  
  12.  
  13.  
  14. local PiggyGui = Instance.new("ScreenGui")
  15. PiggyGui.Name = "PiggyGui"
  16. PiggyGui.Parent = game.CoreGui
  17.  
  18. local ScrollingFrame = Instance.new("ScrollingFrame", PiggyGui)
  19. ScrollingFrame.BackgroundColor3 = Color3.new(0.15, 0.15, 0.15)
  20. ScrollingFrame.Position = UDim2.new(0.08, 0, 0.42, 0)
  21. ScrollingFrame.Size = UDim2.new(0, 296, 0, 388)
  22.  
  23. local UIGridLayout = Instance.new("UIGridLayout", ScrollingFrame)
  24. UIGridLayout.CellSize = UDim2.new(0,90,0,90)
  25.  
  26. while wait(1) do
  27. local a = workspace:getDescendants()
  28. local items = {}
  29. local itemframes = ScrollingFrame:getChildren()
  30. for i=1,#itemframes do
  31. if itemframes[i].ClassName == "TextButton" then
  32. itemframes[i]:remove()
  33. end
  34. end
  35. for i=1,#a do
  36. if a[i].Name == "ItemPickupScript" and a[i].Parent:findFirstChild("ClickDetector") then
  37. table.insert(items, a[i].Parent)
  38. end
  39. end
  40. for i=1,#items do
  41. local ItemFrame = Instance.new("TextButton", ScrollingFrame)
  42. ItemFrame.Name = "ItemFrame"
  43. ItemFrame.BackgroundColor3 = Color3.new(1, 1, 1)
  44. ItemFrame.BackgroundTransparency = 0.95
  45. ItemFrame.Size = UDim2.new(0, 100, 0, 100)
  46. ItemFrame.Text = ""
  47. local View = Instance.new("ViewportFrame", ItemFrame)
  48. View.Name = "View"
  49. View.Size = UDim2.new(1,0,1,0)
  50. View.BackgroundTransparency = 1
  51. View.BorderSizePixel = 0
  52. local object = items[i]
  53. local viewportclone = object:Clone()
  54. viewportclone.Parent = View
  55. local cam = Instance.new("Camera", viewportclone)
  56. cam.CameraType = Enum.CameraType.Fixed
  57. local objectPosition = object.Position
  58. local cameraPosition = objectPosition + Vector3.new(0,3,0)
  59. cam.CoordinateFrame = CFrame.new(cameraPosition, objectPosition)
  60. View.CurrentCamera = cam
  61.  
  62. ItemFrame.MouseButton1Down:connect(function()
  63. if items[i]:findFirstChild("ClickDetector") then
  64. local cpos = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame
  65. wait(0.05)
  66. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = items[i].CFrame
  67. wait(0.1)
  68. fireclickdetector(items[i].ClickDetector)
  69. wait(0.3)
  70. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = cpos
  71. end
  72. end)
  73. end
  74. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement