Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function UpdateInv()
- CleanInv()
- local plrinv = GetPlrInv:InvokeServer()
- local function GetAmountOf(itemname)
- local amount = 0
- for i, v in pairs(plrinv["Inventory"])do
- if v == itemname then
- amount += 1
- end
- end
- return amount
- end
- local AmountInInv
- for i, v in plrinv["Inventory"] do
- AmountInInv = GetAmountOf(v)
- print(AmountInInv)
- end
- print(AmountInInv)
- if AmountInInv < hotbarslots then
- print("Adding to hotbar")
- end
- if AmountInInv > hotbarslots then
- print("Adding to inventory")
- end
- end
- player.Backpack.ChildAdded:Connect(UpdateInv)
Advertisement
Add Comment
Please, Sign In to add comment