Rezokar

Check Inventory

May 9th, 2021 (edited)
615
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local localplr = game.Players.LocalPlayer
  2.  
  3. local screen = Instance.new("ScreenGui")
  4. screen.Parent = localplr.PlayerGui
  5. screen.Name = "BackPackViewer"
  6. local uip = game:GetService("UserInputService")
  7. local frame = Instance.new("Frame")
  8. frame.Parent = screen
  9. frame.Name = "MainFrame"
  10. frame.BackgroundColor3 = Color3.new(0,0,0)
  11. frame.Size = UDim2.new(0.4,0,0.4,0)
  12. frame.Position = UDim2.new(-1,0,0.5,0)
  13. frame.AnchorPoint = Vector2.new(0.5,0.5)
  14. local exec = Instance.new("TextButton")
  15. exec.Name = "Execute"
  16. exec.Parent = frame
  17. exec.Text = "Execute"
  18. exec.TextColor3 = Color3.new(1,0,0)
  19. exec.Font = Enum.Font.Merriweather
  20. exec.BackgroundTransparency = 1
  21. exec.BorderColor3 = Color3.new(0,0,0)
  22. exec.TextScaled = true
  23. exec.Size = UDim2.new(0.5,0,0.1,0)
  24. exec.Position = UDim2.new(0.5,0,0.9,0)
  25. exec.ZIndex = 5
  26. local db = false
  27. local scrol = Instance.new("ScrollingFrame")
  28. scrol.Parent = frame
  29. scrol.Name = "Tools"
  30. scrol.BackgroundColor3 = Color3.new(0,0,0)
  31. scrol.Size = UDim2.new(1,0,0.9,0)
  32. local ui = Instance.new("UIListLayout")
  33. ui.Parent = scrol
  34. local nm = Instance.new("TextBox")
  35. nm.Font = Enum.Font.Merriweather
  36. nm.PlaceholderText = "Click me to type player name!"
  37. nm.Text = ""
  38. nm.Parent = frame
  39. nm.BackgroundTransparency = 1
  40. nm.BorderColor3 = Color3.new(0,0,0)
  41. nm.ZIndex = 5
  42. nm.TextScaled = true
  43. nm.Size = UDim2.new(0.5,0,0.1,0)
  44. nm.TextEditable = true
  45. nm.Position = UDim2.new(0,0,0.9,0)
  46. nm.TextColor3 = Color3.new(1,1,1)
  47. ui.Name = "del"
  48. ui.SortOrder = "Name"
  49. wait()
  50. scrol.CanvasSize = UDim2.new(0,0,0,ui.AbsoluteContentSize.Y)
  51. scrol.AutomaticCanvasSize = "Y"
  52. frame:TweenPosition(UDim2.new(0.5,0,0.5,0),"InOut","Quint",1,true)
  53.  
  54. local function createtextbox(txt,pr,name)
  55.     local nmm = Instance.new("TextLabel")
  56.     nmm.Font = Enum.Font.Merriweather
  57.     nmm.Text = txt
  58.     nmm.Parent = pr
  59.     nmm.Name = name
  60.     nmm.BackgroundColor3 = Color3.new(0,0,0)
  61.     nmm.TextColor3 = Color3.new(1,1,1)
  62.     nmm.Size = UDim2.new(0.95,0,0,80)
  63.     nmm.ZIndex = 10
  64.     nmm.TextScaled = true
  65.     nmm.BorderSizePixel = 0
  66. end
  67.  
  68. spawn(function()
  69.     uip.InputBegan:Connect(function(input)
  70.         if input.KeyCode == Enum.KeyCode.KeypadEight then
  71.             if frame.Position == UDim2.new(0.5,0,0.5,0) then
  72.                 frame:TweenPosition(UDim2.new(-1,0,-0.5,0),"InOut","Quint",0.4,true)
  73.             else
  74.                 frame:TweenPosition(UDim2.new(0.5,0,0.5,0),"InOut","Quint",0.4,true)
  75.             end
  76.         elseif input.KeyCode == Enum.KeyCode.KeypadSeven then
  77.             screen:Destroy()
  78.         end
  79.     end)
  80.     exec.MouseButton1Click:Connect(function()
  81.         local tl = {}
  82.         if db == false then
  83.             db = true
  84.             for i,v in pairs(scrol:GetChildren()) do
  85.                 if v.Name ~= "del" then
  86.                     v:Destroy()
  87.                 end
  88.             end
  89.             local plr = nil
  90.             for i,v in pairs(game.Players:GetChildren()) do
  91.                 if string.lower(v.Name) == string.lower(nm.Text) then
  92.                     plr = v
  93.                 end
  94.             end
  95.             if plr ~= nil then
  96.                
  97.                 for i,v in pairs(plr.Backpack:GetChildren()) do
  98.                         if not tl[v.Name] then
  99.                             tl[v.Name] = 1
  100.                         else
  101.                             tl[v.Name] = tl[v.Name] + 1
  102.                         end
  103.                     end
  104.                
  105.                 for i,v in pairs(tl) do
  106.                     if(v ~= 1) then
  107.                         createtextbox(i.." x"..v,scrol,i)      
  108.                     else
  109.                         createtextbox(i,scrol,i)   
  110.                     end
  111.                 end
  112.                 scrol.CanvasSize = UDim2.new(0,0,0,ui.AbsoluteContentSize.Y)
  113.             else
  114.                 exec.Text = "Player Not Found!"
  115.                 wait(1.5)
  116.                 exec.Text = "Execute"
  117.             end
  118.  
  119.             wait(1)
  120.             db = false
  121.         end
  122.     end)
  123. end)
RAW Paste Data