Advertisement
Rin-Tohsaka

piggy item gui

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