Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would I remove certain tools from EVERY player in the game?

I know that THIS removes tools from a certain player.. But what if I want to remove it from every player?

game.Players.PlayerAdded:Connect(function(plr)
	plr.Chatted:Connect(function(msg)
		if msg == "RemoveTools" then
			plr.Backpack.Tool:Remove()
		end
	end)
end)

1 answer

You can use a loop to iterate through all of the players in the game and destroy their tools.

game.Players.PlayerAdded:Connect(function(plr)
    plr.Chatted:Connect(function(msg)
        if msg == "RemoveTools" then
			for i,v in pairs(game.Players:GetPlayers()) do
				v.Backpack.Tool:Destroy()
			end
        end
    end)
end)

This is basically what you said except it iterates through all the player's and destroys their tools.

This discussion is preserved as it was. New answers, comments, and votes are closed.