Guest User

Untitled

a guest
Jul 13th, 2025
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1.  
  2. local function UpdateInv()
  3.    
  4.    
  5.  
  6.    
  7.     CleanInv()
  8.    
  9.    
  10.     local plrinv = GetPlrInv:InvokeServer()
  11.    
  12.    
  13.     local function GetAmountOf(itemname)
  14.         local amount = 0
  15.         for i, v in pairs(plrinv["Inventory"])do
  16.             if v == itemname then
  17.                 amount += 1
  18.             end
  19.         end
  20.         return amount
  21.     end
  22.    
  23.    
  24.     local AmountInInv
  25.    
  26.    
  27.     for i, v in plrinv["Inventory"] do
  28.         AmountInInv = GetAmountOf(v)
  29.         print(AmountInInv)
  30.     end
  31.    
  32.    
  33.  
  34. print(AmountInInv)
  35. if AmountInInv < hotbarslots then
  36.     print("Adding to hotbar")
  37.    
  38. end
  39.    
  40.     if AmountInInv > hotbarslots then
  41.         print("Adding to inventory")
  42.     end
  43.    
  44. end
  45.  
  46.  
  47. player.Backpack.ChildAdded:Connect(UpdateInv)
  48.  
  49.  
Advertisement
Add Comment
Please, Sign In to add comment