diff --git a/MainModule/Server/Commands/Moderators.lua b/MainModule/Server/Commands/Moderators.lua index 1bf1e11418..f073f7e94a 100644 --- a/MainModule/Server/Commands/Moderators.lua +++ b/MainModule/Server/Commands/Moderators.lua @@ -3798,12 +3798,6 @@ return function(Vargs, env) AdminLevel = "Moderators"; Function = function(plr: Player, args: {string}) for i, v in pairs(service.GetPlayers(plr, args[1])) do - local backpack = v:FindFirstChildOfClass("Backpack") - if backpack then - for _, tool in pairs(backpack:GetChildren()) do - if tool:IsA("BackpackItem") then tool:Destroy() end - end - end if v.Character then local hum = v.Character:FindFirstChildOfClass("Humanoid") if hum then hum:UnequipTools() end @@ -3811,6 +3805,12 @@ return function(Vargs, env) if tool:IsA("BackpackItem") then tool:Destroy() end end end + local backpack = v:FindFirstChildOfClass("Backpack") + if backpack then + for _, tool in pairs(backpack:GetChildren()) do + if tool:IsA("BackpackItem") then tool:Destroy() end + end + end end end }; @@ -3825,19 +3825,19 @@ return function(Vargs, env) AdminLevel = "Moderators"; Function = function(plr: Player, args: {string}) for i, v in pairs(service.GetPlayers(plr, args[1])) do - local backpack = v:FindFirstChildOfClass("Backpack") - if backpack then - for _, tool in pairs(backpack:GetChildren()) do + if v.Character then + for _, tool in pairs(v.Character:GetChildren()) do if tool:IsA("BackpackItem") and string.sub(tool.Name:lower(), 1, #args[2])== args[2]:lower() then + local hum = v.Character:FindFirstChildOfClass("Humanoid") + if hum then hum:UnequipTools() end tool:Destroy() end end end - if v.Character then - for _, tool in pairs(v.Character:GetChildren()) do + local backpack = v:FindFirstChildOfClass("Backpack") + if backpack then + for _, tool in pairs(backpack:GetChildren()) do if tool:IsA("BackpackItem") and string.sub(tool.Name:lower(), 1, #args[2])== args[2]:lower() then - local hum = v.Character:FindFirstChildOfClass("Humanoid") - if hum then hum:UnequipTools() end tool:Destroy() end end