Advertisement
NeonFox__

Piggy script

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