Can client not find modules from tools?

Character.ChildAdded:Connect(function(child)
	if child:IsA('Tool') then
		local Control = child:FindFirstChild('Control')
		print(Control)
		if Control then
			require(Control)
		end
	end
end)

Prints nil


As you can see, a module called ‘Control’ does exist within the tool

Did you try waiting for the control module?

Don’t see how waiting would make a difference. If it’s a child of an object it should be loaded in as soon as the parent itself has loaded

You don’t know if you haven’t tried it. I recommend trying it.

1 Like

Hmm ok ye for some reason that works :confused: Still not sure how I feel about using WaitForChild, as it’s tended to break my games in the past (players leaving mid WaitForChild, etc)

Since the WaitForChild is on the client, there shouldn’t really be any gamebreaking cases that replicate to the server, especially if it is just related to a tool. I can’t say for your specific use case though.

Alternatively, you can store all the modules for your tools in ReplicatedFirst and require them by name, or use a module loader such as Nevermore

:WaitForChild has a second argument, which is a time-out. So you can use it like so:

Tool:WaitForChild("Control", 1)

And it will wait at most 1 second and return nil if the module isn’t found.