How to unequipped tool from all players from server script

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    unequipped tool from all players in the server at the one time
  2. What is the issue? Include screenshots / videos if possible!
    unable to script it correctly

I am using this in the script to gather the player but am inable to uneqipped the server.

for _,plr in pairs(game.Players:GetChildren()) do
end

Get the tool from the character and move it to player.Backpack.

for _,plr in pairs(game.Players:GetPlayers()) do
    if plr.Character then --make sure they have a character so you don't throw an error
        local tool = plr.Character:FindFirstChildOfClass("Tool")
        if tool then
            tool.Parent = plr.Backpack -- or you could do tool:Destroy()
        end
    end
end
1 Like

thank you mate :+1: :+1:
:+1:
:+1:
:+1:

Honestly, if you don’t want to break your scripts (unequipped event doesnt always fire in tools, after parented)

Find the Humanoid of the player, and run hum:UnequipTools() on it.

That’s simply a better way to avoid tools from breaking.

2 Likes