From e72c8d9c18e03128fb0df291e141f32021729b1f Mon Sep 17 00:00:00 2001 From: hero Date: Sun, 30 Nov 2025 21:59:28 +0900 Subject: [PATCH 1/2] Made BackpackItemAdded and BackpackItemRemoved events return 'slot' objects --- src/init.luau | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/init.luau b/src/init.luau index 8127e2b..0a75d26 100644 --- a/src/init.luau +++ b/src/init.luau @@ -997,7 +997,7 @@ local function OnChildAdded(child: Instance): () -- To Character or Backpack end end - BackpackScript.BackpackItemAdded:Fire() + BackpackScript.BackpackItemAdded:Fire(slot) end local function OnChildRemoved(child: Instance): () -- From Character or Backpack @@ -1028,7 +1028,7 @@ local function OnChildRemoved(child: Instance): () -- From Character or Backpack ActiveHopper = nil :: any end - BackpackScript.BackpackItemRemoved:Fire() + BackpackScript.BackpackItemRemoved:Fire(slot) if isInventoryEmpty() then BackpackScript.BackpackEmpty:Fire() end From 3cb4057e6cfade8589b403d0c6ca20508fd1ec64 Mon Sep 17 00:00:00 2001 From: hero <89772765+hero3806@users.noreply.github.com> Date: Wed, 3 Dec 2025 23:24:32 +0900 Subject: [PATCH 2/2] Safe slot error handling Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: hero <89772765+hero3806@users.noreply.github.com> --- src/init.luau | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/init.luau b/src/init.luau index 0a75d26..ea33293 100644 --- a/src/init.luau +++ b/src/init.luau @@ -1028,7 +1028,9 @@ local function OnChildRemoved(child: Instance): () -- From Character or Backpack ActiveHopper = nil :: any end - BackpackScript.BackpackItemRemoved:Fire(slot) + if slot then + BackpackScript.BackpackItemRemoved:Fire(slot) + end if isInventoryEmpty() then BackpackScript.BackpackEmpty:Fire() end