Skip to content

Commit

Permalink
fix :removetools & :removetool
Browse files Browse the repository at this point in the history
  • Loading branch information
Expertcoderz authored Dec 4, 2021
1 parent 8e83f4d commit 0f0f5c0
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions MainModule/Server/Commands/Moderators.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3798,19 +3798,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 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
for _, tool in pairs(v.Character:GetChildren()) do
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
};
Expand All @@ -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
Expand Down

0 comments on commit 0f0f5c0

Please sign in to comment.